/*
 RequireJS text 0.24.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/jrburke/requirejs for details
 RequireJS i18n 0.24.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/jrburke/requirejs for details
*/
(function(){function d(a,c,e){(function(){if(typeof this.loadFirebugConsole=="function")this.loadFirebugConsole();else{this.console=this.console||{};for(var f=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","profile","profileEnd","time","timeEnd","trace","warn","log"],g=0,i;i=f[g++];)console[i]||function(){var r=i+"";console[r]="log"in console?function(){var s=Array.apply({},arguments);s.unshift(r+":");console.log(s.join(" "))}:function(){};console[r]._fake=true}()}if(typeof a==
"undefined")a={_scopeName:"dojo",_scopePrefix:"",_scopePrefixArgs:"",_scopeSuffix:"",_scopeMap:{},_scopeMapRev:{}};var j=a;if(typeof c=="undefined")c={_scopeName:"dijit"};if(typeof e=="undefined")e={_scopeName:"dojox"};if(!j._scopeArgs)j._scopeArgs=[a,c,e];j.global=this;j.config={isDebug:false,debugAtAllCosts:false};if(f=typeof djConfig!="undefined"?djConfig:typeof dojoConfig!="undefined"?dojoConfig:null)for(var h in f)j.config[h]=f[h];a.locale=j.config.locale;h="$Rev: 24595 $".match(/\d+/);a.version=
{major:1,minor:6,patch:1,flag:"",revision:h?+h[0]:NaN,toString:function(){with(j.version)return major+"."+minor+"."+patch+flag+" ("+revision+")"}};typeof OpenAjax!="undefined"&&OpenAjax.hub.registerLibrary(a._scopeName,"http://dojotoolkit.org",j.version.toString());var l,p,t={};for(g in{toString:1}){l=[];break}a._extraNames=l=l||["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];p=l.length;a._mixin=function(r,s){var v,z,y;for(v in s){z=s[v];
if(!(v in r)||r[v]!==z&&(!(v in t)||t[v]!==z))r[v]=z}if(p&&s)for(y=0;y<p;++y){v=l[y];z=s[v];if(!(v in r)||r[v]!==z&&(!(v in t)||t[v]!==z))r[v]=z}return r};a.mixin=function(r){r||(r={});for(var s=1,v=arguments.length;s<v;s++)j._mixin(r,arguments[s]);return r};a._getProp=function(r,s,v){v=v||j.global;for(var z=0,y;v&&(y=r[z]);z++){if(z==0&&j._scopeMap[y])y=j._scopeMap[y];v=y in v?v[y]:s?(v[y]={}):undefined}return v};a.setObject=function(r,s,v){var z=r.split(".");r=z.pop();return(v=j._getProp(z,true,
v))&&r?(v[r]=s):undefined};a.getObject=function(r,s,v){return j._getProp(r.split("."),s,v)};a.exists=function(r,s){return j.getObject(r,false,s)!==undefined};a.eval=function(r){return j.global.eval?j.global.eval(r):eval(r)};j.deprecated=j.experimental=function(){}})();return{dojo:a,dijit:c,dojox:e}}if(this.define)define("dojo/_base/_loader/bootstrap",[],function(){var a=d();a.dojo._dijit=a.dijit;a.dojo._dojox=a.dojox;return a.dojo});else{var b=d();dojo=b.dojo;dijit=b.dijit;dojox=b.dojox}})();
define("dojo/lib/backCompat",["require","dojo/_base/_loader/bootstrap"],function(d,b){var a=["_moduleHasPrefix","_loadPath","_loadUri","_loadUriAndCheck","loaded","_callLoaded","_getModuleSymbols","_loadModule","require","provide","platformRequire","requireIf","requireAfterIf","registerModulePath"],c,e;for(c=0;c<a.length;){e=a[c++];b[e]=function(r){return function(){console.warn("dojo."+r+" not available when using an AMD loader.")}}(e)}var f=function(r){var s=[],v;for(v=0;v<r.length;)s.push(r[v++]);
return s},g=function(r,s){return s?typeof s=="string"?function(){r[s]()}:function(){s.call(r)}:r};b.ready=b.addOnLoad=function(r,s){d.ready(s?g(r,s):r)};b.addOnLoad(function(){b.postLoad=b.config.afterOnLoad=true});if(a=b.config.addOnLoad)b.addOnLoad[a instanceof Array?"apply":"call"](b,a);var i=b._loaders=[],j=function(){var r=i.slice(0);for(Array.prototype.splice.apply(i,[0,i.length]);r.length;)r.shift().call()};i.unshift=function(){Array.prototype.unshift.apply(i,f(arguments));d.ready(j)};i.splice=
function(){Array.prototype.splice.apply(i,f(arguments));d.ready(j)};var h=b._unloaders=[];b.unloaded=function(){for(;h.length;)h.pop().call()};b._onto=function(r,s,v){r.push(v?g(s,v):s)};b._modulesLoaded=function(){};b.loadInit=function(r){r()};var l=function(r){return r.replace(/\./g,"/")};b.getL10nName=function(r,s,v){v=v?v.toLowerCase():b.locale;r="i18n!"+l(r);return/root/i.test(v)?r+"/nls/"+s:r+"/nls/"+v+"/"+s};b.requireLocalization=function(r,s,v){if(d.vendor!="altoviso.com")v=!v||v.toLowerCase()===
b.locale?"root":v;return d(b.getL10nName(r,s,v))};b.i18n={getLocalization:b.requireLocalization,normalizeLocale:function(r){r=r?r.toLowerCase():b.locale;if(r=="root")r="ROOT";return r}};var p=/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/,t=/^((([^\[:]+):)?([^@]+)@)?(\[([^\]]+)\]|([^\[:]*))(:([0-9]+))?$/;b._Url=function(){for(var r=arguments,s=[r[0]],v=1;v<r.length;v++)if(r[v]){var z=new b._Url(r[v]+"");s=new b._Url(s[0]+"");if(z.path==""&&!z.scheme&&!z.authority&&!z.query){if(z.fragment!=
null)s.fragment=z.fragment;z=s}else if(!z.scheme){z.scheme=s.scheme;if(!z.authority){z.authority=s.authority;if(z.path.charAt(0)!="/"){s=(s.path.substring(0,s.path.lastIndexOf("/")+1)+z.path).split("/");for(var y=0;y<s.length;y++)if(s[y]==".")if(y==s.length-1)s[y]="";else{s.splice(y,1);y--}else if(y>0&&!(y==1&&s[0]=="")&&s[y]==".."&&s[y-1]!="..")if(y==s.length-1){s.splice(y,1);s[y-1]=""}else{s.splice(y-1,2);y-=2}z.path=s.join("/")}}}s=[];z.scheme&&s.push(z.scheme,":");z.authority&&s.push("//",z.authority);
s.push(z.path);z.query&&s.push("?",z.query);z.fragment&&s.push("#",z.fragment)}this.uri=s.join("");v=this.uri.match(p);this.scheme=v[2]||(v[1]?"":null);this.authority=v[4]||(v[3]?"":null);this.path=v[5];this.query=v[7]||(v[6]?"":null);this.fragment=v[9]||(v[8]?"":null);if(this.authority!=null){v=this.authority.match(t);this.user=v[3]||null;this.password=v[4]||null;this.host=v[6]||v[7];this.port=v[9]||null}};b._Url.prototype.toString=function(){return this.uri};b.moduleUrl=function(r,s){if(!r)return null;
r=l(r)+(s?"/"+s:"");s="";var v=r.match(/(.+)(\.[^\/]*)$/);if(v){r=v[1];s=v[2]}return new b._Url(d.nameToUrl(r,s))};return b});
define("dojo/_base/_loader/hostenv_browser",["dojo/lib/backCompat"],function(d){if(typeof window!="undefined"){d.isBrowser=true;d._name="browser";(function(){var a=d;if(document&&document.getElementsByTagName)for(var c=document.getElementsByTagName("script"),e=/dojo(\.xd)?\.js(\W|$)/i,f=0;f<c.length;f++){var g=c[f].getAttribute("src");if(g){var i=g.match(e);if(i){if(!a.config.baseUrl)a.config.baseUrl=g.substring(0,i.index);if(c=c[f].getAttribute("djConfig")||c[f].getAttribute("data-dojo-config")){c=
eval("({ "+c+" })");for(var j in c)d.config[j]=c[j]}break}}}a.baseUrl=a.config.baseUrl;j=navigator;c=j.userAgent;e=j.appVersion;f=parseFloat(e);if(c.indexOf("Opera")>=0)a.isOpera=f;if(c.indexOf("AdobeAIR")>=0)a.isAIR=1;a.isKhtml=e.indexOf("Konqueror")>=0?f:0;a.isWebKit=parseFloat(c.split("WebKit/")[1])||undefined;a.isChrome=parseFloat(c.split("Chrome/")[1])||undefined;a.isMac=e.indexOf("Macintosh")>=0;if((g=Math.max(e.indexOf("WebKit"),e.indexOf("Safari"),0))&&!d.isChrome){a.isSafari=parseFloat(e.split("Version/")[1]);
if(!a.isSafari||parseFloat(e.substr(g+7))<=419.3)a.isSafari=2}if(c.indexOf("Gecko")>=0&&!a.isKhtml&&!a.isWebKit)a.isMozilla=a.isMoz=f;if(a.isMoz)a.isFF=parseFloat(c.split("Firefox/")[1]||c.split("Minefield/")[1])||undefined;if(document.all&&!a.isOpera){a.isIE=parseFloat(e.split("MSIE ")[1])||undefined;if((c=document.documentMode)&&c!=5&&Math.floor(a.isIE)!=c)a.isIE=c}if(d.isIE&&window.location.protocol==="file:")d.config.ieForceActiveXXhr=true;a.isQuirks=document.compatMode=="BackCompat";a.locale=
d.config.locale||(a.isIE?j.userLanguage:j.language).toLowerCase();a._XMLHTTP_PROGIDS=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];a._xhrObj=function(){var v,z;if(!d.isIE||!d.config.ieForceActiveXXhr)try{v=new XMLHttpRequest}catch(y){}if(!v)for(var k=0;k<3;++k){var n=a._XMLHTTP_PROGIDS[k];try{v=new ActiveXObject(n)}catch(o){z=o}if(v){a._XMLHTTP_PROGIDS=[n];break}}if(!v)throw new Error("XMLHTTP not available: "+z);return v};a._isDocumentOk=function(v){v=v.status||0;var z=location.protocol;
return v>=200&&v<300||v==304||v==1223||!v&&(z=="file:"||z=="chrome:"||z=="chrome-extension:"||z=="app:")};var h=window.location+"";var l=(j=document.getElementsByTagName("base"))&&j.length>0;a._getText=function(v,z){var y=a._xhrObj();if(!l&&d._Url)v=(new d._Url(h,v)).toString();if(a.config.cacheBust){v+="";v+=(v.indexOf("?")==-1?"?":"&")+String(a.config.cacheBust).replace(/\W+/g,"")}y.open("GET",v,false);try{y.send(null);if(!a._isDocumentOk(y)){var k=Error("Unable to load "+v+" status:"+y.status);
k.status=y.status;k.responseText=y.responseText;throw k;}}catch(n){if(z)return null;throw n;}return y.responseText};var p=window,t=function(v,z){var y=p.attachEvent||p.addEventListener;v=p.attachEvent?v:v.substring(2);y(v,function(){z.apply(p,arguments)},false)};a._windowUnloaders=[];a.windowUnloaded=function(){for(var v=a._windowUnloaders;v.length;)v.pop()();a=null};var r=0;a.addOnWindowUnload=function(v,z){a._onto(a._windowUnloaders,v,z);if(!r){r=1;t("onunload",a.windowUnloaded)}};var s=0;a.addOnUnload=
function(v,z){a._onto(a._unloaders,v,z);if(!s){s=1;t("onbeforeunload",d.unloaded)}}})();d._initFired=false;d._loadInit=function(){if(d._scrollIntervalId){clearInterval(d._scrollIntervalId);d._scrollIntervalId=0}if(!d._initFired){d._initFired=true;!d.config.afterOnLoad&&window.detachEvent&&window.detachEvent("onload",d._loadInit);d._inFlightCount==0&&d._modulesLoaded()}};if(!d.config.afterOnLoad)if(document.addEventListener){document.addEventListener("DOMContentLoaded",d._loadInit,false);window.addEventListener("load",
d._loadInit,false)}else if(window.attachEvent){window.attachEvent("onload",d._loadInit);if(!d.config.skipIeDomLoaded&&self===self.top)d._scrollIntervalId=setInterval(function(){try{if(document.body){document.documentElement.doScroll("left");d._loadInit()}}catch(a){}},30)}if(d.isIE)try{(function(){document.namespaces.add("v","urn:schemas-microsoft-com:vml");var a=["*","group","roundrect","oval","shape","rect","imagedata","path","textpath","text"],c=0,e=1,f=document.createStyleSheet();if(d.isIE>=8){c=
1;e=a.length}for(;c<e;++c)f.addRule("v\\:"+a[c],"behavior:url(#default#VML); display:inline-block")})()}catch(b){}}(function(){var a=d.config.modulePaths;if(a)for(var c in a)d.registerModulePath(c,a[c])})();d.config.isDebug&&d.require("dojo._firebug.firebug");if(d.config.debugAtAllCosts){d.require("dojo._base._loader.loader_debug");d.require("dojo.i18n")}return d});define("dojo/lib/kernel",["dojo/_base/_loader/hostenv_browser"],function(d){return dojo=d});
define("dojo/_base/lang",["dojo/lib/kernel"],function(d){(function(){var b=Object.prototype.toString;d.isString=function(j){return typeof j=="string"||j instanceof String};d.isArray=function(j){return j&&(j instanceof Array||typeof j=="array")};d.isFunction=function(j){return b.call(j)==="[object Function]"};d.isObject=function(j){return j!==undefined&&(j===null||typeof j=="object"||d.isArray(j)||d.isFunction(j))};d.isArrayLike=function(j){return j&&j!==undefined&&!d.isString(j)&&!d.isFunction(j)&&
!(j.tagName&&j.tagName.toLowerCase()=="form")&&(d.isArray(j)||isFinite(j.length))};d.isAlien=function(j){return j&&!d.isFunction(j)&&/\{\s*\[native code\]\s*\}/.test(String(j))};d.extend=function(j){for(var h=1,l=arguments.length;h<l;h++)d._mixin(j.prototype,arguments[h]);return j};d._hitchArgs=function(j,h){var l=d._toArray(arguments,2),p=d.isString(h);return function(){var t=d._toArray(arguments),r=p?(j||d.global)[h]:h;return r&&r.apply(j||this,l.concat(t))}};d.hitch=function(j,h){if(arguments.length>
2)return d._hitchArgs.apply(d,arguments);if(!h){h=j;j=null}if(d.isString(h)){j=j||d.global;if(!j[h])throw['dojo.hitch: scope["',h,'"] is null (scope="',j,'")'].join("");return function(){return j[h].apply(j,arguments||[])}}return!j?h:function(){return h.apply(j,arguments||[])}};d.delegate=d._delegate=function(){function j(){}return function(h,l){j.prototype=h;h=new j;j.prototype=null;l&&d._mixin(h,l);return h}}();var a=function(j,h,l){return(l||[]).concat(Array.prototype.slice.call(j,h||0))},c=function(j,
h,l){l=l||[];for(h=h||0;h<j.length;h++)l.push(j[h]);return l};d._toArray=d.isIE?function(j){return(j.item?c:a).apply(this,arguments)}:a;d.partial=function(){return d.hitch.apply(d,[null].concat(d._toArray(arguments)))};var e=d._extraNames,f=e.length,g={};d.clone=function(j){if(!j||typeof j!="object"||d.isFunction(j))return j;if(j.nodeType&&"cloneNode"in j)return j.cloneNode(true);if(j instanceof Date)return new Date(j.getTime());if(j instanceof RegExp)return new RegExp(j);var h,l,p,t;if(d.isArray(j)){h=
[];l=0;for(p=j.length;l<p;++l)l in j&&h.push(d.clone(j[l]))}else h=j.constructor?new j.constructor:{};for(t in j){p=j[t];if(!(t in h)||h[t]!==p&&(!(t in g)||g[t]!==p))h[t]=d.clone(p)}if(f)for(l=0;l<f;++l){t=e[l];p=j[t];if(!(t in h)||h[t]!==p&&(!(t in g)||g[t]!==p))h[t]=p}return h};d.trim=String.prototype.trim?function(j){return j.trim()}:function(j){return j.replace(/^\s\s*/,"").replace(/\s\s*$/,"")};var i=/\{([^\}]+)\}/g;d.replace=function(j,h,l){return j.replace(l||i,d.isFunction(h)?h:function(p,
t){return d.getObject(t,false,h)})}})();return d});
define("dojo/_base/array",["dojo/lib/kernel","dojo/_base/lang"],function(d){(function(){var b=function(c,e,f){return[typeof c=="string"?c.split(""):c,e||d.global,typeof f=="string"?new Function("item","index","array",f):f]},a=function(c,e,f,g){var i=b(e,g,f);e=i[0];f=0;for(g=e.length;f<g;++f){var j=!!i[2].call(i[1],e[f],f,e);if(c^j)return j}return c};d.mixin(d,{indexOf:function(c,e,f,g){var i=1,j=c.length||0,h=0;if(g){h=j-1;i=j=-1}if(f!=undefined)h=f;if(g&&h>j||h<j)for(;h!=j;h+=i)if(c[h]==e)return h;
return-1},lastIndexOf:function(c,e,f){return d.indexOf(c,e,f,true)},forEach:function(c,e,f){if(c&&c.length){var g=b(c,f,e);c=g[0];e=0;for(f=c.length;e<f;++e)g[2].call(g[1],c[e],e,c)}},every:function(c,e,f){return a(true,c,e,f)},some:function(c,e,f){return a(false,c,e,f)},map:function(c,e,f,g){var i=b(c,f,e);c=i[0];e=g?new g:[];f=0;for(g=c.length;f<g;++f)e.push(i[2].call(i[1],c[f],f,c));return e},filter:function(c,e,f){var g=b(c,f,e);c=g[0];e=[];f=0;for(var i=c.length;f<i;++f)g[2].call(g[1],c[f],f,
c)&&e.push(c[f]);return e}})})();return d});
define("dojo/_base/declare",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array"],function(d){(function(){function b(q,w){throw new Error("declare"+(w?" "+w:"")+": "+q);}function a(q,w){for(var u=[],x=[{cls:0,refs:[]}],B={},C=1,D=q.length,F=0,J,K,L,R,T;F<D;++F){if(J=q[F])k.call(J)!="[object Function]"&&b("mixin #"+F+" is not a callable constructor.",w);else b("mixin #"+F+" is unknown. Did you use dojo.require to pull it in?",w);K=J._meta?J._meta.bases:[J];L=0;for(J=K.length-1;J>=0;--J){R=K[J].prototype;
if(!R.hasOwnProperty("declaredClass"))R.declaredClass="uniqName_"+o++;R=R.declaredClass;if(!B.hasOwnProperty(R)){B[R]={count:0,refs:[],cls:K[J]};++C}R=B[R];if(L&&L!==R){R.refs.push(L);++L.count}L=R}++L.count;x[0].refs.push(L)}for(;x.length;){L=x.pop();u.push(L.cls);for(--C;T=L.refs,T.length==1;){L=T[0];if(!L||--L.count){L=0;break}u.push(L.cls);--C}if(L){F=0;for(D=T.length;F<D;++F){L=T[F];--L.count||x.push(L)}}}C&&b("can't build consistent linearization",w);J=q[0];u[0]=J?J._meta&&J===u[u.length-J._meta.bases.length]?
J._meta.bases.length:1:0;return u}function c(q,w,u){var x,B,C,D,F,J,K,L=this._inherited=this._inherited||{};if(typeof q=="string"){x=q;q=w;w=u}u=0;D=q.callee;(x=x||D.nom)||b("can't deduce a name to call inherited()",this.declaredClass);F=this.constructor._meta;C=F.bases;K=L.p;if(x!=m){if(L.c!==D){K=0;J=C[0];F=J._meta;if(F.hidden[x]!==D){(B=F.chains)&&typeof B[x]=="string"&&b("calling chained method with inherited: "+x,this.declaredClass);do{F=J._meta;B=J.prototype;if(F&&(B[x]===D&&B.hasOwnProperty(x)||
F.hidden[x]===D))break}while(J=C[++K]);K=J?K:-1}}if(J=C[++K]){B=J.prototype;if(J._meta&&B.hasOwnProperty(x))u=B[x];else{D=y[x];do{B=J.prototype;if((u=B[x])&&(J._meta?B.hasOwnProperty(x):u!==D))break}while(J=C[++K])}}u=J&&u||y[x]}else{if(L.c!==D){K=0;if((F=C[0]._meta)&&F.ctor!==D){B=F.chains;if(!B||B.constructor!=="manual")b("calling chained constructor with inherited",this.declaredClass);for(;J=C[++K];)if((F=J._meta)&&F.ctor===D)break;K=J?K:-1}}for(;J=C[++K];)if(u=(F=J._meta)?F.ctor:J)break;u=J&&
u}L.c=u;L.p=K;if(u)return w===true?u:u.apply(this,w||q)}function e(q,w){if(typeof q=="string")return this.inherited(q,w,true);return this.inherited(q,true)}function f(q){for(var w=this.constructor._meta.bases,u=0,x=w.length;u<x;++u)if(w[u]===q)return true;return this instanceof q}function g(q,w){var u,x=0,B=v._extraNames.length;for(u in w)if(u!=m&&w.hasOwnProperty(u))q[u]=w[u];for(;x<B;++x){u=v._extraNames[x];if(u!=m&&w.hasOwnProperty(u))q[u]=w[u]}}function i(q,w){var u,x,B=0,C=v._extraNames.length;
for(u in w){x=w[u];if((x!==y[u]||!(u in y))&&u!=m){if(k.call(x)=="[object Function]")x.nom=u;q[u]=x}}for(;B<C;++B){u=v._extraNames[B];x=w[u];if((x!==y[u]||!(u in y))&&u!=m){if(k.call(x)=="[object Function]")x.nom=u;q[u]=x}}return q}function j(q){i(this.prototype,q);return this}function h(q,w){return function(){var u=arguments,x=u,B=u[0],C,D;D=q.length;var F;if(!(this instanceof u.callee))return s(u);if(w&&(B&&B.preamble||this.preamble)){F=new Array(q.length);F[0]=u;for(C=0;;){if(B=u[0])if(B=B.preamble)u=
B.apply(this,u)||u;B=q[C].prototype;if(B=B.hasOwnProperty("preamble")&&B.preamble)u=B.apply(this,u)||u;if(++C==D)break;F[C]=u}}for(C=D-1;C>=0;--C){B=q[C];if(B=(D=B._meta)?D.ctor:B)B.apply(this,F?F[C]:u)}(B=this.postscript)&&B.apply(this,x)}}function l(q,w){return function(){var u=arguments,x=u,B=u[0];if(!(this instanceof u.callee))return s(u);if(w){if(B)if(B=B.preamble)x=B.apply(this,x)||x;(B=this.preamble)&&B.apply(this,x)}q&&q.apply(this,u);(B=this.postscript)&&B.apply(this,u)}}function p(q){return function(){var w=
arguments,u=0,x,B;if(!(this instanceof w.callee))return s(w);for(;x=q[u];++u)if(x=(B=x._meta)?B.ctor:x){x.apply(this,w);break}(x=this.postscript)&&x.apply(this,w)}}function t(q,w,u){return function(){var x,B,C=0,D=1;if(u){C=w.length-1;D=-1}for(;x=w[C];C+=D){B=x._meta;(x=(B?B.hidden:x.prototype)[q])&&x.apply(this,arguments)}}}function r(q){n.prototype=q.prototype;q=new n;n.prototype=null;return q}function s(q){var w=q.callee,u=r(w);w.apply(u,q);return u}var v=d,z=v._mixin,y=Object.prototype,k=y.toString,
n=new Function,o=0,m="constructor";v.declare=function(q,w,u){if(typeof q!="string"){u=w;w=q;q=""}u=u||{};var x,B,C,D,F,J,K,L=1,R=w;if(k.call(w)=="[object Array]"){J=a(w,q);C=J[0];L=J.length-C;w=J[L]}else{J=[0];if(w)if(k.call(w)=="[object Function]"){C=w._meta;J=J.concat(C?C.bases:w)}else b("base class is not a callable constructor.",q);else w!==null&&b("unknown base class. Did you use dojo.require to pull it in?",q)}if(w)for(B=L-1;;--B){x=r(w);if(!B)break;C=J[B];(C._meta?g:z)(x,C.prototype);D=new Function;
D.superclass=w;D.prototype=x;w=x.constructor=D}else x={};i(x,u);C=u.constructor;if(C!==y.constructor){C.nom=m;x.constructor=C}for(B=L-1;B;--B)if((C=J[B]._meta)&&C.chains)K=z(K||{},C.chains);if(x["-chains-"])K=z(K||{},x["-chains-"]);C=!K||!K.hasOwnProperty(m);J[0]=D=K&&K.constructor==="manual"?p(J):J.length==1?l(u.constructor,C):h(J,C);D._meta={bases:J,hidden:u,chains:K,parents:R,ctor:u.constructor};D.superclass=w&&w.prototype;D.extend=j;D.prototype=x;x.constructor=D;x.getInherited=e;x.inherited=c;
x.isInstanceOf=f;if(q){x.declaredClass=q;v.setObject(q,D)}if(K)for(F in K)if(x[F]&&typeof K[F]=="string"&&F!=m){C=x[F]=t(F,J,K[F]==="after");C.nom=F}return D};v.safeMixin=i})();return d.declare});
define("dojo/_base/connect",["dojo/lib/kernel","dojo/_base/lang"],function(d){d._listener={getDispatcher:function(){return function(){var b=Array.prototype,a=arguments.callee,c=a._listeners;a=(a=a.target)&&a.apply(this,arguments);var e;c=[].concat(c);for(e in c)e in b||c[e].apply(this,arguments);return a}},add:function(b,a,c){b=b||d.global;var e=b[a];if(!e||!e._listeners){var f=d._listener.getDispatcher();f.target=e;f._listeners=[];e=b[a]=f}return e._listeners.push(c)},remove:function(b,a,c){(b=(b||
d.global)[a])&&b._listeners&&c--&&delete b._listeners[c]}};d.connect=function(){var b=arguments,a=[],c=0;a.push(d.isString(b[0])?null:b[c++],b[c++]);var e=b[c+1];a.push(d.isString(e)||d.isFunction(e)?b[c++]:null,b[c++]);for(e=b.length;c<e;c++)a.push(b[c]);return d._connect.apply(this,a)};d._connect=function(b,a,c,e){var f=d._listener;c=f.add(b,a,d.hitch(c,e));return[b,a,c,f]};d.disconnect=function(b){if(b&&b[0]!==undefined){d._disconnect.apply(this,b);delete b[0]}};d._disconnect=function(b,a,c,e){e.remove(b,
a,c)};d._topics={};d.subscribe=function(b,a,c){return[b,d._listener.add(d._topics,b,d.hitch(a,c))]};d.unsubscribe=function(b){b&&d._listener.remove(d._topics,b[0],b[1])};d.publish=function(b,a){if(b=d._topics[b])b.apply(this,a||[])};d.connectPublisher=function(b,a,c){var e=function(){d.publish(b,arguments)};return c?d.connect(a,c,e):d.connect(a,e)};return d.connect});
define("dojo/_base/Deferred",["dojo/lib/kernel","dojo/_base/lang"],function(d){(function(){var b=function(){},a=Object.freeze||function(){};d.Deferred=function(c){function e(r){if(i)throw new Error("This deferred has already been resolved");g=r;i=true;f()}function f(){for(var r;!r&&l;){var s=l;l=l.next;if(r=s.progress==b)i=false;var v=j?s.error:s.resolved;if(v)try{var z=v(g);if(z&&typeof z.then==="function")z.then(d.hitch(s.deferred,"resolve"),d.hitch(s.deferred,"reject"),d.hitch(s.deferred,"progress"));
else{v=r&&z===undefined;if(r&&!v)j=z instanceof Error;s.deferred[v&&j?"reject":"resolve"](v?g:z)}}catch(y){s.deferred.reject(y)}else j?s.deferred.reject(g):s.deferred.resolve(g)}}var g,i,j,h,l,p=this.promise={};this.resolve=this.callback=function(r){this.fired=0;this.results=[r,null];e(r)};this.reject=this.errback=function(r){j=true;this.fired=1;e(r);this.results=[null,r];if(!r||r.log!==false)(d.config.deferredOnError||function(s){console.error(s)})(r)};this.progress=function(r){for(var s=l;s;){var v=
s.progress;v&&v(r);s=s.next}};this.addCallbacks=function(r,s){this.then(r,s,b);return this};this.then=p.then=function(r,s,v){var z=v==b?this:new d.Deferred(p.cancel);r={resolved:r,error:s,progress:v,deferred:z};if(l)h=h.next=r;else l=h=r;i&&f();return z.promise};var t=this;this.cancel=p.cancel=function(){if(!i){var r=c&&c(t);if(!i){r instanceof Error||(r=new Error(r));r.log=false;t.reject(r)}}};a(p)};d.extend(d.Deferred,{addCallback:function(){return this.addCallbacks(d.hitch.apply(d,arguments))},
addErrback:function(){return this.addCallbacks(null,d.hitch.apply(d,arguments))},addBoth:function(){var c=d.hitch.apply(d,arguments);return this.addCallbacks(c,c)},fired:-1})})();d.when=function(b,a,c,e){if(b&&typeof b.then==="function")return b.then(a,c,e);return a(b)};return d.Deferred});
define("dojo/_base/json",["dojo/lib/kernel"],function(d){d.fromJson=function(b){return eval("("+b+")")};d._escapeString=function(b){return('"'+b.replace(/(["\\])/g,"\\$1")+'"').replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")};d.toJsonIndentStr="\t";d.toJson=function(b,a,c){if(b===undefined)return"undefined";var e=typeof b;if(e=="number"||e=="boolean")return b+"";if(b===null)return"null";if(d.isString(b))return d._escapeString(b);var f=
arguments.callee,g;c=c||"";var i=a?c+d.toJsonIndentStr:"";g=b.__json__||b.json;if(d.isFunction(g)){g=g.call(b);if(b!==g)return f(g,a,i)}if(b.nodeType&&b.cloneNode)throw new Error("Can't serialize DOM nodes");g=a?" ":"";var j=a?"\n":"";if(d.isArray(b))return"["+d.map(b,function(t){t=f(t,a,i);if(typeof t!="string")t="undefined";return j+i+t}).join(","+g)+j+c+"]";if(e=="function")return null;e=[];var h;for(h in b){var l,p;if(typeof h=="number")l='"'+h+'"';else if(typeof h=="string")l=d._escapeString(h);
else continue;p=f(b[h],a,i);typeof p=="string"&&e.push(j+i+l+":"+g+p)}return"{"+e.join(","+g)+j+c+"}"};return d});
define("dojo/_base/Color",["dojo/lib/kernel","dojo/_base/array","dojo/_base/lang"],function(d){(function(){d.Color=function(b){b&&this.setColor(b)};d.Color.named={black:[0,0,0],silver:[192,192,192],gray:[128,128,128],white:[255,255,255],maroon:[128,0,0],red:[255,0,0],purple:[128,0,128],fuchsia:[255,0,255],green:[0,128,0],lime:[0,255,0],olive:[128,128,0],yellow:[255,255,0],navy:[0,0,128],blue:[0,0,255],teal:[0,128,128],aqua:[0,255,255],transparent:d.config.transparentColor||[255,255,255]};d.extend(d.Color,
{r:255,g:255,b:255,a:1,_set:function(b,a,c,e){this.r=b;this.g=a;this.b=c;this.a=e},setColor:function(b){if(d.isString(b))d.colorFromString(b,this);else if(d.isArray(b))d.colorFromArray(b,this);else{this._set(b.r,b.g,b.b,b.a);b instanceof d.Color||this.sanitize()}return this},sanitize:function(){return this},toRgb:function(){return[this.r,this.g,this.b]},toRgba:function(){return[this.r,this.g,this.b,this.a]},toHex:function(){return"#"+d.map(["r","g","b"],function(b){b=this[b].toString(16);return b.length<
2?"0"+b:b},this).join("")},toCss:function(b){var a=this.r+", "+this.g+", "+this.b;return(b?"rgba("+a+", "+this.a:"rgb("+a)+")"},toString:function(){return this.toCss(true)}});d.blendColors=function(b,a,c,e){var f=e||new d.Color;d.forEach(["r","g","b","a"],function(g){f[g]=b[g]+(a[g]-b[g])*c;if(g!="a")f[g]=Math.round(f[g])});return f.sanitize()};d.colorFromRgb=function(b,a){return(b=b.toLowerCase().match(/^rgba?\(([\s\.,0-9]+)\)/))&&d.colorFromArray(b[1].split(/\s*,\s*/),a)};d.colorFromHex=function(b,
a){var c=a||new d.Color,e=b.length==4?4:8,f=(1<<e)-1;b=Number("0x"+b.substr(1));if(isNaN(b))return null;d.forEach(["b","g","r"],function(g){var i=b&f;b>>=e;c[g]=e==4?17*i:i});c.a=1;return c};d.colorFromArray=function(b,a){a=a||new d.Color;a._set(Number(b[0]),Number(b[1]),Number(b[2]),Number(b[3]));if(isNaN(a.a))a.a=1;return a.sanitize()};d.colorFromString=function(b,a){var c=d.Color.named[b];return c&&d.colorFromArray(c,a)||d.colorFromRgb(b,a)||d.colorFromHex(b,a)}})();return d.Color});
define("dojo/_base/window",["dojo/lib/kernel"],function(d){d.doc=window.document||null;d.body=function(){return d.doc.body||d.doc.getElementsByTagName("body")[0]};d.setContext=function(b,a){d.global=b;d.doc=a};d.withGlobal=function(b,a,c,e){var f=d.global;try{d.global=b;return d.withDoc.call(null,b.document,a,c,e)}finally{d.global=f}};d.withDoc=function(b,a,c,e){var f=d.doc,g=d._bodyLtr,i=d.isQuirks;try{d.doc=b;delete d._bodyLtr;d.isQuirks=d.doc.compatMode=="BackCompat";if(c&&typeof a=="string")a=
c[a];return a.apply(c,e||[])}finally{d.doc=f;delete d._bodyLtr;if(g!==undefined)d._bodyLtr=g;d.isQuirks=i}};return d});
define("dojo/_base/event",["dojo/lib/kernel","dojo/_base/connect"],function(d){(function(){var b=d._event_listener={add:function(j,h,l){if(j){h=b._normalizeEventName(h);l=b._fixCallback(h,l);if(!d.isIE&&(h=="mouseenter"||h=="mouseleave")){var p=l;h=h=="mouseenter"?"mouseover":"mouseout";l=function(t){if(!d.isDescendant(t.relatedTarget,j))return p.call(this,t)}}j.addEventListener(h,l,false);return l}},remove:function(j,h,l){if(j){h=b._normalizeEventName(h);if(!d.isIE&&(h=="mouseenter"||h=="mouseleave"))h=
h=="mouseenter"?"mouseover":"mouseout";j.removeEventListener(h,l,false)}},_normalizeEventName:function(j){return j.slice(0,2)=="on"?j.slice(2):j},_fixCallback:function(j,h){return j!="keypress"?h:function(l){return h.call(this,b._fixEvent(l,this))}},_fixEvent:function(j){switch(j.type){case "keypress":b._setKeyChar(j);break}return j},_setKeyChar:function(j){j.keyChar=j.charCode>=32?String.fromCharCode(j.charCode):"";j.charOrCode=j.keyChar||j.keyCode},_punctMap:{106:42,111:47,186:59,187:43,188:44,
189:45,190:46,191:47,192:96,219:91,220:92,221:93,222:39}};d.fixEvent=function(j,h){return b._fixEvent(j,h)};d.stopEvent=function(j){j.preventDefault();j.stopPropagation()};var a=d._listener;d._connect=function(j,h,l,p,t){t=j&&(j.nodeType||j.attachEvent||j.addEventListener)?t?2:1:0;l=[d._listener,b,a][t].add(j,h,d.hitch(l,p));return[j,h,l,t]};d._disconnect=function(j,h,l,p){[d._listener,b,a][p].remove(j,h,l)};d.keys={BACKSPACE:8,TAB:9,CLEAR:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,META:d.isSafari?91:224,
PAUSE:19,CAPS_LOCK:20,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,INSERT:45,DELETE:46,HELP:47,LEFT_WINDOW:91,RIGHT_WINDOW:92,SELECT:93,NUMPAD_0:96,NUMPAD_1:97,NUMPAD_2:98,NUMPAD_3:99,NUMPAD_4:100,NUMPAD_5:101,NUMPAD_6:102,NUMPAD_7:103,NUMPAD_8:104,NUMPAD_9:105,NUMPAD_MULTIPLY:106,NUMPAD_PLUS:107,NUMPAD_ENTER:108,NUMPAD_MINUS:109,NUMPAD_PERIOD:110,NUMPAD_DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,
F11:122,F12:123,F13:124,F14:125,F15:126,NUM_LOCK:144,SCROLL_LOCK:145,copyKey:d.isMac&&!d.isAIR?d.isSafari?91:224:17};var c=d.isMac?"metaKey":"ctrlKey";d.isCopyKey=function(j){return j[c]};d.mouseButtons=d.isIE<9||d.isIE&&d.isQuirks?{LEFT:1,MIDDLE:4,RIGHT:2,isButton:function(j,h){return j.button&h},isLeft:function(j){return j.button&1},isMiddle:function(j){return j.button&4},isRight:function(j){return j.button&2}}:{LEFT:0,MIDDLE:1,RIGHT:2,isButton:function(j,h){return j.button==h},isLeft:function(j){return j.button==
0},isMiddle:function(j){return j.button==1},isRight:function(j){return j.button==2}};if(d.isIE){var e=function(j,h){try{return j.keyCode=h}catch(l){return 0}},f=d._listener,g=d._ieListenersName="_"+d._scopeName+"_listeners";if(!d.config._allow_leaks){a=f=d._ie_listener={handlers:[],add:function(j,h,l){j=j||d.global;var p=j[h];if(!p||!p[g]){var t=d._getIeDispatcher();t.target=p&&i.push(p)-1;t[g]=[];p=j[h]=t}return p[g].push(i.push(l)-1)},remove:function(j,h,l){h=(j=(j||d.global)[h])&&j[g];if(j&&h&&
l--){delete i[h[l]];delete h[l]}}};var i=f.handlers}d.mixin(b,{add:function(j,h,l){if(j){h=b._normalizeEventName(h);if(h=="onkeypress"){var p=j.onkeydown;if(!p||!p[g]||!p._stealthKeydownHandle){var t=b.add(j,"onkeydown",b._stealthKeyDown);p=j.onkeydown;p._stealthKeydownHandle=t;p._stealthKeydownRefs=1}else p._stealthKeydownRefs++}return f.add(j,h,b._fixCallback(l))}},remove:function(j,h,l){h=b._normalizeEventName(h);f.remove(j,h,l);if(h=="onkeypress"){h=j.onkeydown;if(--h._stealthKeydownRefs<=0){f.remove(j,
"onkeydown",h._stealthKeydownHandle);delete h._stealthKeydownHandle}}},_normalizeEventName:function(j){return j.slice(0,2)!="on"?"on"+j:j},_nop:function(){},_fixEvent:function(j,h){if(!j)j=(h&&(h.ownerDocument||h.document||h).parentWindow||window).event;if(!j)return j;j.target=j.srcElement;j.currentTarget=h||j.srcElement;j.layerX=j.offsetX;j.layerY=j.offsetY;h=(h=j.srcElement)&&h.ownerDocument||document;h=d.isIE<6||h.compatMode=="BackCompat"?h.body:h.documentElement;var l=d._getIeDocumentElementOffset();
j.pageX=j.clientX+d._fixIeBiDiScrollLeft(h.scrollLeft||0)-l.x;j.pageY=j.clientY+(h.scrollTop||0)-l.y;if(j.type=="mouseover")j.relatedTarget=j.fromElement;if(j.type=="mouseout")j.relatedTarget=j.toElement;if(d.isIE<9||d.isQuirks){j.stopPropagation=b._stopPropagation;j.preventDefault=b._preventDefault}return b._fixKeys(j)},_fixKeys:function(j){switch(j.type){case "keypress":var h="charCode"in j?j.charCode:j.keyCode;if(h==10){h=0;j.keyCode=13}else if(h==13||h==27)h=0;else if(h==3)h=99;j.charCode=h;b._setKeyChar(j);
break}return j},_stealthKeyDown:function(j){var h=j.currentTarget.onkeypress;if(h&&h[g]){var l=j.keyCode,p=(l!=13||d.isIE>=9&&!d.isQuirks)&&l!=32&&l!=27&&(l<48||l>90)&&(l<96||l>111)&&(l<186||l>192)&&(l<219||l>222);if(p||j.ctrlKey){p=p?0:l;if(j.ctrlKey)if(l==3||l==13)return;else if(p>95&&p<106)p-=48;else if(!j.shiftKey&&p>=65&&p<=90)p+=32;else p=b._punctMap[p]||p;l=b._synthesizeEvent(j,{type:"keypress",faux:true,charCode:p});h.call(j.currentTarget,l);if(d.isIE<9||d.isIE&&d.isQuirks)j.cancelBubble=
l.cancelBubble;j.returnValue=l.returnValue;e(j,l.keyCode)}}},_stopPropagation:function(){this.cancelBubble=true},_preventDefault:function(){this.bubbledKeyCode=this.keyCode;this.ctrlKey&&e(this,0);this.returnValue=false}});d.stopEvent=d.isIE<9||d.isQuirks?function(j){j=j||window.event;b._stopPropagation.call(j);b._preventDefault.call(j)}:d.stopEvent}b._synthesizeEvent=function(j,h){h=d.mixin({},j,h);b._setKeyChar(h);h.preventDefault=function(){j.preventDefault()};h.stopPropagation=function(){j.stopPropagation()};
return h};d.isOpera&&d.mixin(b,{_fixEvent:function(j){switch(j.type){case "keypress":var h=j.which;if(h==3)h=99;h=h<41&&!j.shiftKey?0:h;if(j.ctrlKey&&!j.shiftKey&&h>=65&&h<=90)h+=32;return b._synthesizeEvent(j,{charCode:h})}return j}});if(d.isWebKit){b._add=b.add;b._remove=b.remove;d.mixin(b,{add:function(j,h,l){if(j){var p=b._add(j,h,l);if(b._normalizeEventName(h)=="keypress")p._stealthKeyDownHandle=b._add(j,"keydown",function(t){var r=t.keyCode,s=r!=13&&r!=32&&(r<48||r>90)&&(r<96||r>111)&&(r<186||
r>192)&&(r<219||r>222);if(s||t.ctrlKey){s=s?0:r;if(t.ctrlKey)if(r==3||r==13)return;else if(s>95&&s<106)s-=48;else if(!t.shiftKey&&s>=65&&s<=90)s+=32;else s=b._punctMap[s]||s;r=b._synthesizeEvent(t,{type:"keypress",faux:true,charCode:s});l.call(t.currentTarget,r)}});return p}},remove:function(j,h,l){if(j){l._stealthKeyDownHandle&&b._remove(j,"keydown",l._stealthKeyDownHandle);b._remove(j,h,l)}},_fixEvent:function(j){switch(j.type){case "keypress":if(j.faux)return j;var h=j.charCode;h=h>=32?h:0;return b._synthesizeEvent(j,
{charCode:h,faux:true})}return j}})}})();if(d.isIE){d._ieDispatcher=function(b,a){var c=Array.prototype,e=d._ie_listener.handlers,f=b.callee,g=f[d._ieListenersName];f=(f=e[f.target])&&f.apply(a,b);g=[].concat(g);for(var i in g){var j=e[g[i]];!(i in c)&&j&&j.apply(a,b)}return f};d._getIeDispatcher=function(){return new Function(d._scopeName+"._ieDispatcher(arguments, this)")};d._event_listener._fixCallback=function(b){var a=d._event_listener._fixEvent;return function(c){return b.call(this,a(c,this))}}}return d.connect});
define("dojo/_base/html",["dojo/lib/kernel","dojo/_base/lang"],function(d){try{document.execCommand("BackgroundImageCache",false,true)}catch(b){}d.byId=d.isIE?function(a,c){if(typeof a!="string")return a;var e=c||d.doc;if((c=e.getElementById(a))&&(c.attributes.id.value==a||c.id==a))return c;else{var f=e.all[a];if(!f||f.nodeName)f=[f];for(var g=0;c=f[g++];)if(c.attributes&&c.attributes.id&&c.attributes.id.value==a||c.id==a)return c}}:function(a,c){return(typeof a=="string"?(c||d.doc).getElementById(a):
a)||null};(function(){var a=d.byId,c=null,e;d.addOnWindowUnload(function(){c=null});d._destroyElement=d.destroy=function(A){A=a(A);try{var E=A.ownerDocument;if(!c||e!=E){c=E.createElement("div");e=E}c.appendChild(A.parentNode?A.parentNode.removeChild(A):A);c.innerHTML=""}catch(H){}};d.isDescendant=function(A,E){try{A=a(A);for(E=a(E);A;){if(A==E)return true;A=A.parentNode}}catch(H){}return false};d.setSelectable=function(A,E){A=a(A);if(d.isMozilla)A.style.MozUserSelect=E?"":"none";else if(d.isKhtml||
d.isWebKit)A.style.KhtmlUserSelect=E?"auto":"none";else if(d.isIE){E=A.unselectable=E?"":"on";d.query("*",A).forEach("item.unselectable = '"+E+"'")}};var f=function(A,E){var H=E.parentNode;H&&H.insertBefore(A,E)},g=function(A,E){var H=E.parentNode;if(H)H.lastChild==E?H.appendChild(A):H.insertBefore(A,E.nextSibling)};d.place=function(A,E,H){E=a(E);if(typeof A=="string")A=/^\s*</.test(A)?d._toDom(A,E.ownerDocument):a(A);if(typeof H=="number"){var P=E.childNodes;!P.length||P.length<=H?E.appendChild(A):
f(A,P[H<0?0:H])}else switch(H){case "before":f(A,E);break;case "after":g(A,E);break;case "replace":E.parentNode.replaceChild(A,E);break;case "only":d.empty(E);E.appendChild(A);break;case "first":if(E.firstChild){f(A,E.firstChild);break}default:E.appendChild(A)}return A};d.boxModel="content-box";if(d.isIE)d.boxModel=document.compatMode=="BackCompat"?"border-box":"content-box";var i;i=d.isWebKit?function(A){var E;if(A.nodeType==1){var H=A.ownerDocument.defaultView;E=H.getComputedStyle(A,null);if(!E&&
A.style){A.style.display="";E=H.getComputedStyle(A,null)}}return E||{}}:d.isIE?function(A){return A.nodeType==1?A.currentStyle:{}}:function(A){return A.nodeType==1?A.ownerDocument.defaultView.getComputedStyle(A,null):{}};d.getComputedStyle=i;d._toPixelValue=d.isIE?function(A,E){if(!E)return 0;if(E=="medium")return 4;if(E.slice&&E.slice(-2)=="px")return parseFloat(E);with(A){A=style.left;var H=runtimeStyle.left;runtimeStyle.left=currentStyle.left;try{style.left=E;E=style.pixelLeft}catch(P){E=0}style.left=
A;runtimeStyle.left=H}return E}:function(A,E){return parseFloat(E)||0};var j=d._toPixelValue,h=function(A,E){try{return A.filters.item("DXImageTransform.Microsoft.Alpha")}catch(H){return E?{}:null}};d._getOpacity=d.isIE<9?function(A){try{return h(A).Opacity/100}catch(E){return 1}}:function(A){return i(A).opacity};d._setOpacity=d.isIE<9?function(A,E){var H=E*100,P=E==1;A.style.zoom=P?"":1;if(h(A))h(A,1).Opacity=H;else{if(P)return E;A.style.filter+=" progid:DXImageTransform.Microsoft.Alpha(Opacity="+
H+")"}h(A,1).Enabled=!P;A.nodeName.toLowerCase()=="tr"&&d.query("> td",A).forEach(function(W){d._setOpacity(W,E)});return E}:function(A,E){return A.style.opacity=E};var l={left:true,top:true},p=/margin|padding|width|height|max|min|offset/,t=function(A,E,H){E=E.toLowerCase();if(d.isIE){if(H=="auto"){if(E=="height")return A.offsetHeight;if(E=="width")return A.offsetWidth}if(E=="fontweight")switch(H){case 700:return"bold";case 400:default:return"normal"}}E in l||(l[E]=p.test(E));return l[E]?j(A,H):H},
r=d.isIE?"styleFloat":"cssFloat",s={cssFloat:r,styleFloat:r,"float":r};d.style=function(A,E,H){var P=a(A),W=arguments.length,X=E=="opacity";E=s[E]||E;if(W==3)return X?d._setOpacity(P,H):(P.style[E]=H);if(W==2&&X)return d._getOpacity(P);X=i(P);if(W==2&&typeof E!="string"){for(var $ in E)d.style(A,$,E[$]);return X}return W==1?X:t(P,E,X[E]||P.style[E])};d._getPadExtents=function(A,E){E=E||i(A);var H=j(A,E.paddingLeft),P=j(A,E.paddingTop);return{l:H,t:P,w:H+j(A,E.paddingRight),h:P+j(A,E.paddingBottom)}};
d._getBorderExtents=function(A,E){E=E||i(A);var H=E.borderLeftStyle!="none"?j(A,E.borderLeftWidth):0,P=E.borderTopStyle!="none"?j(A,E.borderTopWidth):0;return{l:H,t:P,w:H+(E.borderRightStyle!="none"?j(A,E.borderRightWidth):0),h:P+(E.borderBottomStyle!="none"?j(A,E.borderBottomWidth):0)}};d._getPadBorderExtents=function(A,E){var H=E||i(A);E=d._getPadExtents(A,H);A=d._getBorderExtents(A,H);return{l:E.l+A.l,t:E.t+A.t,w:E.w+A.w,h:E.h+A.h}};d._getMarginExtents=function(A,E){E=E||i(A);var H=j(A,E.marginLeft),
P=j(A,E.marginTop),W=j(A,E.marginRight);A=j(A,E.marginBottom);if(d.isWebKit&&E.position!="absolute")W=H;return{l:H,t:P,w:H+W,h:P+A}};d._getMarginBox=function(A,E){var H=E||i(A);E=d._getMarginExtents(A,H);var P=A.offsetLeft-E.l,W=A.offsetTop-E.t,X=A.parentNode;if(d.isMoz){var $=parseFloat(H.left);H=parseFloat(H.top);if(!isNaN($)&&!isNaN(H)){P=$;W=H}else if(X&&X.style){$=i(X);if($.overflow!="visible"){X=d._getBorderExtents(X,$);P+=X.l;W+=X.t}}}else if(d.isOpera||d.isIE>7&&!d.isQuirks)if(X){X=d._getBorderExtents(X);
P-=X.l;W-=X.t}return{l:P,t:W,w:A.offsetWidth+E.w,h:A.offsetHeight+E.h}};d._getMarginSize=function(A,E){A=a(A);E=d._getMarginExtents(A,E||i(A));A=A.getBoundingClientRect();return{w:A.right-A.left+E.w,h:A.bottom-A.top+E.h}};d._getContentBox=function(A,E){var H=E||i(A);E=d._getPadExtents(A,H);H=d._getBorderExtents(A,H);var P=A.clientWidth;if(P){A=A.clientHeight;H.w=H.h=0}else{P=A.offsetWidth;A=A.offsetHeight}if(d.isOpera){E.l+=H.l;E.t+=H.t}return{l:E.l,t:E.t,w:P-E.w-H.w,h:A-E.h-H.h}};d._getBorderBox=
function(A,E){var H=E||i(A);E=d._getPadExtents(A,H);A=d._getContentBox(A,H);return{l:A.l-E.l,t:A.t-E.t,w:A.w+E.w,h:A.h+E.h}};d._setBox=function(A,E,H,P,W,X){X=X||"px";A=A.style;if(!isNaN(E))A.left=E+X;if(!isNaN(H))A.top=H+X;if(P>=0)A.width=P+X;if(W>=0)A.height=W+X};d._isButtonTag=function(A){return A.tagName=="BUTTON"||A.tagName=="INPUT"&&(A.getAttribute("type")||"").toUpperCase()=="BUTTON"};d._usesBorderBox=function(A){var E=A.tagName;return d.boxModel=="border-box"||E=="TABLE"||d._isButtonTag(A)};
d._setContentSize=function(A,E,H,P){if(d._usesBorderBox(A)){P=d._getPadBorderExtents(A,P);if(E>=0)E+=P.w;if(H>=0)H+=P.h}d._setBox(A,NaN,NaN,E,H)};d._setMarginBox=function(A,E,H,P,W,X){var $=X||i(A);X=d._usesBorderBox(A)?v:d._getPadBorderExtents(A,$);if(d.isWebKit)if(d._isButtonTag(A)){var fa=A.style;if(P>=0&&!fa.width)fa.width="4px";if(W>=0&&!fa.height)fa.height="4px"}$=d._getMarginExtents(A,$);if(P>=0)P=Math.max(P-X.w-$.w,0);if(W>=0)W=Math.max(W-X.h-$.h,0);d._setBox(A,E,H,P,W)};var v={l:0,t:0,w:0,
h:0};d.marginBox=function(A,E){A=a(A);var H=i(A);return!E?d._getMarginBox(A,H):d._setMarginBox(A,E.l,E.t,E.w,E.h,H)};d.contentBox=function(A,E){A=a(A);var H=i(A);return!E?d._getContentBox(A,H):d._setContentSize(A,E.w,E.h,H)};d._docScroll=function(){var A=d.global;return"pageXOffset"in A?{x:A.pageXOffset,y:A.pageYOffset}:(A=d.isQuirks?d.doc.body:d.doc.documentElement,{x:d._fixIeBiDiScrollLeft(A.scrollLeft||0),y:A.scrollTop||0})};d._isBodyLtr=function(){return"_bodyLtr"in d?d._bodyLtr:(d._bodyLtr=(d.body().dir||
d.doc.documentElement.dir||"ltr").toLowerCase()=="ltr")};d._getIeDocumentElementOffset=function(){var A=d.doc.documentElement;if(d.isIE<8){var E=A.getBoundingClientRect(),H=E.left;E=E.top;if(d.isIE<7){H+=A.clientLeft;E+=A.clientTop}return{x:H<0?0:H,y:E<0?0:E}}else return{x:0,y:0}};d._fixIeBiDiScrollLeft=function(A){var E=d.isIE;if(E&&!d._isBodyLtr()){var H=d.isQuirks,P=H?d.doc.body:d.doc.documentElement;if(E==6&&!H&&d.global.frameElement&&P.scrollHeight>P.clientHeight)A+=P.clientLeft;return E<8||
H?A+P.clientWidth-P.scrollWidth:-A}return A};d._abs=d.position=function(A,E){A=a(A);var H=d.body(),P=H.parentNode;A=A.getBoundingClientRect();A={x:A.left,y:A.top,w:A.right-A.left,h:A.bottom-A.top};if(d.isIE){P=d._getIeDocumentElementOffset();A.x-=P.x+(d.isQuirks?H.clientLeft+H.offsetLeft:0);A.y-=P.y+(d.isQuirks?H.clientTop+H.offsetTop:0)}else if(d.isFF==3){H=i(P);A.x-=j(P,H.marginLeft)+j(P,H.borderLeftWidth);A.y-=j(P,H.marginTop)+j(P,H.borderTopWidth)}if(E){E=d._docScroll();A.x+=E.x;A.y+=E.y}return A};
d.coords=function(A,E){A=a(A);var H=i(A);H=d._getMarginBox(A,H);E=d.position(A,E);H.x=E.x;H.y=E.y;return H};var z={"class":"className","for":"htmlFor",tabindex:"tabIndex",readonly:"readOnly",colspan:"colSpan",frameborder:"frameBorder",rowspan:"rowSpan",valuetype:"valueType"},y={classname:"class",htmlfor:"for",tabindex:"tabIndex",readonly:"readOnly"},k={innerHTML:1,className:1,htmlFor:d.isIE,value:1},n=function(A){return y[A.toLowerCase()]||A},o=function(A,E){return(A=A.getAttributeNode&&A.getAttributeNode(E))&&
A.specified};d.hasAttr=function(A,E){var H=E.toLowerCase();return k[z[H]||E]||o(a(A),y[H]||E)};var m={},q=0,w=d._scopeName+"attrid",u={col:1,colgroup:1,table:1,tbody:1,tfoot:1,thead:1,tr:1,title:1};d.attr=function(A,E,H){A=a(A);var P=arguments.length;if(P==2&&typeof E!="string"){for(var W in E)d.attr(A,W,E[W]);return A}var X=E.toLowerCase();W=z[X]||E;var $=k[W];X=y[X]||E;if(P==3){if(W=="style"&&typeof H!="string")d.style(A,H);else if(W=="innerHTML")if(d.isIE&&A.tagName.toLowerCase()in u){d.empty(A);
A.appendChild(d._toDom(H,A.ownerDocument))}else A[W]=H;else if(d.isFunction(H)){P=d.attr(A,w);if(!P){P=q++;d.attr(A,w,P)}m[P]||(m[P]={});if($=m[P][W])d.disconnect($);else try{delete A[W]}catch(fa){}m[P][W]=d.connect(A,W,H)}else if($||typeof H=="boolean")A[W]=H;else A.setAttribute(X,H);return A}H=A[W];if($&&typeof H!="undefined")return H;if(W!="href"&&(typeof H=="boolean"||d.isFunction(H)))return H;return o(A,X)?A.getAttribute(X):null};d.removeAttr=function(A,E){a(A).removeAttribute(n(E))};d.getNodeProp=
function(A,E){A=a(A);var H=E.toLowerCase(),P=z[H]||E;if(P in A&&P!="href")return A[P];E=y[H]||E;return o(A,E)?A.getAttribute(E):null};d.create=function(A,E,H,P){var W=d.doc;if(H){H=a(H);W=H.ownerDocument}if(typeof A=="string")A=W.createElement(A);E&&d.attr(A,E);H&&d.place(A,H,P);return A};d.empty=d.isIE?function(A){A=a(A);for(var E;E=A.lastChild;)d.destroy(E)}:function(A){a(A).innerHTML=""};var x={option:["select"],tbody:["table"],thead:["table"],tfoot:["table"],tr:["table","tbody"],td:["table","tbody",
"tr"],th:["table","thead","tr"],legend:["fieldset"],caption:["table"],colgroup:["table"],col:["table","colgroup"],li:["ul"]},B=/<\s*([\w\:]+)/,C={},D=0,F="__"+d._scopeName+"ToDomId";for(var J in x)if(x.hasOwnProperty(J)){var K=x[J];K.pre=J=="option"?'<select multiple="multiple">':"<"+K.join("><")+">";K.post="</"+K.reverse().join("></")+">"}d._toDom=function(A,E){E=E||d.doc;var H=E[F];if(!H){E[F]=H=++D+"";C[H]=E.createElement("div")}A+="";var P=A.match(B),W=P?P[1].toLowerCase():"";H=C[H];if(P&&x[W]){P=
x[W];H.innerHTML=P.pre+A+P.post;for(A=P.length;A;--A)H=H.firstChild}else H.innerHTML=A;if(H.childNodes.length==1)return H.removeChild(H.firstChild);for(A=E.createDocumentFragment();E=H.firstChild;)A.appendChild(E);return A};var L="className";d.hasClass=function(A,E){return(" "+a(A)[L]+" ").indexOf(" "+E+" ")>=0};var R=/\s+/,T=[""],S={},ca=function(A){if(typeof A=="string"||A instanceof String)if(A.indexOf(" ")<0){T[0]=A;return T}else return A.split(R);return A||""};d.addClass=function(A,E){A=a(A);
E=ca(E);var H=A[L],P;H=H?" "+H+" ":" ";P=H.length;for(var W=0,X=E.length,$;W<X;++W)if(($=E[W])&&H.indexOf(" "+$+" ")<0)H+=$+" ";if(P<H.length)A[L]=H.substr(1,H.length-2)};d.removeClass=function(A,E){A=a(A);var H;if(E!==undefined){E=ca(E);H=" "+A[L]+" ";for(var P=0,W=E.length;P<W;++P)H=H.replace(" "+E[P]+" "," ");H=d.trim(H)}else H="";if(A[L]!=H)A[L]=H};d.replaceClass=function(A,E,H){A=a(A);S.className=A.className;d.removeClass(S,H);d.addClass(S,E);if(A.className!==S.className)A.className=S.className};
d.toggleClass=function(A,E,H){if(H===undefined)H=!d.hasClass(A,E);d[H?"addClass":"removeClass"](A,E)}})();return d});
define("dojo/_base/NodeList",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array","dojo/_base/connect","dojo/_base/html"],function(d){(function(){var b=Array.prototype,a=b.slice,c=b.concat,e=function(r,s,v){r.sort||(r=a.call(r,0));v=v||this._NodeListCtor||d._NodeListCtor;r.constructor=v;d._mixin(r,v.prototype);r._NodeListCtor=v;return s?r._stash(s):r},f=function(r,s,v){s=[0].concat(a.call(s,0));v=v||d.global;return function(z){s[0]=z;return r.apply(v,s)}},g=function(r,s){return function(){this.forEach(f(r,
arguments,s));return this}},i=function(r,s){return function(){return this.map(f(r,arguments,s))}},j=function(r,s,v){return function(){var z=arguments,y=f(r,z,v);if(s.call(v||d.global,z))return this.map(y);this.forEach(y);return this}},h=function(r){return r.length==1&&typeof r[0]=="string"},l=function(r){var s=r.parentNode;s&&s.removeChild(r)};d.NodeList=function(){return e(Array.apply(null,arguments))};var p=d._NodeListCtor=d.NodeList,t=p.prototype;p._wrap=t._wrap=e;p._adaptAsMap=i;p._adaptAsForEach=
g;p._adaptAsFilter=function(r,s){return function(){return this.filter(f(r,arguments,s))}};p._adaptWithCondition=j;d.forEach(["slice","splice"],function(r){var s=b[r];t[r]=function(){return this._wrap(s.apply(this,arguments),r=="slice"?this:null)}});d.forEach(["indexOf","lastIndexOf","every","some"],function(r){var s=d[r];t[r]=function(){return s.apply(d,[this].concat(a.call(arguments,0)))}});d.forEach(["attr","style"],function(r){t[r]=j(d[r],h)});d.forEach(["connect","addClass","removeClass","replaceClass",
"toggleClass","empty","removeAttr"],function(r){t[r]=g(d[r])});d.extend(d.NodeList,{_normalize:function(r,s){var v=r.parse===true?true:false;if(typeof r.template=="string"){var z=r.templateFunc||d.string&&d.string.substitute;r=z?z(r.template,r):r}z=typeof r;if(z=="string"||z=="number"){r=d._toDom(r,s&&s.ownerDocument);r=r.nodeType==11?d._toArray(r.childNodes):[r]}else if(d.isArrayLike(r))d.isArray(r)||(r=d._toArray(r));else r=[r];if(v)r._runParse=true;return r},_cloneNode:function(r){return r.cloneNode(true)},
_place:function(r,s,v,z){if(!(s.nodeType!=1&&v=="only")){s=s;for(var y,k=r.length,n=k-1;n>=0;n--){var o=z?this._cloneNode(r[n]):r[n];if(r._runParse&&d.parser&&d.parser.parse){y||(y=s.ownerDocument.createElement("div"));y.appendChild(o);d.parser.parse(y);for(o=y.firstChild;y.firstChild;)y.removeChild(y.firstChild)}n==k-1?d.place(o,s,v):s.parentNode.insertBefore(o,s);s=o}}},_stash:function(r){this._parent=r;return this},end:function(){return this._parent?this._parent:new this._NodeListCtor},concat:function(){var r=
d.isArray(this)?this:a.call(this,0),s=d.map(arguments,function(v){return v&&!d.isArray(v)&&(typeof NodeList!="undefined"&&v.constructor===NodeList||v.constructor===this._NodeListCtor)?a.call(v,0):v});return this._wrap(c.apply(r,s),this)},map:function(r,s){return this._wrap(d.map(this,r,s),this)},forEach:function(r,s){d.forEach(this,r,s);return this},coords:i(d.coords),position:i(d.position),place:function(r,s){var v=d.query(r)[0];return this.forEach(function(z){d.place(z,v,s)})},orphan:function(r){return(r?
d._filterQueryResult(this,r):this).forEach(l)},adopt:function(r,s){return d.query(r).place(this[0],s)._stash(this)},query:function(r){if(!r)return this;var s=this.map(function(v){return d.query(r,v).filter(function(z){return z!==undefined})});return this._wrap(c.apply([],s),this)},filter:function(r){var s=arguments,v=this,z=0;if(typeof r=="string"){v=d._filterQueryResult(this,s[0]);if(s.length==1)return v._stash(this);z=1}return this._wrap(d.filter(v,s[z],s[z+1]),this)},addContent:function(r,s){r=
this._normalize(r,this[0]);for(var v=0,z;z=this[v];v++)this._place(r,z,s,v>0);return this},instantiate:function(r,s){var v=d.isFunction(r)?r:d.getObject(r);s=s||{};return this.forEach(function(z){new v(s,z)})},at:function(){var r=new this._NodeListCtor;d.forEach(arguments,function(s){if(s<0)s=this.length+s;this[s]&&r.push(this[s])},this);return r._stash(this)}});p.events=["blur","focus","change","click","error","keydown","keypress","keyup","load","mousedown","mouseenter","mouseleave","mousemove",
"mouseout","mouseover","mouseup","submit"];d.forEach(p.events,function(r){var s="on"+r;t[s]=function(v,z){return this.connect(s,v,z)}})})();return d.NodeList});
(function(){var d=function(a){var c=a.trim,e=a.forEach,f=a._NodeListCtor=a.NodeList,g=function(){return a.doc},i=(a.isWebKit||a.isMozilla)&&g().compatMode=="BackCompat",j=g().firstChild.children?"children":"childNodes",h=false,l=function(){return true},p=function(G){G+=">~+".indexOf(G.slice(-1))>=0?" * ":" ";for(var I=function(oa,qa){return c(G.slice(oa,qa))},M=[],O=-1,N=-1,Q=-1,U=-1,V=-1,Y=-1,Z=-1,da="",aa="",ja,ea=0,la=G.length,ba=null,ha=null,ra=function(){if(Z>=0){var oa=Z==ea?null:I(Z,ea);ba[">~+".indexOf(oa)<
0?"tag":"oper"]=oa;Z=-1}},sa=function(){if(Y>=0){ba.id=I(Y,ea).replace(/\\/g,"");Y=-1}},ta=function(){if(V>=0){ba.classes.push(I(V+1,ea).replace(/\\/g,""));V=-1}},ma=function(){sa();ra();ta()},ua=function(){ma();U>=0&&ba.pseudos.push({name:I(U+1,ea)});ba.loops=ba.pseudos.length||ba.attrs.length||ba.classes.length;ba.oquery=ba.query=I(ja,ea);ba.otag=ba.tag=ba.oper?null:ba.tag||"*";if(ba.tag)ba.tag=ba.tag.toUpperCase();if(M.length&&M[M.length-1].oper){ba.infixOper=M.pop();ba.query=ba.infixOper.query+
" "+ba.query}M.push(ba);ba=null};da=aa,aa=G.charAt(ea),ea<la;ea++)if(da!="\\"){if(!ba){ja=ea;ba={query:null,pseudos:[],attrs:[],classes:[],tag:null,oper:null,id:null,getTag:function(){return h?this.otag:this.tag}};Z=ea}if(O>=0)if(aa=="]"){if(ha.attr)ha.matchFor=I(Q||O+1,ea);else ha.attr=I(O+1,ea);if(O=ha.matchFor)if(O.charAt(0)=='"'||O.charAt(0)=="'")ha.matchFor=O.slice(1,-1);ba.attrs.push(ha);ha=null;O=Q=-1}else{if(aa=="="){Q="|~^$*".indexOf(da)>=0?da:"";ha.type=Q+aa;ha.attr=I(O+1,ea-Q.length);Q=
ea+1}}else if(N>=0){if(aa==")"){if(U>=0)ha.value=I(N+1,ea);U=N=-1}}else if(aa=="#"){ma();Y=ea+1}else if(aa=="."){ma();V=ea}else if(aa==":"){ma();U=ea}else if(aa=="["){ma();O=ea;ha={}}else if(aa=="("){if(U>=0){ha={name:I(U+1,ea),value:null};ba.pseudos.push(ha)}N=ea}else aa==" "&&da!=aa&&ua()}return M},t=function(G,I){if(!G)return I;if(!I)return G;return function(){return G.apply(window,arguments)&&I.apply(window,arguments)}},r=function(G,I){I=I||[];G&&I.push(G);return I},s=function(G){return 1==G.nodeType},
v=function(G,I){if(!G)return"";if(I=="class")return G.className||"";if(I=="for")return G.htmlFor||"";if(I=="style")return G.style.cssText||"";return(h?G.getAttribute(I):G.getAttribute(I,2))||""},z={"*=":function(G,I){return function(M){return v(M,G).indexOf(I)>=0}},"^=":function(G,I){return function(M){return v(M,G).indexOf(I)==0}},"$=":function(G,I){return function(M){M=" "+v(M,G);return M.lastIndexOf(I)==M.length-I.length}},"~=":function(G,I){var M=" "+I+" ";return function(O){return(" "+v(O,G)+
" ").indexOf(M)>=0}},"|=":function(G,I){var M=" "+I+"-";return function(O){O=" "+v(O,G);return O==I||O.indexOf(M)==0}},"=":function(G,I){return function(M){return v(M,G)==I}}},y=typeof g().firstChild.nextElementSibling=="undefined",k=!y?"nextElementSibling":"nextSibling",n=!y?"previousElementSibling":"previousSibling",o=y?s:l,m=function(G){for(;G=G[n];)if(o(G))return false;return true},q=function(G){for(;G=G[k];)if(o(G))return false;return true},w=function(G){var I=G.parentNode,M=0,O=I[j],N=G._i||
-1,Q=I._l||-1;if(!O)return-1;O=O.length;if(Q==O&&N>=0&&Q>=0)return N;I._l=O;N=-1;for(I=I.firstElementChild||I.firstChild;I;I=I[k])if(o(I)){I._i=++M;if(G===I)N=M}return N},u=function(G){return!(w(G)%2)},x=function(G){return w(G)%2},B={checked:function(){return function(G){return!!("checked"in G?G.checked:G.selected)}},"first-child":function(){return m},"last-child":function(){return q},"only-child":function(){return function(G){if(!m(G))return false;if(!q(G))return false;return true}},empty:function(){return function(G){var I=
G.childNodes;for(G=G.childNodes.length-1;G>=0;G--){var M=I[G].nodeType;if(M===1||M==3)return false}return true}},contains:function(G,I){G=I.charAt(0);if(G=='"'||G=="'")I=I.slice(1,-1);return function(M){return M.innerHTML.indexOf(I)>=0}},not:function(G,I){G=p(I)[0];I={el:1};if(G.tag!="*")I.tag=1;if(!G.classes.length)I.classes=1;var M=D(G,I);return function(O){return!M(O)}},"nth-child":function(G,I){G=parseInt;if(I=="odd")return x;else if(I=="even")return u;if(I.indexOf("n")!=-1){I=I.split("n",2);
var M=I[0]?I[0]=="-"?-1:G(I[0]):1,O=I[1]?G(I[1]):0,N=0,Q=-1;if(M>0)if(O<0)O=O%M&&M+O%M;else{if(O>0){if(O>=M)N=O-O%M;O%=M}}else if(M<0){M*=-1;if(O>0){Q=O;O%=M}}if(M>0)return function(V){V=w(V);return V>=N&&(Q<0||V<=Q)&&V%M==O};else I=O}var U=G(I);return function(V){return w(V)==U}}},C=a.isIE<9||dojo.isIE&&dojo.isQuirks?function(G){var I=G.toLowerCase();if(I=="class")G="className";return function(M){return h?M.getAttribute(G):M[G]||M[I]}}:function(G){return function(I){return I&&I.getAttribute&&I.hasAttribute(G)}},
D=function(G,I){if(!G)return l;I=I||{};var M=null;"el"in I||(M=t(M,s));if(!("tag"in I))if(G.tag!="*")M=t(M,function(O){return O&&O.tagName==G.getTag()});"classes"in I||e(G.classes,function(O,N){var Q=new RegExp("(?:^|\\s)"+O+"(?:\\s|$)");M=t(M,function(U){return Q.test(U.className)});M.count=N});"pseudos"in I||e(G.pseudos,function(O){var N=O.name;if(B[N])M=t(M,B[N](N,O.value))});"attrs"in I||e(G.attrs,function(O){var N,Q=O.attr;if(O.type&&z[O.type])N=z[O.type](Q,O.matchFor);else if(Q.length)N=C(Q);
if(N)M=t(M,N)});if(!("id"in I))if(G.id)M=t(M,function(O){return!!O&&O.id==G.id});M||"default"in I||(M=l);return M},F=function(G){return function(I,M,O){for(;I=I[k];)if(!(y&&!s(I))){if((!O||ia(I,O))&&G(I))M.push(I);break}return M}},J=function(G){return function(I,M,O){for(I=I[k];I;){if(o(I)){if(O&&!ia(I,O))break;G(I)&&M.push(I)}I=I[k]}return M}},K=function(G){G=G||l;return function(I,M,O){for(var N=0,Q=I[j];I=Q[N++];)if(o(I)&&(!O||ia(I,O))&&G(I,N))M.push(I);return M}},L=function(G,I){for(G=G.parentNode;G;){if(G==
I)break;G=G.parentNode}return!!G},R={},T=function(G){var I=R[G.query];if(I)return I;var M=G.infixOper;M=M?M.oper:"";var O=D(G,{el:1}),N="*"==G.tag,Q=g().getElementsByClassName;if(M){Q={el:1};if(N)Q.tag=1;O=D(G,Q);if("+"==M)I=F(O);else if("~"==M)I=J(O);else if(">"==M)I=K(O)}else if(G.id){O=!G.loops&&N?l:D(G,{el:1,id:1});I=function(V,Y){var Z=a.byId(G.id,V.ownerDocument||V);if(Z&&O(Z))if(9==V.nodeType)return r(Z,Y);else if(L(Z,V))return r(Z,Y)}}else if(Q&&/\{\s*\[native code\]\s*\}/.test(String(Q))&&
G.classes.length&&!i){O=D(G,{el:1,classes:1,id:1});var U=G.classes.join(" ");I=function(V,Y,Z){Y=r(0,Y);for(var da,aa=0,ja=V.getElementsByClassName(U);da=ja[aa++];)O(da,V)&&ia(da,Z)&&Y.push(da);return Y}}else if(!N&&!G.loops)I=function(V,Y,Z){Y=r(0,Y);for(var da=0,aa=V.getElementsByTagName(G.getTag());V=aa[da++];)ia(V,Z)&&Y.push(V);return Y};else{O=D(G,{el:1,tag:1,id:1});I=function(V,Y,Z){Y=r(0,Y);for(var da,aa=0,ja=V.getElementsByTagName(G.getTag());da=ja[aa++];)O(da,V)&&ia(da,Z)&&Y.push(da);return Y}}return R[G.query]=
I},S=function(G,I){G=r(G);for(var M,O,N=I.length,Q,U,V=0;V<N;V++){U=[];M=I[V];O=G.length-1;if(O>0){Q={};U.nozip=true}O=T(M);for(var Y=0;M=G[Y];Y++)O(M,U,Q);if(!U.length)break;G=U}return U},ca={},A={},E=function(G){var I=p(c(G));if(I.length==1){var M=T(I[0]);return function(O){if(O=M(O,new f))O.nozip=true;return O}}return function(O){return S(O,I)}},H=navigator.userAgent;H=a.isWebKit&&H.indexOf("WebKit/")>0&&parseFloat(H.split("WebKit/")[1])>528;var P=a.isIE?"commentStrip":"nozip",W=!!g().querySelectorAll&&
(!a.isSafari||a.isSafari>3.1||H),X=/n\+\d|([^ ])?([>~+])([^ =])?/g,$=function(G,I,M,O){return M?(I?I+" ":"")+M+(O?" "+O:""):G},fa=function(G,I){G=G.replace(X,$);if(W){var M=A[G];if(M&&!I)return M}if(M=ca[G])return M;M=G.charAt(0);var O=-1==G.indexOf(" ");if(G.indexOf("#")>=0&&O)I=true;if(W&&!I&&">~+".indexOf(M)==-1&&(!a.isIE||G.indexOf(":")==-1)&&!(i&&G.indexOf(".")>=0)&&G.indexOf(":contains")==-1&&G.indexOf(":checked")==-1&&G.indexOf("|=")==-1){var N=">~+".indexOf(G.charAt(G.length-1))>=0?G+" *":
G;return A[G]=function(U){try{if(!(9==U.nodeType||O))throw"";var V=U.querySelectorAll(N);V[P]=true;return V}catch(Y){return fa(G,true)(U)}}}else{var Q=G.split(/\s*,\s*/);return ca[G]=Q.length<2?E(G):function(U){for(var V=0,Y=[],Z;Z=Q[V++];)Y=Y.concat(E(Z)(U));return Y}}},ga=0,na=a.isIE?function(G){return h?G.getAttribute("_uid")||G.setAttribute("_uid",++ga)||ga:G.uniqueID}:function(G){return G._uid||(G._uid=++ga)},ia=function(G,I){if(!I)return 1;G=na(G);if(!I[G])return I[G]=1;return 0},ka="_zipIdx",
pa=function(G){if(G&&G.nozip)return f._wrap?f._wrap(G):G;var I=new f;if(!G||!G.length)return I;G[0]&&I.push(G[0]);if(G.length<2)return I;ga++;if(a.isIE&&h){var M=ga+"";G[0].setAttribute(ka,M);for(var O=1,N;N=G[O];O++){G[O].getAttribute(ka)!=M&&I.push(N);N.setAttribute(ka,M)}}else if(a.isIE&&G.commentStrip)try{for(O=1;N=G[O];O++)s(N)&&I.push(N)}catch(Q){}else{if(G[0])G[0][ka]=ga;for(O=1;N=G[O];O++){G[O][ka]!=ga&&I.push(N);N[ka]=ga}}return I};a.query=function(G,I){f=a._NodeListCtor;if(!G)return new f;
if(G.constructor==f)return G;if(typeof G!="string")return new f(G);if(typeof I=="string"){I=a.byId(I);if(!I)return new f}I=I||g();var M=I.ownerDocument||I.documentElement;h=I.contentType&&I.contentType=="application/xml"||a.isOpera&&(I.doctype||M.toString()=="[object XMLDocument]")||!!M&&(a.isIE?M.xml:I.xmlVersion||M.xmlVersion);if((G=fa(G)(I))&&G.nozip&&!f._wrap)return G;return pa(G)};a.query.pseudos=B;a._filterQueryResult=function(G,I,M){var O=new a._NodeListCtor,N=p(I);N=N.length==1&&!/[^\w#\.]/.test(I)?
D(N[0]):function(V){return dojo.query(I,M).indexOf(V)!=-1};for(var Q=0,U;U=G[Q];Q++)N(U)&&O.push(U);return O}},b=function(){acme={trim:function(f){f=f.replace(/^\s+/,"");for(var g=f.length-1;g>=0;g--)if(/\S/.test(f.charAt(g))){f=f.substring(0,g+1);break}return f},forEach:function(f,g,i){if(f&&f.length)for(var j=0,h=f.length;j<h;++j)g.call(i||window,f[j],j,f)},byId:function(f,g){return typeof f=="string"?(g||document).getElementById(f):f},doc:document,NodeList:Array};var a=navigator,c=a.userAgent;
a=a.appVersion;var e=parseFloat(a);acme.isOpera=c.indexOf("Opera")>=0?e:undefined;acme.isKhtml=a.indexOf("Konqueror")>=0?e:undefined;acme.isWebKit=parseFloat(c.split("WebKit/")[1])||undefined;acme.isChrome=parseFloat(c.split("Chrome/")[1])||undefined;if((c=Math.max(a.indexOf("WebKit"),a.indexOf("Safari"),0))&&!acme.isChrome){acme.isSafari=parseFloat(a.split("Version/")[1]);if(!acme.isSafari||parseFloat(a.substr(c+7))<=419.3)acme.isSafari=2}if(document.all&&!acme.isOpera)acme.isIE=parseFloat(a.split("MSIE ")[1])||
undefined;Array._wrap=function(f){return f};return acme};typeof define=="function"&&define("dojo/_base/query",["dojo/lib/kernel","dojo/_base/NodeList","dojo/_base/lang","dojo/_base/window"],function(a){d(this.queryPortability||this.acme||a)});if(typeof define!="function")if(this.dojo){dojo.provide("dojo._base.query");dojo.require("dojo._base.NodeList");dojo.require("dojo._base.lang");d(this.queryPortability||this.acme||dojo)}else d(this.queryPortability||this.acme||b())})();
define("dojo/_base/xhr",["dojo/lib/kernel","dojo/_base/Deferred","dojo/_base/json","dojo/_base/lang","dojo/_base/query"],function(d){(function(){function b(y,k,n){if(n!==null){var o=y[k];if(typeof o=="string")y[k]=[o,n];else if(a.isArray(o))o.push(n);else y[k]=n}}var a=d,c=a.config;d.fieldToObject=function(y){var k=null;if(y=a.byId(y)){var n=y.name,o=(y.type||"").toLowerCase();if(n&&o&&!y.disabled)if(o=="radio"||o=="checkbox"){if(y.checked)k=y.value}else if(y.multiple){k=[];a.query("option",y).forEach(function(m){m.selected&&
k.push(m.value)})}else k=y.value}return k};d.formToObject=function(y){var k={};a.forEach(d.byId(y).elements,function(n){var o=n.name,m=(n.type||"").toLowerCase();if(o&&m&&"file|submit|image|reset|button|".indexOf(m)==-1&&!n.disabled){b(k,o,a.fieldToObject(n));if(m=="image")k[o+".x"]=k[o+".y"]=k[o].x=k[o].y=0}});return k};d.objectToQuery=function(y){var k=encodeURIComponent,n=[],o={};for(var m in y){var q=y[m];if(q!=o[m]){var w=k(m)+"=";if(a.isArray(q))for(var u=0;u<q.length;u++)n.push(w+k(q[u]));
else n.push(w+k(q))}}return n.join("&")};d.formToQuery=function(y){return a.objectToQuery(a.formToObject(y))};d.formToJson=function(y,k){return a.toJson(a.formToObject(y),k)};d.queryToObject=function(y){var k={};y=y.split("&");var n=decodeURIComponent;a.forEach(y,function(o){if(o.length){var m=o.split("=");o=n(m.shift());m=n(m.join("="));if(typeof k[o]=="string")k[o]=[k[o]];if(a.isArray(k[o]))k[o].push(m);else k[o]=m}});return k};d._blockAsync=false;var e=a._contentHandlers=d.contentHandlers={text:function(y){return y.responseText},
json:function(y){return a.fromJson(y.responseText||null)},"json-comment-filtered":function(y){d.config.useCommentedJson||console.warn("Consider using the standard mimetype:application/json. json-commenting can introduce security issues. To decrease the chances of hijacking, use the standard the 'json' handler and prefix your json with: {}&&\nUse djConfig.useCommentedJson=true to turn off this message.");y=y.responseText;var k=y.indexOf("/*"),n=y.lastIndexOf("*/");if(k==-1||n==-1)throw new Error("JSON was not comment filtered");
return a.fromJson(y.substring(k+2,n))},javascript:function(y){return a.eval(y.responseText)},xml:function(y){var k=y.responseXML;if(a.isIE&&(!k||!k.documentElement)){var n=function(o){return"MSXML"+o+".DOMDocument"};n=["Microsoft.XMLDOM",n(6),n(4),n(3),n(2)];a.some(n,function(o){try{var m=new ActiveXObject(o);m.async=false;m.loadXML(y.responseText);k=m}catch(q){return false}return true})}return k},"json-comment-optional":function(y){return y.responseText&&/^[^{\[]*\/\*/.test(y.responseText)?e["json-comment-filtered"](y):
e.json(y)}};d._ioSetArgs=function(y,k,n,o){var m={args:y,url:y.url},q=null;if(y.form){q=a.byId(y.form);var w=q.getAttributeNode("action");m.url=m.url||(w?w.value:null);q=a.formToObject(q)}w=[{}];q&&w.push(q);y.content&&w.push(y.content);y.preventCache&&w.push({"dojo.preventCache":(new Date).valueOf()});m.query=a.objectToQuery(a.mixin.apply(null,w));m.handleAs=y.handleAs||"text";var u=new a.Deferred(k);u.addCallbacks(n,function(D){return o(D,u)});var x=y.load;x&&a.isFunction(x)&&u.addCallback(function(D){return x.call(y,
D,m)});var B=y.error;B&&a.isFunction(B)&&u.addErrback(function(D){return B.call(y,D,m)});var C=y.handle;C&&a.isFunction(C)&&u.addBoth(function(D){return C.call(y,D,m)});if(c.ioPublish&&a.publish&&m.args.ioPublish!==false){u.addCallbacks(function(D){a.publish("/dojo/io/load",[u,D]);return D},function(D){a.publish("/dojo/io/error",[u,D]);return D});u.addBoth(function(D){a.publish("/dojo/io/done",[u,D]);return D})}u.ioArgs=m;return u};var f=function(y){y.canceled=true;var k=y.ioArgs.xhr,n=typeof k.abort;
if(n=="function"||n=="object"||n=="unknown")k.abort();y=y.ioArgs.error;if(!y){y=new Error("xhr cancelled");y.dojoType="cancel"}return y},g=function(y){y=e[y.ioArgs.handleAs](y.ioArgs.xhr);return y===undefined?null:y},i=function(y,k){k.ioArgs.args.failOk||console.error(y);return y},j=null,h=[],l=0,p=function(y){if(l<=0){l=0;if(c.ioPublish&&a.publish&&(!y||y&&y.ioArgs.args.ioPublish!==false))a.publish("/dojo/io/stop")}},t=function(){var y=(new Date).getTime();if(!a._blockAsync)for(var k=0,n;k<h.length&&
(n=h[k]);k++){var o=n.dfd,m=function(){if(!o||o.canceled||!n.validCheck(o)){h.splice(k--,1);l-=1}else if(n.ioCheck(o)){h.splice(k--,1);n.resHandle(o);l-=1}else if(o.startTime)if(o.startTime+(o.ioArgs.args.timeout||0)<y){h.splice(k--,1);var w=new Error("timeout exceeded");w.dojoType="timeout";o.errback(w);o.cancel();l-=1}};if(d.config.debugAtAllCosts)m.call(this);else try{m.call(this)}catch(q){o.errback(q)}}p(o);if(!h.length){clearInterval(j);j=null}};d._ioCancelAll=function(){try{a.forEach(h,function(k){try{k.dfd.cancel()}catch(n){}})}catch(y){}};
a.isIE&&a.addOnWindowUnload(a._ioCancelAll);a._ioNotifyStart=function(y){if(c.ioPublish&&a.publish&&y.ioArgs.args.ioPublish!==false){l||a.publish("/dojo/io/start");l+=1;a.publish("/dojo/io/send",[y])}};a._ioWatch=function(y,k,n,o){var m=y.ioArgs.args;if(m.timeout)y.startTime=(new Date).getTime();h.push({dfd:y,validCheck:k,ioCheck:n,resHandle:o});j||(j=setInterval(t,50));m.sync&&t()};var r="application/x-www-form-urlencoded",s=function(y){return y.ioArgs.xhr.readyState},v=function(y){return 4==y.ioArgs.xhr.readyState},
z=function(y){var k=y.ioArgs.xhr;if(a._isDocumentOk(k))y.callback(y);else{var n=new Error("Unable to load "+y.ioArgs.url+" status:"+k.status);n.status=k.status;n.responseText=k.responseText;y.errback(n)}};d._ioAddQueryToUrl=function(y){if(y.query.length){y.url+=(y.url.indexOf("?")==-1?"?":"&")+y.query;y.query=null}};d.xhr=function(y,k,n){var o=a._ioSetArgs(k,f,g,i),m=o.ioArgs,q=m.xhr=a._xhrObj(m.args);if(!q){o.cancel();return o}if("postData"in k)m.query=k.postData;else if("putData"in k)m.query=k.putData;
else if("rawBody"in k)m.query=k.rawBody;else if(arguments.length>2&&!n||"POST|PUT".indexOf(y.toUpperCase())==-1)a._ioAddQueryToUrl(m);q.open(y,m.url,k.sync!==true,k.user||undefined,k.password||undefined);if(k.headers)for(var w in k.headers)if(w.toLowerCase()==="content-type"&&!k.contentType)k.contentType=k.headers[w];else k.headers[w]&&q.setRequestHeader(w,k.headers[w]);q.setRequestHeader("Content-Type",k.contentType||r);if(!k.headers||!("X-Requested-With"in k.headers))q.setRequestHeader("X-Requested-With",
"XMLHttpRequest");a._ioNotifyStart(o);if(d.config.debugAtAllCosts)q.send(m.query);else try{q.send(m.query)}catch(u){m.error=u;o.cancel()}a._ioWatch(o,s,v,z);return o};d.xhrGet=function(y){return a.xhr("GET",y)};d.rawXhrPost=d.xhrPost=function(y){return a.xhr("POST",y,true)};d.rawXhrPut=d.xhrPut=function(y){return a.xhr("PUT",y,true)};d.xhrDelete=function(y){return a.xhr("DELETE",y)}})();return d.xhr});
define("dojo/_base/fx",["dojo/lib/kernel","dojo/_base/Color","dojo/_base/connect","dojo/_base/lang","dojo/_base/html"],function(d){(function(){var b=d._mixin;d._Line=function(i,j){this.start=i;this.end=j};d._Line.prototype.getValue=function(i){return(this.end-this.start)*i+this.start};d.Animation=function(i){b(this,i);if(d.isArray(this.curve))this.curve=new d._Line(this.curve[0],this.curve[1])};d._Animation=d.Animation;d.extend(d.Animation,{duration:350,repeat:0,rate:20,_percent:0,_startRepeatCount:0,
_getStep:function(){var i=this._percent,j=this.easing;return j?j(i):i},_fire:function(i,j){j=j||[];if(this[i])if(d.config.debugAtAllCosts)this[i].apply(this,j);else try{this[i].apply(this,j)}catch(h){console.error("exception in animation handler for:",i);console.error(h)}return this},play:function(i,j){var h=this;h._delayTimer&&h._clearTimer();if(j){h._stopTimer();h._active=h._paused=false;h._percent=0}else if(h._active&&!h._paused)return h;h._fire("beforeBegin",[h.node]);i=i||h.delay;var l=d.hitch(h,
"_play",j);if(i>0){h._delayTimer=setTimeout(l,i);return h}l();return h},_play:function(){var i=this;i._delayTimer&&i._clearTimer();i._startTime=(new Date).valueOf();if(i._paused)i._startTime-=i.duration*i._percent;i._active=true;i._paused=false;var j=i.curve.getValue(i._getStep());if(!i._percent){if(!i._startRepeatCount)i._startRepeatCount=i.repeat;i._fire("onBegin",[j])}i._fire("onPlay",[j]);i._cycle();return i},pause:function(){var i=this;i._delayTimer&&i._clearTimer();i._stopTimer();if(!i._active)return i;
i._paused=true;i._fire("onPause",[i.curve.getValue(i._getStep())]);return i},gotoPercent:function(i,j){var h=this;h._stopTimer();h._active=h._paused=true;h._percent=i;j&&h.play();return h},stop:function(i){var j=this;j._delayTimer&&j._clearTimer();if(!j._timer)return j;j._stopTimer();if(i)j._percent=1;j._fire("onStop",[j.curve.getValue(j._getStep())]);j._active=j._paused=false;return j},status:function(){if(this._active)return this._paused?"paused":"playing";return"stopped"},_cycle:function(){var i=
this;if(i._active){var j=((new Date).valueOf()-i._startTime)/i.duration;if(j>=1)j=1;i._percent=j;if(i.easing)j=i.easing(j);i._fire("onAnimate",[i.curve.getValue(j)]);if(i._percent<1)i._startTimer();else{i._active=false;if(i.repeat>0){i.repeat--;i.play(null,true)}else if(i.repeat==-1)i.play(null,true);else if(i._startRepeatCount){i.repeat=i._startRepeatCount;i._startRepeatCount=0}i._percent=0;i._fire("onEnd",[i.node]);!i.repeat&&i._stopTimer()}}return i},_clearTimer:function(){clearTimeout(this._delayTimer);
delete this._delayTimer}});var a=0,c=null,e={run:function(){}};d.extend(d.Animation,{_startTimer:function(){if(!this._timer){this._timer=d.connect(e,"run",this,"_cycle");a++}c||(c=setInterval(d.hitch(e,"run"),this.rate))},_stopTimer:function(){if(this._timer){d.disconnect(this._timer);this._timer=null;a--}if(a<=0){clearInterval(c);c=null;a=0}}});var f=d.isIE?function(i){var j=i.style;if(!j.width.length&&d.style(i,"width")=="auto")j.width="auto"}:function(){};d._fade=function(i){i.node=d.byId(i.node);
var j=b({properties:{}},i);i=j.properties.opacity={};i.start=!("start"in j)?function(){return+d.style(j.node,"opacity")||0}:j.start;i.end=j.end;i=d.animateProperty(j);d.connect(i,"beforeBegin",d.partial(f,j.node));return i};d.fadeIn=function(i){return d._fade(b({end:1},i))};d.fadeOut=function(i){return d._fade(b({end:0},i))};d._defaultEasing=function(i){return 0.5+Math.sin((i+1.5)*Math.PI)/2};var g=function(i){this._properties=i;for(var j in i){var h=i[j];if(h.start instanceof d.Color)h.tempColor=
new d.Color}};g.prototype.getValue=function(i){var j={};for(var h in this._properties){var l=this._properties[h],p=l.start;if(p instanceof d.Color)j[h]=d.blendColors(p,l.end,i,l.tempColor).toCss();else d.isArray(p)||(j[h]=(l.end-p)*i+p+(h!="opacity"?l.units||"px":0))}return j};d.animateProperty=function(i){var j=i.node=d.byId(i.node);if(!i.easing)i.easing=d._defaultEasing;i=new d.Animation(i);d.connect(i,"beforeBegin",i,function(){var h={};for(var l in this.properties){if(l=="width"||l=="height")this.node.display=
"block";var p=this.properties[l];if(d.isFunction(p))p=p(j);p=h[l]=b({},d.isObject(p)?p:{end:p});if(d.isFunction(p.start))p.start=p.start(j);if(d.isFunction(p.end))p.end=p.end(j);var t=l.toLowerCase().indexOf("color")>=0,r=function(s,v){var z={height:s.offsetHeight,width:s.offsetWidth}[v];if(z!==undefined)return z;z=d.style(s,v);return v=="opacity"?+z:t?z:parseFloat(z)};if("end"in p){if(!("start"in p))p.start=r(j,l)}else p.end=r(j,l);if(t){p.start=new d.Color(p.start);p.end=new d.Color(p.end)}else p.start=
l=="opacity"?+p.start:parseFloat(p.start)}this.curve=new g(h)});d.connect(i,"onAnimate",d.hitch(d,"style",i.node));return i};d.anim=function(i,j,h,l,p,t){return d.animateProperty({node:i,duration:h||d.Animation.prototype.duration,properties:j,easing:l,onEnd:p}).play(t||0)}})();return d.animateProperty});
define("dojo",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array","dojo/_base/declare","dojo/_base/connect","dojo/_base/Deferred","dojo/_base/json","dojo/_base/Color","dojo/_base/window","dojo/_base/event","dojo/_base/html","dojo/_base/NodeList","dojo/_base/query","dojo/_base/xhr","dojo/_base/fx"],function(d){return d});
define("orion/serviceregistry",["dojo"],function(d){function b(g,i,j){this.serviceId=g;this.name=i;this.properties=j}function a(g,i,j){this.serviceId=g;this.serviceReference=i;this.internalRegistry=j}function c(g,i,j){this.serviceId=g;this.implementation=i;this.internalRegistry=j;var h;for(h in i)if(typeof i[h]==="function")this[h]=function(l){return function(){if(j.isRegistered(g)){var p=new d.Deferred;try{var t=i[l].apply(i,Array.prototype.slice.call(arguments));d.when(t,d.hitch(p,p.resolve),d.hitch(p,
p.reject),d.hitch(p,p.progress))}catch(r){p.reject(r)}return p}throw new Error("Service was unregistered");}}(h)}function e(){this._namedlisteners={}}function f(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new e;var g=this;this.internalRegistry={isRegistered:function(i){return g._entries[i]?true:false},unregisterService:function(i){var j=g._entries[i];if(j){for(var h=j.reference,l=g._namedReferences[h.getName()],p=0;p<l.length;p++)if(l[p]===h){if(l.length===1)delete g._namedReferences[h.getName()];
else l.splice(p,1);break}g._entries[i]=null;g._serviceEventTarget.dispatchEvent("serviceRemoved",h,j.service)}},dispatchEvent:function(i,j){var h=g._entries[i];h&&h.eventTarget.dispatchEvent.apply(h.eventTarget,[j].concat(Array.prototype.slice.call(arguments,2)))},addEventListener:function(i,j,h){(i=g._entries[i])&&i.eventTarget.addEventListener(j,h)},removeEventListener:function(i,j,h){(i=g._entries[i])&&i.eventTarget.removeEventListener(j,h)}}}b.prototype={getServiceId:function(){return this.serviceId},
getName:function(){return this.name},getPropertyNames:function(){var g=[],i;for(i in this.properties)this.properties.hasOwnProperty(i)&&g.push(i);return g},getProperty:function(g){return this.properties[g]}};b.prototype.constructor=b;a.prototype={unregister:function(){this.internalRegistry.unregisterService(this.serviceId)},dispatchEvent:function(g){this.internalRegistry.dispatchEvent.apply(this.internalRegistry,[this.serviceId,g].concat(Array.prototype.slice.call(arguments,1)))},getServiceReference:function(){return this.serviceReference}};
a.prototype.constructor=a;c.prototype={addEventListener:function(g,i){this.internalRegistry.addEventListener(this.serviceId,g,i)},removeEventListener:function(g,i){this.internalRegistry.removeEventListener(this.serviceId,g,i)}};c.prototype.constructor=c;e.prototype={dispatchEvent:function(g){var i=this._namedlisteners[g];if(i)for(var j=0;j<i.length;j++)try{var h=Array.prototype.slice.call(arguments,1);i[j].apply(null,h)}catch(l){console.log(l)}},addEventListener:function(g,i){this._namedlisteners[g]=
this._namedlisteners[g]||[];this._namedlisteners[g].push(i)},removeEventListener:function(g,i){var j=this._namedlisteners[g];if(j)for(var h=0;h<j.length;h++)if(j[h]===i){if(j.length===1)delete this._namedlisteners[g];else j.splice(h,1);break}}};e.prototype.constructor=e;f.prototype={getService:function(g,i){var j,h=new d.Deferred;if(typeof g==="string"){if(this._namedReferences[g])for(var l=0;l<this._namedReferences[g].length;l++)if(j=this._entries[this._namedReferences[g][l].getServiceId()].service)break}else j=
this._entries[g.getServiceId()].service;if(j)h.resolve(j);else if(i===0)h.reject(new Error("timeout: getService"));else{var p=this,t=function(r,s){if(g===r||g===r.getName()){h.resolve(s);p._serviceEventTarget.removeEventListener("serviceAdded",t)}};this._serviceEventTarget.addEventListener("serviceAdded",t)}return h.promise},getServiceReferences:function(g){if(g)return this._namedReferences[g]?this._namedReferences[g]:[];g=[];for(var i=0;i<this._entries.length;i++)this._entries[i]&&g.push(this._entries[i].reference);
return g},registerService:function(g,i,j){var h=this._entries.length;j=new b(h,g,j);i=new c(h,i,this.internalRegistry);this._namedReferences[g]=this._namedReferences[g]||[];this._namedReferences[g].push(j);this._entries.push({reference:j,service:i,eventTarget:new e});this._serviceEventTarget.dispatchEvent("serviceAdded",j,i);return new a(h,j,this.internalRegistry)},addEventListener:function(g,i){this._serviceEventTarget.addEventListener(g,i)},removeEventListener:function(g,i){this._serviceEventTarget.removeEventListener(g,
i)}};f.prototype.constructor=f;return{ServiceReference:b,ServiceRegistration:a,Service:c,EventTarget:e,ServiceRegistry:f}});define("dijit",["dojo"],function(d){return dijit=d._dijit||{}});
define("dojo/hash",["dojo"],function(d){(function(){function b(p,t){t=p.indexOf(t);return t>=0?p.substring(t+1):""}function a(){return b(location.href,"#")}function c(){d.publish("/dojo/hashchange",[a()])}function e(){if(a()!==i){i=a();c()}}function f(p){if(j)if(j.isTransitioning())setTimeout(d.hitch(null,f,p),l);else{var t=j.iframe.location.href,r=t.indexOf("?");j.iframe.location.replace(t.substring(0,r)+"?"+p)}else{location.replace("#"+p);!h&&e()}}function g(){function p(){i=a();s=k?i:b(n.href,
"?");v=false;z=null}var t=document.createElement("iframe"),r=d.config.dojoBlankHtmlUrl||d.moduleUrl("dojo","resources/blank.html");d.config.useXDomain&&!d.config.dojoBlankHtmlUrl&&console.warn("dojo.hash: When using cross-domain Dojo builds, please save dojo/resources/blank.html to your domain and set djConfig.dojoBlankHtmlUrl to the path on your domain to blank.html");t.id="dojo-hash-iframe";t.src=r+"?"+a();t.style.display="none";document.body.appendChild(t);this.iframe=d.global["dojo-hash-iframe"];
var s,v,z,y,k,n=this.iframe.location;this.isTransitioning=function(){return v};this.pollLocation=function(){if(!k)try{var o=b(n.href,"?");if(document.title!=y)y=this.iframe.document.title=document.title}catch(m){k=true;console.error("dojo.hash: Error adding history entry. Server unreachable.")}var q=a();if(v&&i===q)if(k||o===z){p();c()}else{setTimeout(d.hitch(this,this.pollLocation),0);return}else if(!(i===q&&(k||s===o)))if(i!==q){i=q;v=true;z=q;t.src=r+"?"+z;k=false;setTimeout(d.hitch(this,this.pollLocation),
0);return}else if(!k){location.href="#"+n.search.substring(1);p();c()}setTimeout(d.hitch(this,this.pollLocation),l)};p();setTimeout(d.hitch(this,this.pollLocation),l)}d.hash=function(p,t){if(!arguments.length)return a();if(p.charAt(0)=="#")p=p.substring(1);if(t)f(p);else location.href="#"+p;return p};var i,j,h,l=d.config.hashPollFrequency||100;d.addOnLoad(function(){if("onhashchange"in d.global&&(!d.isIE||d.isIE>=8&&document.compatMode!="BackCompat"))h=d.connect(d.global,"onhashchange",c);else if(document.addEventListener){i=
a();setInterval(e,l)}else if(document.attachEvent)j=new g})})();return d.hash});
(function(){var d=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],b=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,a=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,c=[];define("text",["require","exports","module"],function(){var e,f,g;if(typeof window!=="undefined"&&window.navigator&&window.document)f=function(i,j){var h=e.createXhr();h.open("GET",i,true);h.onreadystatechange=function(){h.readyState===4&&j(h.responseText)};h.send(null)};else if(typeof process!=="undefined"&&process.versions&&
process.versions.node){g=require.nodeRequire("fs");f=function(i,j){j(g.readFileSync(i,"utf8"))}}else if(typeof Packages!=="undefined")f=function(i,j){var h=new java.io.File(i);i=java.lang.System.getProperty("line.separator");h=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(h),"utf-8"));var l,p,t="";try{l=new java.lang.StringBuffer;if((p=h.readLine())&&p.length()&&p.charAt(0)===65279)p=p.substring(1);for(l.append(p);(p=h.readLine())!==null;){l.append(i);l.append(p)}t=
String(l.toString())}finally{h.close()}j(t)};return e={version:"0.24.0",strip:function(i){if(i){i=i.replace(b,"");var j=i.match(a);if(j)i=j[1]}else i="";return i},jsEscape:function(i){return i.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")},createXhr:function(){var i,j,h;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else for(j=0;j<3;j++){h=d[j];try{i=new ActiveXObject(h)}catch(l){}if(i){d=
[h];break}}if(!i)throw new Error("require.getXhr(): XMLHttpRequest not available");return i},get:f,load:function(i,j,h,l){var p=false,t=i.indexOf("."),r=i.substring(0,t),s=i.substring(t+1,i.length);t=s.indexOf("!");if(t!==-1){p=s.substring(t+1,s.length);p=p==="strip";s=s.substring(0,t)}j=j.nameToUrl(r,"."+s);e.get(j,function(v){v=p?e.strip(v):v;if(l.isBuild&&l.inlineText)c[i]=v;h(v)})},write:function(i,j,h){if(j in c){var l=e.jsEscape(c[j]);h("define('"+i+"!"+j+"', function () { return '"+l+"';});\n")}}}})})();
define("text!dijit/form/templates/ValidationTextBox.html",function(){return'<div class="dijit dijitReset dijitInlineTable dijitLeft"\n\tid="widget_${id}" role="presentation"\n\t><div class=\'dijitReset dijitValidationContainer\'\n\t\t><input class="dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value="&#935; " type="text" tabIndex="-1" readonly="readonly" role="presentation"\n\t/></div\n\t><div class="dijitReset dijitInputField dijitInputContainer"\n\t\t><input class="dijitReset dijitInputInner" dojoAttachPoint=\'textbox,focusNode\' autocomplete="off"\n\t\t\t${!nameAttrSetting} type=\'${type}\'\n\t/></div\n></div>'});
define("dojo/i18n",["require","dojo"],function(d,b){b.getObject("i18n",true,b);b.i18n.getLocalization=b.i18n.getLocalization||function(a,c,e){e=b.i18n.normalizeLocale(e);var f=e.split("-"),g=[a,"nls",c].join(".");if(typeof b.global.require!=="undefined"){var i=d("i18n!"+[a.replace(/\./g,"/"),"nls",c].join("/"));(b._loadedModules[g]=b._loadedModules[g]||{})[f.join("_")]=i.root||i}if(g=b._loadedModules[g]){var j;for(i=f.length;i>0;i--){var h=f.slice(0,i).join("_");if(g[h]){j=g[h];break}}if(!j)j=g.ROOT;
if(j){a=function(){};a.prototype=j;return new a}}throw new Error("Bundle not found: "+c+" in "+a+" , locale="+e);};b.i18n.normalizeLocale=function(a){a=a?a.toLowerCase():b.locale;if(a=="root")a="ROOT";return a};b.i18n._requireLocalization=function(a,c,e,f){e=b.i18n.normalizeLocale(e);var g=[a,"nls",c].join("."),i="";if(f){for(var j=f.split(","),h=0;h<j.length;h++)if(e.indexOf(j[h])==0)if(j[h].length>i.length)i=j[h];i||(i="ROOT")}j=f?i:e;var l=b._loadedModules[g];h=null;if(l){if(b.config.localizationComplete&&
l._built)return;h=j.replace(/-/g,"_");h=b._loadedModules[g+"."+h]}if(!h){l=b.provide(g);var p=b._getModuleSymbols(a).concat("nls").join("/"),t;b.i18n._searchLocalePath(j,f,function(r){var s=r.replace(/-/g,"_"),v=g+"."+s,z=false;if(b._loadedModules[v])z=true;else{b.provide(v);v=[p];r!="ROOT"&&v.push(r);v.push(c);r=v.join("/")+".js";z=b._loadPath(r,null,function(y){y=y.root||y;var k=function(){};k.prototype=t;l[s]=new k;for(var n in y)l[s][n]=y[n]})}if(z&&l[s])t=l[s];else l[s]=t;if(f)return true})}if(f&&
e!=i)l[e.replace(/-/g,"_")]=l[i.replace(/-/g,"_")]};(function(){var a=b.config.extraLocale;if(a){if(!a instanceof Array)a=[a];var c=b.i18n._requireLocalization;b.i18n._requireLocalization=function(e,f,g,i){c(e,f,g,i);if(!g)for(g=0;g<a.length;g++)c(e,f,a[g],i)}}})();b.i18n._searchLocalePath=function(a,c,e){a=b.i18n.normalizeLocale(a);var f=a.split("-");a=[];for(var g=f.length;g>0;g--)a.push(f.slice(0,g).join("-"));a.push(false);c&&a.reverse();for(c=a.length-1;c>=0;c--)if(e(a[c]||"ROOT"))break};b.i18n._preloadLocalizations=
function(a,c){function e(i){i=b.i18n.normalizeLocale(i);b.i18n._searchLocalePath(i,true,function(j){for(var h=0;h<c.length;h++)if(c[h]==j){b.require(a+"_"+j);return true}return false})}e();for(var f=b.config.extraLocale||[],g=0;g<f.length;g++)e(f[g])};return b.i18n});define("text!dijit/form/templates/TextBox.html",function(){return'<div class="dijit dijitReset dijitInline dijitLeft" id="widget_${id}" role="presentation"\n\t><div class="dijitReset dijitInputField dijitInputContainer"\n\t\t><input class="dijitReset dijitInputInner" dojoAttachPoint=\'textbox,focusNode\' autocomplete="off"\n\t\t\t${!nameAttrSetting} type=\'${type}\'\n\t/></div\n></div>'});
define("dojo/window",["dojo"],function(d){d.getObject("window",true,d);d.window.getBox=function(){var b=d.doc.compatMode=="BackCompat"?d.body():d.doc.documentElement,a=d._docScroll();return{w:b.clientWidth,h:b.clientHeight,l:a.x,t:a.y}};d.window.get=function(b){if(d.isIE&&window!==document.parentWindow){b.parentWindow.execScript("document._parentWindow = window;","Javascript");var a=b._parentWindow;b._parentWindow=null;return a}return b.parentWindow||b.defaultView};d.window.scrollIntoView=function(b,
a){try{b=d.byId(b);var c=b.ownerDocument||d.doc,e=c.body||d.body(),f=c.documentElement||e.parentNode,g=d.isIE,i=d.isWebKit;if((!(d.isMoz||g||i||d.isOpera)||b==e||b==f)&&typeof b.scrollIntoView!="undefined")b.scrollIntoView(false);else{var j=c.compatMode=="BackCompat",h=g>=9&&b.ownerDocument.parentWindow.frameElement?f.clientHeight>0&&f.clientWidth>0&&(e.clientHeight==0||e.clientWidth==0||e.clientHeight>f.clientHeight||e.clientWidth>f.clientWidth)?f:e:j?e:f;c=i?e:h;var l=h.clientWidth,p=h.clientHeight,
t=!d._isBodyLtr(),r=a||d.position(b),s=b.parentNode;a=function(B){return g<=6||g&&j?false:d.style(B,"position").toLowerCase()=="fixed"};if(!a(b))for(;s;){if(s==e)s=c;var v=d.position(s),z=a(s);if(s==c){v.w=l;v.h=p;if(c==f&&g&&t)v.x+=c.offsetWidth-v.w;if(v.x<0||!g)v.x=0;if(v.y<0||!g)v.y=0}else{var y=d._getPadBorderExtents(s);v.w-=y.w;v.h-=y.h;v.x+=y.l;v.y+=y.t;var k=s.clientWidth,n=v.w-k;if(k>0&&n>0){v.w=k;v.x+=t&&(g||s.clientLeft>y.l)?n:0}k=s.clientHeight;n=v.h-k;if(k>0&&n>0)v.h=k}if(z){if(v.y<0){v.h+=
v.y;v.y=0}if(v.x<0){v.w+=v.x;v.x=0}if(v.y+v.h>p)v.h=p-v.y;if(v.x+v.w>l)v.w=l-v.x}var o=r.x-v.x,m=r.y-Math.max(v.y,0),q=o+r.w-v.w,w=m+r.h-v.h;if(q*o>0){var u=Math[o<0?"max":"min"](o,q);if(t&&(g==8&&!j||g>=9))u=-u;r.x+=s.scrollLeft;s.scrollLeft+=u;r.x-=s.scrollLeft}if(w*m>0){r.y+=s.scrollTop;s.scrollTop+=Math[m<0?"max":"min"](m,w);r.y-=s.scrollTop}s=s!=c&&!z&&s.parentNode}}}catch(x){console.error("scrollIntoView: "+x);b.scrollIntoView(false)}};return d.window});
define("dijit/_base/manager",["dojo","dijit"],function(d,b){d.declare("dijit.WidgetSet",null,{constructor:function(){this._hash={};this.length=0},add:function(a){if(this._hash[a.id])throw new Error("Tried to register widget with id=="+a.id+" but that id is already registered");this._hash[a.id]=a;this.length++},remove:function(a){if(this._hash[a]){delete this._hash[a];this.length--}},forEach:function(a,c){c=c||d.global;var e=0,f;for(f in this._hash)a.call(c,this._hash[f],e++,this._hash);return this},
filter:function(a,c){c=c||d.global;var e=new b.WidgetSet,f=0,g;for(g in this._hash){var i=this._hash[g];a.call(c,i,f++,this._hash)&&e.add(i)}return e},byId:function(a){return this._hash[a]},byClass:function(a){var c=new b.WidgetSet,e,f;for(e in this._hash){f=this._hash[e];f.declaredClass==a&&c.add(f)}return c},toArray:function(){var a=[];for(var c in this._hash)a.push(this._hash[c]);return a},map:function(a,c){return d.map(this.toArray(),a,c)},every:function(a,c){c=c||d.global;var e=0,f;for(f in this._hash)if(!a.call(c,
this._hash[f],e++,this._hash))return false;return true},some:function(a,c){c=c||d.global;var e=0,f;for(f in this._hash)if(a.call(c,this._hash[f],e++,this._hash))return true;return false}});(function(){b.registry=new b.WidgetSet;var a=b.registry._hash,c=d.attr,e=d.hasAttr,f=d.style;b.byId=function(h){return typeof h=="string"?a[h]:h};var g={};b.getUniqueId=function(h){var l;do l=h+"_"+(h in g?++g[h]:(g[h]=0));while(a[l]);return b._scopeName=="dijit"?l:b._scopeName+"_"+l};b.findWidgets=function(h){function l(t){for(t=
t.firstChild;t;t=t.nextSibling)if(t.nodeType==1){var r=t.getAttribute("widgetId");if(r)(r=a[r])&&p.push(r);else l(t)}}var p=[];l(h);return p};b._destroyAll=function(){b._curFocus=null;b._prevFocus=null;b._activeStack=[];d.forEach(b.findWidgets(d.body()),function(h){if(!h._destroyed)if(h.destroyRecursive)h.destroyRecursive();else h.destroy&&h.destroy()})};d.isIE&&d.addOnWindowUnload(function(){b._destroyAll()});b.byNode=function(h){return a[h.getAttribute("widgetId")]};b.getEnclosingWidget=function(h){for(;h;){var l=
h.getAttribute&&h.getAttribute("widgetId");if(l)return a[l];h=h.parentNode}return null};var i=b._isElementShown=function(h){var l=f(h);return l.visibility!="hidden"&&l.visibility!="collapsed"&&l.display!="none"&&c(h,"type")!="hidden"};b.hasDefaultTabStop=function(h){switch(h.nodeName.toLowerCase()){case "a":return e(h,"href");case "area":case "button":case "input":case "object":case "select":case "textarea":return true;case "iframe":var l;try{var p=h.contentDocument;if("designMode"in p&&p.designMode==
"on")return true;l=p.body}catch(t){try{l=h.contentWindow.document.body}catch(r){return false}}return l.contentEditable=="true"||l.firstChild&&l.firstChild.contentEditable=="true";default:return h.contentEditable=="true"}};var j=b.isTabNavigable=function(h){return c(h,"disabled")?false:e(h,"tabIndex")?c(h,"tabIndex")>=0:b.hasDefaultTabStop(h)};b._getTabNavigable=function(h){function l(o){return o&&o.tagName.toLowerCase()=="input"&&o.type&&o.type.toLowerCase()=="radio"&&o.name&&o.name.toLowerCase()}
function p(o){return k[l(o)]||o}var t,r,s,v,z,y,k={},n=function(o){d.query("> *",o).forEach(function(m){if(!(d.isIE&&m.scopeName!=="HTML"||!i(m))){if(j(m)){var q=c(m,"tabIndex");if(!e(m,"tabIndex")||q==0){t||(t=m);r=m}else if(q>0){if(!s||q<v){v=q;s=m}if(!z||q>=y){y=q;z=m}}q=l(m);if(d.attr(m,"checked")&&q)k[q]=m}m.nodeName.toUpperCase()!="SELECT"&&n(m)}})};i(h)&&n(h);return{first:p(t),last:p(r),lowest:p(s),highest:p(z)}};b.getFirstInTabbingOrder=function(h){h=b._getTabNavigable(d.byId(h));return h.lowest?
h.lowest:h.first};b.getLastInTabbingOrder=function(h){h=b._getTabNavigable(d.byId(h));return h.last?h.last:h.highest};b.defaultDuration=d.config.defaultDuration||200})();return b});
define("dojo/Stateful",["dojo"],function(d){d.declare("dojo.Stateful",null,{postscript:function(b){b&&d.mixin(this,b)},get:function(b){return this[b]},set:function(b,a){if(typeof b==="object"){for(var c in b)this.set(c,b[c]);return this}c=this[b];this[b]=a;this._watchCallbacks&&this._watchCallbacks(b,c,a);return this},watch:function(b,a){var c=this._watchCallbacks;if(!c){var e=this;c=this._watchCallbacks=function(g,i,j,h){var l=function(p){if(p){p=p.slice();for(var t=0,r=p.length;t<r;t++)try{p[t].call(e,
g,i,j)}catch(s){console.error(s)}}};l(c["_"+g]);h||l(c["*"])}}if(!a&&typeof b==="function"){a=b;b="*"}else b="_"+b;var f=c[b];if(typeof f!=="object")f=c[b]=[];f.push(a);return{unwatch:function(){f.splice(d.indexOf(f,a),1)}}}});return d.Stateful});
define("dijit/_WidgetBase",["dojo","dijit","dijit/_base/manager","dojo/Stateful"],function(d,b){(function(){d.declare("dijit._WidgetBase",d.Stateful,{id:"",lang:"",dir:"","class":"",style:"",title:"",tooltip:"",baseClass:"",srcNodeRef:null,domNode:null,containerNode:null,attributeMap:{id:"",dir:"",lang:"","class":"",style:"",title:""},_blankGif:(d.config.blankGif||d.moduleUrl("dojo","resources/blank.gif")).toString(),postscript:function(a,c){this.create(a,c)},create:function(a,c){this.srcNodeRef=
d.byId(c);this._connects=[];this._subscribes=[];if(this.srcNodeRef&&typeof this.srcNodeRef.id=="string")this.id=this.srcNodeRef.id;if(a){this.params=a;d._mixin(this,a)}this.postMixInProperties();if(!this.id)this.id=b.getUniqueId(this.declaredClass.replace(/\./g,"_"));b.registry.add(this);this.buildRendering();if(this.domNode){this._applyAttributes();(a=this.srcNodeRef)&&a.parentNode&&this.domNode!==a&&a.parentNode.replaceChild(this.domNode,a)}this.domNode&&this.domNode.setAttribute("widgetId",this.id);
this.postCreate();this.srcNodeRef&&!this.srcNodeRef.parentNode&&delete this.srcNodeRef;this._created=true},_applyAttributes:function(){var a=function(e,f){if(f.params&&e in f.params||f[e])f.set(e,f[e])};for(var c in this.attributeMap)a(c,this);d.forEach(this._getSetterAttributes(),function(e){e in this.attributeMap||a(e,this)},this)},_getSetterAttributes:function(){var a=this.constructor;if(!a._setterAttrs){var c=a._setterAttrs=[],e,f=a.prototype;for(var g in f)if(d.isFunction(f[g])&&(e=g.match(/^_set([a-zA-Z]*)Attr$/))&&
e[1])c.push(e[1].charAt(0).toLowerCase()+e[1].substr(1))}return a._setterAttrs},postMixInProperties:function(){},buildRendering:function(){if(!this.domNode)this.domNode=this.srcNodeRef||d.create("div");if(this.baseClass){var a=this.baseClass.split(" ");this.isLeftToRight()||(a=a.concat(d.map(a,function(c){return c+"Rtl"})));d.addClass(this.domNode,a)}},postCreate:function(){},startup:function(){this._started=true},destroyRecursive:function(a){this._beingDestroyed=true;this.destroyDescendants(a);this.destroy(a)},
destroy:function(a){this._beingDestroyed=true;this.uninitialize();var c=d.forEach,e=d.unsubscribe;c(this._connects,function(f){c(f,d.disconnect)});c(this._subscribes,function(f){e(f)});c(this._supportingWidgets||[],function(f){if(f.destroyRecursive)f.destroyRecursive();else f.destroy&&f.destroy()});this.destroyRendering(a);b.registry.remove(this.id);this._destroyed=true},destroyRendering:function(a){if(this.bgIframe){this.bgIframe.destroy(a);delete this.bgIframe}if(this.domNode){a?d.removeAttr(this.domNode,
"widgetId"):d.destroy(this.domNode);delete this.domNode}if(this.srcNodeRef){a||d.destroy(this.srcNodeRef);delete this.srcNodeRef}},destroyDescendants:function(a){d.forEach(this.getChildren(),function(c){c.destroyRecursive&&c.destroyRecursive(a)})},uninitialize:function(){return false},_setClassAttr:function(a){d.replaceClass(this[this.attributeMap["class"]||"domNode"],a,this["class"]);this._set("class",a)},_setStyleAttr:function(a){var c=this[this.attributeMap.style||"domNode"];if(d.isObject(a))d.style(c,
a);else if(c.style.cssText)c.style.cssText+="; "+a;else c.style.cssText=a;this._set("style",a)},_attrToDom:function(a,c){var e=this.attributeMap[a];d.forEach(d.isArray(e)?e:[e],function(f){var g=this[f.node||f||"domNode"];switch(f.type||"attribute"){case "attribute":if(d.isFunction(c))c=d.hitch(this,c);f=f.attribute?f.attribute:/^on[A-Z][a-zA-Z]*$/.test(a)?a.toLowerCase():a;d.attr(g,f,c);break;case "innerText":g.innerHTML="";g.appendChild(d.doc.createTextNode(c));break;case "innerHTML":g.innerHTML=
c;break;case "class":d.replaceClass(g,c,this[a]);break}},this)},get:function(a){var c=this._getAttrNames(a);return this[c.g]?this[c.g]():this[a]},set:function(a,c){if(typeof a==="object"){for(var e in a)this.set(e,a[e]);return this}e=this._getAttrNames(a);if(this[e.s])var f=this[e.s].apply(this,Array.prototype.slice.call(arguments,1));else{a in this.attributeMap&&this._attrToDom(a,c);this._set(a,c)}return f||this},_attrPairNames:{},_getAttrNames:function(a){var c=this._attrPairNames;if(c[a])return c[a];
var e=a.charAt(0).toUpperCase()+a.substr(1);return c[a]={n:a+"Node",s:"_set"+e+"Attr",g:"_get"+e+"Attr"}},_set:function(a,c){var e=this[a];this[a]=c;this._watchCallbacks&&this._created&&c!==e&&this._watchCallbacks(a,e,c)},toString:function(){return"[Widget "+this.declaredClass+", "+(this.id||"NO ID")+"]"},getDescendants:function(){return this.containerNode?d.query("[widgetId]",this.containerNode).map(b.byNode):[]},getChildren:function(){return this.containerNode?b.findWidgets(this.containerNode):
[]},connect:function(a,c,e){a=[d._connect(a,c,this,e)];this._connects.push(a);return a},disconnect:function(a){for(var c=0;c<this._connects.length;c++)if(this._connects[c]==a){d.forEach(a,d.disconnect);this._connects.splice(c,1);return}},subscribe:function(a,c){a=d.subscribe(a,this,c);this._subscribes.push(a);return a},unsubscribe:function(a){for(var c=0;c<this._subscribes.length;c++)if(this._subscribes[c]==a){d.unsubscribe(a);this._subscribes.splice(c,1);return}},isLeftToRight:function(){return this.dir?
this.dir=="ltr":d._isBodyLtr()},placeAt:function(a,c){a.declaredClass&&a.addChild?a.addChild(this,c):d.place(this.domNode,a,c);return this}})})();return b._WidgetBase});
define("dijit/_base/focus",["dojo","dijit","dojo/window","dijit/_base/manager"],function(d,b){d.mixin(b,{_curFocus:null,_prevFocus:null,isCollapsed:function(){return b.getBookmark().isCollapsed},getBookmark:function(){var a,c,e=d.doc.selection,f=b._curFocus;if(d.global.getSelection){if(e=d.global.getSelection())if(e.isCollapsed){if(a=f?f.tagName:""){a=a.toLowerCase();if(a=="textarea"||a=="input"&&(!f.type||f.type.toLowerCase()=="text")){e={start:f.selectionStart,end:f.selectionEnd,node:f,pRange:true};
return{isCollapsed:e.end<=e.start,mark:e}}}a={isCollapsed:true};if(e.rangeCount)a.mark=e.getRangeAt(0).cloneRange()}else{c=e.getRangeAt(0);a={isCollapsed:false,mark:c.cloneRange()}}}else if(e){a=f?f.tagName:"";a=a.toLowerCase();if(f&&a&&(a=="button"||a=="textarea"||a=="input"))if(e.type&&e.type.toLowerCase()=="none")return{isCollapsed:true,mark:null};else{c=e.createRange();return{isCollapsed:c.text&&c.text.length?false:true,mark:{range:c,pRange:true}}}a={};try{c=e.createRange();a.isCollapsed=!(e.type==
"Text"?c.htmlText.length:c.length)}catch(g){a.isCollapsed=true;return a}if(e.type.toUpperCase()=="CONTROL")if(c.length){a.mark=[];e=0;for(f=c.length;e<f;)a.mark.push(c.item(e++))}else{a.isCollapsed=true;a.mark=null}else a.mark=c.getBookmark()}else console.warn("No idea how to store the current selection for this browser!");return a},moveToBookmark:function(a){var c=d.doc;if(a=a.mark)if(d.global.getSelection){var e=d.global.getSelection();if(e&&e.removeAllRanges)if(a.pRange){e=a.node;e.selectionStart=
a.start;e.selectionEnd=a.end}else{e.removeAllRanges();e.addRange(a)}else console.warn("No idea how to restore selection for this browser!")}else if(c.selection&&a){var f;if(a.pRange)f=a.range;else if(d.isArray(a)){f=c.body.createControlRange();d.forEach(a,function(g){f.addElement(g)})}else{f=c.body.createTextRange();f.moveToBookmark(a)}f.select()}},getFocus:function(a,c){a=!b._curFocus||a&&d.isDescendant(b._curFocus,a.domNode)?b._prevFocus:b._curFocus;return{node:a,bookmark:a==b._curFocus&&d.withGlobal(c||
d.global,b.getBookmark),openedForWindow:c}},focus:function(a){if(a){var c="node"in a?a.node:a,e=a.bookmark;a=a.openedForWindow;var f=e?e.isCollapsed:false;if(c){var g=c.tagName.toLowerCase()=="iframe"?c.contentWindow:c;if(g&&g.focus)try{g.focus()}catch(i){}b._onFocusNode(c)}if(e&&d.withGlobal(a||d.global,b.isCollapsed)&&!f){a&&a.focus();try{d.withGlobal(a||d.global,b.moveToBookmark,null,[e])}catch(j){}}}},_activeStack:[],registerIframe:function(a){return b.registerWin(a.contentWindow,a)},unregisterIframe:function(a){b.unregisterWin(a)},
registerWin:function(a,c){var e=function(l){b._justMouseDowned=true;setTimeout(function(){b._justMouseDowned=false},0);d.isIE&&l&&l.srcElement&&l.srcElement.parentNode==null||b._onTouchNode(c||l.target||l.srcElement,"mouse")},f=d.isIE?a.document.documentElement:a.document;if(f)if(d.isIE){a.document.body.attachEvent("onmousedown",e);var g=function(l){l.srcElement.tagName.toLowerCase()!="#document"&&b.isTabNavigable(l.srcElement)?b._onFocusNode(c||l.srcElement):b._onTouchNode(c||l.srcElement)};f.attachEvent("onactivate",
g);var i=function(l){b._onBlurNode(c||l.srcElement)};f.attachEvent("ondeactivate",i);return function(){a.document.detachEvent("onmousedown",e);f.detachEvent("onactivate",g);f.detachEvent("ondeactivate",i);f=null}}else{f.body.addEventListener("mousedown",e,true);var j=function(l){b._onFocusNode(c||l.target)};f.addEventListener("focus",j,true);var h=function(l){b._onBlurNode(c||l.target)};f.addEventListener("blur",h,true);return function(){f.body.removeEventListener("mousedown",e,true);f.removeEventListener("focus",
j,true);f.removeEventListener("blur",h,true);f=null}}},unregisterWin:function(a){a&&a()},_onBlurNode:function(){b._prevFocus=b._curFocus;b._curFocus=null;if(!b._justMouseDowned){b._clearActiveWidgetsTimer&&clearTimeout(b._clearActiveWidgetsTimer);b._clearActiveWidgetsTimer=setTimeout(function(){delete b._clearActiveWidgetsTimer;b._setStack([]);b._prevFocus=null},100)}},_onTouchNode:function(a,c){if(b._clearActiveWidgetsTimer){clearTimeout(b._clearActiveWidgetsTimer);delete b._clearActiveWidgetsTimer}var e=
[];try{for(;a;){var f=d.attr(a,"dijitPopupParent");if(f)a=b.byId(f).domNode;else if(a.tagName&&a.tagName.toLowerCase()=="body"){if(a===d.body())break;a=d.window.get(a.ownerDocument).frameElement}else{var g=a.getAttribute&&a.getAttribute("widgetId"),i=g&&b.byId(g);i&&!(c=="mouse"&&i.get("disabled"))&&e.unshift(g);a=a.parentNode}}}catch(j){}b._setStack(e,c)},_onFocusNode:function(a){if(a)if(a.nodeType!=9){b._onTouchNode(a);if(a!=b._curFocus){if(b._curFocus)b._prevFocus=b._curFocus;b._curFocus=a;d.publish("focusNode",
[a])}}},_setStack:function(a,c){var e=b._activeStack;b._activeStack=a;for(var f=0;f<Math.min(e.length,a.length);f++)if(e[f]!=a[f])break;for(var g,i=e.length-1;i>=f;i--)if(g=b.byId(e[i])){g._focused=false;g.set("focused",false);g._hasBeenBlurred=true;g._onBlur&&g._onBlur(c);d.publish("widgetBlur",[g,c])}for(i=f;i<a.length;i++)if(g=b.byId(a[i])){g._focused=true;g.set("focused",true);g._onFocus&&g._onFocus(c);d.publish("widgetFocus",[g,c])}}});d.addOnLoad(function(){var a=b.registerWin(window);d.isIE&&
d.addOnWindowUnload(function(){b.unregisterWin(a);a=null})});return b});
define("dojo/AdapterRegistry",["dojo"],function(d){d.AdapterRegistry=function(b){this.pairs=[];this.returnWrappers=b||false};d.extend(d.AdapterRegistry,{register:function(b,a,c,e,f){this.pairs[f?"unshift":"push"]([b,a,c,e])},match:function(){for(var b=0;b<this.pairs.length;b++){var a=this.pairs[b];if(a[1].apply(this,arguments))return a[3]||this.returnWrappers?a[2]:a[2].apply(this,arguments)}throw new Error("No match found");},unregister:function(b){for(var a=0;a<this.pairs.length;a++)if(this.pairs[a][0]==
b){this.pairs.splice(a,1);return true}return false}});return d.AdapterRegistry});
define("dijit/_base/place",["dojo","dijit","dojo/window","dojo/AdapterRegistry"],function(d,b){b.getViewport=function(){return d.window.getBox()};b.placeOnScreen=function(a,c,e,f){e=d.map(e,function(g){var i={corner:g,pos:{x:c.x,y:c.y}};if(f){i.pos.x+=g.charAt(1)=="L"?f.x:-f.x;i.pos.y+=g.charAt(0)=="T"?f.y:-f.y}return i});return b._place(a,e)};b._place=function(a,c,e,f){var g=d.window.getBox();if(!a.parentNode||String(a.parentNode.tagName).toLowerCase()!="body")d.body().appendChild(a);var i=null;
d.some(c,function(h){var l=h.corner,p=h.pos,t=0,r={w:l.charAt(1)=="L"?g.l+g.w-p.x:p.x-g.l,h:l.charAt(1)=="T"?g.t+g.h-p.y:p.y-g.t};if(e){t=e(a,h.aroundCorner,l,r,f);t=typeof t=="undefined"?0:t}var s=a.style,v=s.display,z=s.visibility;s.visibility="hidden";s.display="";var y=d.marginBox(a);s.display=v;s.visibility=z;s=Math.max(g.l,l.charAt(1)=="L"?p.x:p.x-y.w);v=Math.max(g.t,l.charAt(0)=="T"?p.y:p.y-y.h);z=Math.min(g.l+g.w,l.charAt(1)=="L"?s+y.w:p.x);p=Math.min(g.t+g.h,l.charAt(0)=="T"?v+y.h:p.y);z=
z-s;p=p-v;t+=y.w-z+(y.h-p);if(i==null||t<i.overflow)i={corner:l,aroundCorner:h.aroundCorner,x:s,y:v,w:z,h:p,overflow:t,spaceAvailable:r};return!t});i.overflow&&e&&e(a,i.aroundCorner,i.corner,i.spaceAvailable,f);c=d._isBodyLtr();var j=a.style;j.top=i.y+"px";j[c?"left":"right"]=(c?i.x:g.w-i.x-i.w)+"px";return i};b.placeOnScreenAroundNode=function(a,c,e,f){c=d.byId(c);c=d.position(c,true);return b._placeOnScreenAroundRect(a,c.x,c.y,c.w,c.h,e,f)};b.placeOnScreenAroundRectangle=function(a,c,e,f){return b._placeOnScreenAroundRect(a,
c.x,c.y,c.width,c.height,e,f)};b._placeOnScreenAroundRect=function(a,c,e,f,g,i,j){var h=[];for(var l in i)h.push({aroundCorner:l,corner:i[l],pos:{x:c+(l.charAt(1)=="L"?0:f),y:e+(l.charAt(0)=="T"?0:g)}});return b._place(a,h,j,{w:f,h:g})};b.placementRegistry=new d.AdapterRegistry;b.placementRegistry.register("node",function(a,c){return typeof c=="object"&&typeof c.offsetWidth!="undefined"&&typeof c.offsetHeight!="undefined"},b.placeOnScreenAroundNode);b.placementRegistry.register("rect",function(a,
c){return typeof c=="object"&&"x"in c&&"y"in c&&"width"in c&&"height"in c},b.placeOnScreenAroundRectangle);b.placeOnScreenAroundElement=function(){return b.placementRegistry.match.apply(b.placementRegistry,arguments)};b.getPopupAroundAlignment=function(a,c){var e={};d.forEach(a,function(f){switch(f){case "after":e[c?"BR":"BL"]=c?"BL":"BR";break;case "before":e[c?"BL":"BR"]=c?"BR":"BL";break;case "below-alt":c=!c;case "below":e[c?"BL":"BR"]=c?"TL":"TR";e[c?"BR":"BL"]=c?"TR":"TL";break;case "above-alt":c=
!c;case "above":default:e[c?"TL":"TR"]=c?"BL":"BR";e[c?"TR":"TL"]=c?"BR":"BL";break}});return e};return b});define("dijit/_base/window",["dojo","dijit","dojo/window"],function(d,b){b.getDocumentWindow=function(a){return d.window.get(a)};return b});
define("dijit/_base/popup",["dojo","dijit","dijit/_base/focus","dijit/_base/place","dijit/_base/window"],function(d,b){b.popup={_stack:[],_beginZIndex:1E3,_idGen:1,_createWrapper:function(a){var c=a.declaredClass?a._popupWrapper:a.parentNode&&d.hasClass(a.parentNode,"dijitPopup"),e=a.domNode||a;if(!c){c=d.create("div",{"class":"dijitPopup",style:{display:"none"},role:"presentation"},d.body());c.appendChild(e);e=e.style;e.display="";e.visibility="";e.position="";e.top="0px";if(a.declaredClass){a._popupWrapper=
c;d.connect(a,"destroy",function(){d.destroy(c);delete a._popupWrapper})}}return c},moveOffScreen:function(a){a=this._createWrapper(a);d.style(a,{visibility:"hidden",top:"-9999px",display:""})},hide:function(a){a=this._createWrapper(a);d.style(a,"display","none")},getTopPopup:function(){for(var a=this._stack,c=a.length-1;c>0&&a[c].parent===a[c-1].widget;c--);return a[c]},open:function(a){for(var c=this._stack,e=a.popup,f=a.orient||((a.parent?a.parent.isLeftToRight():d._isBodyLtr())?{BL:"TL",BR:"TR",
TL:"BL",TR:"BR"}:{BR:"TR",BL:"TL",TR:"BR",TL:"BL"}),g=a.around,i=a.around&&a.around.id?a.around.id+"_dropdown":"popup_"+this._idGen++;c.length&&(!a.parent||!d.isDescendant(a.parent.domNode,c[c.length-1].widget.domNode));)b.popup.close(c[c.length-1].widget);var j=this._createWrapper(e);d.attr(j,{id:i,style:{zIndex:this._beginZIndex+c.length},"class":"dijitPopup "+(e.baseClass||e["class"]||"").split(" ")[0]+"Popup",dijitPopupParent:a.parent?a.parent.id:""});if(d.isIE||d.isMoz)if(!e.bgIframe)e.bgIframe=
new b.BackgroundIframe(j);f=g?b.placeOnScreenAroundElement(j,g,f,e.orient?d.hitch(e,"orient"):null):b.placeOnScreen(j,a,f=="R"?["TR","BR","TL","BL"]:["TL","BL","TR","BR"],a.padding);j.style.display="";j.style.visibility="visible";e.domNode.style.visibility="visible";g=[];g.push(d.connect(j,"onkeypress",this,function(h){if(h.charOrCode==d.keys.ESCAPE&&a.onCancel){d.stopEvent(h);a.onCancel()}else if(h.charOrCode===d.keys.TAB){d.stopEvent(h);(h=this.getTopPopup())&&h.onCancel&&h.onCancel()}}));e.onCancel&&
g.push(d.connect(e,"onCancel",a.onCancel));g.push(d.connect(e,e.onExecute?"onExecute":"onChange",this,function(){var h=this.getTopPopup();h&&h.onExecute&&h.onExecute()}));c.push({widget:e,parent:a.parent,onExecute:a.onExecute,onCancel:a.onCancel,onClose:a.onClose,handlers:g});e.onOpen&&e.onOpen(f);return f},close:function(a){for(var c=this._stack;a&&d.some(c,function(i){return i.widget==a})||!a&&c.length;){var e=c.pop(),f=e.widget,g=e.onClose;f.onClose&&f.onClose();d.forEach(e.handlers,d.disconnect);
f&&f.domNode&&this.hide(f);g&&g()}}};b._frames=new (function(){var a=[];this.pop=function(){var c;if(a.length){c=a.pop();c.style.display=""}else{if(d.isIE<9){c="<iframe src='"+(d.config.dojoBlankHtmlUrl||d.moduleUrl("dojo","resources/blank.html")+""||'javascript:""')+"' style='position: absolute; left: 0px; top: 0px;z-index: -1; filter:Alpha(Opacity=\"0\");'>";c=d.doc.createElement(c)}else{c=d.create("iframe");c.src='javascript:""';c.className="dijitBackgroundIframe";d.style(c,"opacity",0.1)}c.tabIndex=
-1;b.setWaiRole(c,"presentation")}return c};this.push=function(c){c.style.display="none";a.push(c)}});b.BackgroundIframe=function(a){if(!a.id)throw new Error("no id");if(d.isIE||d.isMoz){var c=this.iframe=b._frames.pop();a.appendChild(c);if(d.isIE<7||d.isQuirks){this.resize(a);this._conn=d.connect(a,"onresize",this,function(){this.resize(a)})}else d.style(c,{width:"100%",height:"100%"})}};d.extend(b.BackgroundIframe,{resize:function(a){this.iframe&&d.style(this.iframe,{width:a.offsetWidth+"px",height:a.offsetHeight+
"px"})},destroy:function(){if(this._conn){d.disconnect(this._conn);this._conn=null}if(this.iframe){b._frames.push(this.iframe);delete this.iframe}}});return b.popup});define("dijit/_base/scroll",["dojo","dijit","dojo/window"],function(d,b){b.scrollIntoView=function(a,c){d.window.scrollIntoView(a,c)};return b.scrollIntoView});
define("dojo/uacss",["dojo"],function(d){(function(){var b=d.doc.documentElement,a=d.isIE,c=d.isOpera,e=Math.floor,f=d.isFF,g=d.boxModel.replace(/-/,"");a={dj_ie:a,dj_ie6:e(a)==6,dj_ie7:e(a)==7,dj_ie8:e(a)==8,dj_ie9:e(a)==9,dj_quirks:d.isQuirks,dj_iequirks:a&&d.isQuirks,dj_opera:c,dj_khtml:d.isKhtml,dj_webkit:d.isWebKit,dj_safari:d.isSafari,dj_chrome:d.isChrome,dj_gecko:d.isMozilla,dj_ff3:e(f)==3};a["dj_"+g]=true;var i="";for(var j in a)if(a[j])i+=j+" ";b.className=d.trim(b.className+" "+i);d._loaders.unshift(function(){if(!d._isBodyLtr()){var h=
"dj_rtl dijitRtl "+i.replace(/ /g,"-rtl ");b.className=d.trim(b.className+" "+h)}})})();return d});define("dijit/_base/sniff",["dojo","dijit","dojo/uacss"],function(d,b){return b});
define("dijit/_base/typematic",["dojo","dijit"],function(d,b){b.typematic={_fireEventAndReload:function(){this._timer=null;this._callback(++this._count,this._node,this._evt);this._currentTimeout=Math.max(this._currentTimeout<0?this._initialDelay:this._subsequentDelay>1?this._subsequentDelay:Math.round(this._currentTimeout*this._subsequentDelay),this._minDelay);this._timer=setTimeout(d.hitch(this,"_fireEventAndReload"),this._currentTimeout)},trigger:function(a,c,e,f,g,i,j,h){if(g!=this._obj){this.stop();
this._initialDelay=j||500;this._subsequentDelay=i||0.9;this._minDelay=h||10;this._obj=g;this._evt=a;this._node=e;this._count=this._currentTimeout=-1;this._callback=d.hitch(c,f);this._fireEventAndReload();this._evt=d.mixin({faux:true},a)}},stop:function(){if(this._timer){clearTimeout(this._timer);this._timer=null}if(this._obj){this._callback(-1,this._node,this._evt);this._obj=null}},addKeyListener:function(a,c,e,f,g,i,j){if(c.keyCode){c.charOrCode=c.keyCode;d.deprecated("keyCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.",
"","2.0")}else if(c.charCode){c.charOrCode=String.fromCharCode(c.charCode);d.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0")}return[d.connect(a,"onkeypress",this,function(h){if(h.charOrCode==c.charOrCode&&(c.ctrlKey===undefined||c.ctrlKey==h.ctrlKey)&&(c.altKey===undefined||c.altKey==h.altKey)&&(c.metaKey===undefined||c.metaKey==(h.metaKey||false))&&(c.shiftKey===undefined||c.shiftKey==h.shiftKey)){d.stopEvent(h);b.typematic.trigger(h,
e,a,f,c,g,i,j)}else b.typematic._obj==c&&b.typematic.stop()}),d.connect(a,"onkeyup",this,function(){b.typematic._obj==c&&b.typematic.stop()})]},addMouseListener:function(a,c,e,f,g,i){var j=d.connect;return[j(a,"mousedown",this,function(h){d.stopEvent(h);b.typematic.trigger(h,c,a,e,a,f,g,i)}),j(a,"mouseup",this,function(h){d.stopEvent(h);b.typematic.stop()}),j(a,"mouseout",this,function(h){d.stopEvent(h);b.typematic.stop()}),j(a,"mousemove",this,function(h){h.preventDefault()}),j(a,"dblclick",this,
function(h){d.stopEvent(h);if(d.isIE){b.typematic.trigger(h,c,a,e,a,f,g,i);setTimeout(d.hitch(this,b.typematic.stop),50)}})]},addListener:function(a,c,e,f,g,i,j,h){return this.addKeyListener(c,e,f,g,i,j,h).concat(this.addMouseListener(a,f,g,i,j,h))}};return b.typematic});
define("dijit/_base/wai",["dojo","dijit"],function(d,b){b.wai={onload:function(){var a=d.create("div",{id:"a11yTestNode",style:{cssText:'border: 1px solid;border-color:red green;position: absolute;height: 5px;top: -999px;background-image: url("'+(d.config.blankGif||d.moduleUrl("dojo","resources/blank.gif"))+'");'}},d.body()),c=d.getComputedStyle(a);if(c){var e=c.backgroundImage;d[c.borderTopColor==c.borderRightColor||e!=null&&(e=="none"||e=="url(invalid-url:)")?"addClass":"removeClass"](d.body(),
"dijit_a11y");if(d.isIE)a.outerHTML="";else d.body().removeChild(a)}}};if(d.isIE||d.isMoz)d._loaders.unshift(b.wai.onload);d.mixin(b,{hasWaiRole:function(a,c){a=this.getWaiRole(a);return c?a.indexOf(c)>-1:a.length>0},getWaiRole:function(a){return d.trim((d.attr(a,"role")||"").replace("wairole:",""))},setWaiRole:function(a,c){d.attr(a,"role",c)},removeWaiRole:function(a,c){var e=d.attr(a,"role");if(e)if(c){c=d.trim((" "+e+" ").replace(" "+c+" "," "));d.attr(a,"role",c)}else a.removeAttribute("role")},
hasWaiState:function(a,c){return a.hasAttribute?a.hasAttribute("aria-"+c):!!a.getAttribute("aria-"+c)},getWaiState:function(a,c){return a.getAttribute("aria-"+c)||""},setWaiState:function(a,c,e){a.setAttribute("aria-"+c,e)},removeWaiState:function(a,c){a.removeAttribute("aria-"+c)}});return b});
define("dijit/_base",["dojo","dijit","dijit/_base/focus","dijit/_base/manager","dijit/_base/place","dijit/_base/popup","dijit/_base/scroll","dijit/_base/sniff","dijit/_base/typematic","dijit/_base/wai","dijit/_base/window"],function(d,b){return b._base});
define("dijit/_Widget",["dojo","dijit","dijit/_WidgetBase","dijit/_base"],function(d,b){d.connect(d,"_connect",function(a,c){a&&d.isFunction(a._onConnect)&&a._onConnect(c)});b._connectOnUseEventHandler=function(){};b._lastKeyDownNode=null;d.isIE?function(){var a=function(c){b._lastKeyDownNode=c.srcElement};d.doc.attachEvent("onkeydown",a);d.addOnWindowUnload(function(){d.doc.detachEvent("onkeydown",a)})}():d.doc.addEventListener("keydown",function(a){b._lastKeyDownNode=a.target},true);(function(){d.declare("dijit._Widget",
b._WidgetBase,{_deferredConnects:{onClick:"",onDblClick:"",onKeyDown:"",onKeyPress:"",onKeyUp:"",onMouseMove:"",onMouseDown:"",onMouseOut:"",onMouseOver:"",onMouseLeave:"",onMouseEnter:"",onMouseUp:""},onClick:b._connectOnUseEventHandler,onDblClick:b._connectOnUseEventHandler,onKeyDown:b._connectOnUseEventHandler,onKeyPress:b._connectOnUseEventHandler,onKeyUp:b._connectOnUseEventHandler,onMouseDown:b._connectOnUseEventHandler,onMouseMove:b._connectOnUseEventHandler,onMouseOut:b._connectOnUseEventHandler,
onMouseOver:b._connectOnUseEventHandler,onMouseLeave:b._connectOnUseEventHandler,onMouseEnter:b._connectOnUseEventHandler,onMouseUp:b._connectOnUseEventHandler,create:function(){this._deferredConnects=d.clone(this._deferredConnects);for(var a in this.attributeMap)delete this._deferredConnects[a];for(a in this._deferredConnects)this[a]!==b._connectOnUseEventHandler&&delete this._deferredConnects[a];this.inherited(arguments);if(this.domNode)for(a in this.params)this._onConnect(a)},_onConnect:function(a){if(a in
this._deferredConnects){this.connect(this[this._deferredConnects[a]||"domNode"],a.toLowerCase(),a);delete this._deferredConnects[a]}},focused:false,isFocusable:function(){return this.focus&&d.style(this.domNode,"display")!="none"},onFocus:function(){},onBlur:function(){},_onFocus:function(){this.onFocus()},_onBlur:function(){this.onBlur()},setAttribute:function(a,c){d.deprecated(this.declaredClass+"::setAttribute(attr, value) is deprecated. Use set() instead.","","2.0");this.set(a,c)},attr:function(a){if(d.config.isDebug){var c=
arguments.callee._ach||(arguments.callee._ach={}),e=(arguments.callee.caller||"unknown caller").toString();if(!c[e]){d.deprecated(this.declaredClass+"::attr() is deprecated. Use get() or set() instead, called from "+e,"","2.0");c[e]=true}}return arguments.length>=2||typeof a==="object"?this.set.apply(this,arguments):this.get(a)},nodesWithKeyClick:["input","button"],connect:function(a,c,e){var f=d._connect,g=this.inherited(arguments,[a,c=="ondijitclick"?"onclick":c,e]);if(c=="ondijitclick")if(d.indexOf(this.nodesWithKeyClick,
a.nodeName.toLowerCase())==-1){var i=d.hitch(this,e);g.push(f(a,"onkeydown",this,function(j){if((j.keyCode==d.keys.ENTER||j.keyCode==d.keys.SPACE)&&!j.ctrlKey&&!j.shiftKey&&!j.altKey&&!j.metaKey){b._lastKeyDownNode=j.target;"openDropDown"in this&&a==this._buttonNode||j.preventDefault()}}),f(a,"onkeyup",this,function(j){if((j.keyCode==d.keys.ENTER||j.keyCode==d.keys.SPACE)&&j.target==b._lastKeyDownNode&&!j.ctrlKey&&!j.shiftKey&&!j.altKey&&!j.metaKey){b._lastKeyDownNode=null;return i(j)}}))}return g},
_onShow:function(){this.onShow()},onShow:function(){},onHide:function(){},onClose:function(){return true}})})();return b._Widget});
define("dojo/string",["dojo"],function(d){d.getObject("string",true,d);d.string.rep=function(b,a){if(a<=0||!b)return"";for(var c=[];;){a&1&&c.push(b);if(!(a>>=1))break;b+=b}return c.join("")};d.string.pad=function(b,a,c,e){c||(c="0");b=String(b);a=d.string.rep(c,Math.ceil((a-b.length)/c.length));return e?b+a:a+b};d.string.substitute=function(b,a,c,e){e=e||d.global;c=c?d.hitch(e,c):function(f){return f};return b.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g,function(f,g,i){f=d.getObject(g,false,
a);if(i)f=d.getObject(i,false,e).call(e,f,g);return c(f,g).toString()})};d.string.trim=String.prototype.trim?d.trim:function(b){b=b.replace(/^\s+/,"");for(var a=b.length-1;a>=0;a--)if(/\S/.test(b.charAt(a))){b=b.substring(0,a+1);break}return b};return d.string});
define("dojo/date/stamp",["dojo"],function(d){d.getObject("date.stamp",true,d);d.date.stamp.fromISOString=function(b,a){if(!d.date.stamp._isoRegExp)d.date.stamp._isoRegExp=/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/;var c=d.date.stamp._isoRegExp.exec(b);b=null;if(c){c.shift();c[1]&&c[1]--;if(c[6])c[6]*=1E3;if(a){a=new Date(a);d.forEach(d.map(["FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds"],function(g){return a["get"+
g]()}),function(g,i){c[i]=c[i]||g})}b=new Date(c[0]||1970,c[1]||0,c[2]||1,c[3]||0,c[4]||0,c[5]||0,c[6]||0);if(c[0]<100)b.setFullYear(c[0]||1970);var e=0,f=c[7]&&c[7].charAt(0);if(f!="Z"){e=(c[8]||0)*60+(Number(c[9])||0);if(f!="-")e*=-1}if(f)e-=b.getTimezoneOffset();e&&b.setTime(b.getTime()+e*6E4)}return b};d.date.stamp.toISOString=function(b,a){var c=function(i){return i<10?"0"+i:i};a=a||{};var e=[],f=a.zulu?"getUTC":"get",g="";if(a.selector!="time"){g=b[f+"FullYear"]();g=["0000".substr((g+"").length)+
g,c(b[f+"Month"]()+1),c(b[f+"Date"]())].join("-")}e.push(g);if(a.selector!="date"){g=[c(b[f+"Hours"]()),c(b[f+"Minutes"]()),c(b[f+"Seconds"]())].join(":");f=b[f+"Milliseconds"]();if(a.milliseconds)g+="."+(f<100?"0":"")+c(f);if(a.zulu)g+="Z";else if(a.selector!="time"){b=b.getTimezoneOffset();a=Math.abs(b);g+=(b>0?"-":"+")+c(Math.floor(a/60))+":"+c(a%60)}e.push(g)}return e.join("T")};return d.date.stamp});
define("dojo/parser",["dojo","dojo/date/stamp"],function(d){d.parser=new (function(){function b(j){if(f.isString(j))return"string";if(typeof j=="number")return"number";if(typeof j=="boolean")return"boolean";if(f.isFunction(j))return"function";if(f.isArray(j))return"array";if(j instanceof Date)return"date";if(j instanceof f._Url)return"url";return"object"}function a(j,h){switch(h){case "string":return j;case "number":return j.length?Number(j):NaN;case "boolean":return typeof j=="boolean"?j:j.toLowerCase()!=
"false";case "function":if(f.isFunction(j)){j=j.toString();j=f.trim(j.substring(j.indexOf("{")+1,j.length-1))}try{return j===""||j.search(/[^\w\.]+/i)!=-1?new Function(j):f.getObject(j,false)||new Function(j)}catch(l){return new Function}case "array":return j?j.split(/\s*,\s*/):[];case "date":switch(j){case "":return new Date("");case "now":return new Date;default:return f.date.stamp.fromISOString(j)}case "url":return f.baseUrl+j;default:return f.fromJson(j)}}function c(j,h){for(var l in j)if(l.charAt(0)!=
"_")l in g||(h[l]=b(j[l]));return h}function e(j,h){var l=i[j];if(l){if(!h&&!l.params)l.params=c(l.cls.prototype,{})}else{j=f.getObject(j);l=null;if(!j)return null;h||(l=c(j.prototype,{}));l={cls:j,params:l}}return l}var f=d,g={},i={};f.connect(f,"extend",function(){i={}});this._functionFromScript=function(j,h){var l="",p="";(h=j.getAttribute(h+"args")||j.getAttribute("args"))&&f.forEach(h.split(/\s*,\s*/),function(t,r){l+="var "+t+" = arguments["+r+"]; "});(h=j.getAttribute("with"))&&h.length&&f.forEach(h.split(/\s*,\s*/),
function(t){l+="with("+t+"){";p+="}"});return new Function(l+j.innerHTML+p)};this.instantiate=function(j,h,l){var p=[];h=h||{};l=l||{};var t=(l.scope||f._scopeName)+"Type",r="data-"+(l.scope||f._scopeName)+"-";f.forEach(j,function(s){if(s){var v,z,y,k,n,o;if(s.node){v=s.node;z=s.type;o=s.fastpath;k=(y=s.clsInfo||z&&e(z,o))&&y.cls;n=s.scripts}else{v=s;n=(k=(y=(z=t in h?h[t]:v.getAttribute(t))&&e(z))&&y.cls)&&(k._noScript||k.prototype._noScript)?[]:f.query("> script[type^='dojo/']",v)}if(!y)throw new Error("Could not load class '"+
z);var m={};l.defaults&&f._mixin(m,l.defaults);s.inherited&&f._mixin(m,s.inherited);if(o){if((y=v.getAttribute(r+"props"))&&y.length)try{y=f.fromJson.call(l.propsThis,"{"+y+"}");f._mixin(m,y)}catch(q){throw new Error(q.toString()+" in data-dojo-props='"+y+"'");}if(y=v.getAttribute(r+"attach-point"))m.dojoAttachPoint=y;if(y=v.getAttribute(r+"attach-event"))m.dojoAttachEvent=y;d.mixin(m,h)}else{s=v.attributes;for(var w in y.params){z=w in h?{value:h[w],specified:true}:s.getNamedItem(w);if(!(!z||!z.specified&&
(!d.isIE||w.toLowerCase()!="value"))){z=z.value;switch(w){case "class":z="className"in h?h.className:v.className;break;case "style":z="style"in h?h.style:v.style&&v.style.cssText}var u=y.params[w];m[w]=typeof z=="string"?a(z,u):z}}}var x=[],B=[];f.forEach(n,function(D){v.removeChild(D);var F=D.getAttribute(r+"event")||D.getAttribute("event"),J=D.getAttribute("type");D=f.parser._functionFromScript(D,r);if(F)if(J=="dojo/connect")x.push({event:F,func:D});else m[F]=D;else B.push(D)});var C=(n=k.markupFactory||
k.prototype&&k.prototype.markupFactory)?n(m,v,k):new k(m,v);p.push(C);(k=v.getAttribute(r+"id")||v.getAttribute("jsId"))&&f.setObject(k,C);f.forEach(x,function(D){f.connect(C,D.event,null,D.func)});f.forEach(B,function(D){D.call(C)})}});h._started||f.forEach(p,function(s){if(!l.noStart&&s&&d.isFunction(s.startup)&&!s._started&&(!s.getParent||!s.getParent()))s.startup()});return p};this.parse=function(j,h){function l(v,z){var y=d.clone(v.inherited);d.forEach(["dir","lang"],function(w){var u=v.node.getAttribute(w);
if(u)y[w]=u});for(var k=v.clsInfo&&!v.clsInfo.cls.prototype._noScript?v.scripts:null,n=!v.clsInfo||!v.clsInfo.cls.prototype.stopParser||h&&h.template,o=v.node.firstChild;o;o=o.nextSibling)if(o.nodeType==1){var m,q=n&&o.getAttribute(t+"type");m=q?q:n&&o.getAttribute(p);q=q==m;if(m){m={type:m,fastpath:q,clsInfo:e(m,q),node:o,scripts:[],inherited:y};z.push(m);l(m,z)}else if(k&&o.nodeName.toLowerCase()=="script")(m=o.getAttribute("type"))&&/^dojo\/\w/i.test(m)&&k.push(o);else n&&l({node:o,inherited:y},
z)}}if(!h&&j&&j.rootNode){h=j;j=h.rootNode}else j=j;j=j?d.byId(j):d.body();h=h||{};var p=(h.scope||f._scopeName)+"Type",t="data-"+(h.scope||f._scopeName)+"-",r={};if(h&&h.inherited)for(var s in h.inherited)if(h.inherited[s])r[s]=h.inherited[s];s=[];l({node:j,inherited:r},s);return this.instantiate(s,h&&h.template?{template:true}:null,h)}});(function(){var b=function(){d.config.parseOnLoad&&d.parser.parse()};d.getObject("dijit.wai.onload")===d._loaders[0]?d._loaders.splice(1,0,b):d._loaders.unshift(b)})();
return d.parser});
define("dojo/cache",["dojo"],function(d){var b={};d.cache=function(a,c,e){if(typeof a=="string")var f=d.moduleUrl(a,c);else{f=a;e=c}f=f.toString();var g=e;if(e!=undefined&&!d.isString(e))g="value"in e?e.value:undefined;e=e&&e.sanitize?true:false;if(typeof g=="string")g=b[f]=e?d.cache._sanitize(g):g;else if(g===null)delete b[f];else{if(!(f in b)){g=undefined;if(d.isFunction(require)&&d.isString(a))try{var i=(a?a.replace(/\./g,"/")+"/":"")+c;g=require("text!"+i)}catch(j){}if(typeof g==="undefined")g=
d._getText(f);b[f]=e?d.cache._sanitize(g):g}g=b[f]}return g};d.cache._sanitize=function(a){if(a){a=a.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,"");var c=a.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);if(c)a=c[1]}else a="";return a};return d.cache});
define("dijit/_Templated",["dojo","dijit","dijit/_Widget","dojo/string","dojo/parser","dojo/cache"],function(d,b){d.declare("dijit._Templated",null,{templateString:null,templatePath:null,widgetsInTemplate:false,_skipNodeCache:false,_earlyTemplatedStartup:false,constructor:function(){this._attachPoints=[];this._attachEvents=[]},_stringRepl:function(a){var c=this.declaredClass,e=this;return d.string.substitute(a,this,function(f,g){if(g.charAt(0)=="!")f=d.getObject(g.substr(1),false,e);if(typeof f==
"undefined")throw new Error(c+" template:"+g);if(f==null)return"";return g.charAt(0)=="!"?f:f.toString().replace(/"/g,"&quot;")},this)},buildRendering:function(){var a=b._Templated.getCachedTemplate(this.templatePath,this.templateString,this._skipNodeCache),c;if(d.isString(a)){c=d._toDom(this._stringRepl(a));if(c.nodeType!=1)throw new Error("Invalid template: "+a);}else c=a.cloneNode(true);this.domNode=c;this.inherited(arguments);this._attachTemplateNodes(c);if(this.widgetsInTemplate){a=this._startupWidgets=
d.parser.parse(c,{noStart:!this._earlyTemplatedStartup,template:true,inherited:{dir:this.dir,lang:this.lang},propsThis:this,scope:"dojo"});this._supportingWidgets=b.findWidgets(c);this._attachTemplateNodes(a,function(e,f){return e[f]})}this._fillContent(this.srcNodeRef)},_fillContent:function(a){var c=this.containerNode;if(a&&c)for(;a.hasChildNodes();)c.appendChild(a.firstChild)},_attachTemplateNodes:function(a,c){c=c||function(p,t){return p.getAttribute(t)};for(var e=d.isArray(a)?a:a.all||a.getElementsByTagName("*"),
f=d.isArray(a)?0:-1;f<e.length;f++){var g=f==-1?a:e[f];if(!(this.widgetsInTemplate&&(c(g,"dojoType")||c(g,"data-dojo-type")))){var i=c(g,"dojoAttachPoint")||c(g,"data-dojo-attach-point");if(i)for(var j=i.split(/\s*,\s*/);i=j.shift();){if(d.isArray(this[i]))this[i].push(g);else this[i]=g;this._attachPoints.push(i)}if(i=c(g,"dojoAttachEvent")||c(g,"data-dojo-attach-event")){j=i.split(/\s*,\s*/);for(var h=d.trim;i=j.shift();)if(i){var l=null;if(i.indexOf(":")!=-1){l=i.split(":");i=h(l[0]);l=h(l[1])}else i=
h(i);l||(l=i);this._attachEvents.push(this.connect(g,i,l))}}(i=c(g,"waiRole"))&&b.setWaiRole(g,i);(i=c(g,"waiState"))&&d.forEach(i.split(/\s*,\s*/),function(p){if(p.indexOf("-")!=-1){p=p.split("-");b.setWaiState(g,p[0],p[1])}})}}},startup:function(){d.forEach(this._startupWidgets,function(a){a&&!a._started&&a.startup&&a.startup()});this.inherited(arguments)},destroyRendering:function(){d.forEach(this._attachPoints,function(a){delete this[a]},this);this._attachPoints=[];d.forEach(this._attachEvents,
this.disconnect,this);this._attachEvents=[];this.inherited(arguments)}});b._Templated._templateCache={};b._Templated.getCachedTemplate=function(a,c,e){var f=b._Templated._templateCache,g=c||a,i=f[g];if(i){try{if(!i.ownerDocument||i.ownerDocument==d.doc)return i}catch(j){}d.destroy(i)}c||(c=d.cache(a,{sanitize:true}));c=d.string.trim(c);if(e||c.match(/\$\{([^\}]+)\}/g))return f[g]=c;else{a=d._toDom(c);if(a.nodeType!=1)throw new Error("Invalid template: "+c);return f[g]=a}};d.isIE&&d.addOnWindowUnload(function(){var a=
b._Templated._templateCache;for(var c in a){var e=a[c];typeof e=="object"&&d.destroy(e);delete a[c]}});d.extend(b._Widget,{dojoAttachEvent:"",dojoAttachPoint:"",waiRole:"",waiState:""});return b._Templated});
define("dijit/_CssStateMixin",["dojo","dijit"],function(d,b){d.declare("dijit._CssStateMixin",[],{cssStateNodes:{},hovering:false,active:false,_applyAttributes:function(){this.inherited(arguments);d.forEach(["onmouseenter","onmouseleave","onmousedown"],function(c){this.connect(this.domNode,c,"_cssMouseEvent")},this);d.forEach(["disabled","readOnly","checked","selected","focused","state","hovering","active"],function(c){this.watch(c,d.hitch(this,"_setStateClass"))},this);for(var a in this.cssStateNodes)this._trackMouseState(this[a],
this.cssStateNodes[a]);this._setStateClass()},_cssMouseEvent:function(a){if(!this.disabled)switch(a.type){case "mouseenter":case "mouseover":this._set("hovering",true);this._set("active",this._mouseDown);break;case "mouseleave":case "mouseout":this._set("hovering",false);this._set("active",false);break;case "mousedown":this._set("active",true);this._mouseDown=true;var c=this.connect(d.body(),"onmouseup",function(){this._mouseDown=false;this._set("active",false);this.disconnect(c)});break}},_setStateClass:function(){function a(j){c=
c.concat(d.map(c,function(h){return h+j}),"dijit"+j)}var c=this.baseClass.split(" ");this.isLeftToRight()||a("Rtl");this.checked&&a("Checked");this.state&&a(this.state);this.selected&&a("Selected");if(this.disabled)a("Disabled");else if(this.readOnly)a("ReadOnly");else if(this.active)a("Active");else this.hovering&&a("Hover");this._focused&&a("Focused");var e=this.stateNode||this.domNode,f={};d.forEach(e.className.split(" "),function(j){f[j]=true});"_stateClasses"in this&&d.forEach(this._stateClasses,
function(j){delete f[j]});d.forEach(c,function(j){f[j]=true});var g=[];for(var i in f)g.push(i);e.className=g.join(" ");this._stateClasses=c},_trackMouseState:function(a,c){function e(){var l="disabled"in j&&j.disabled||"readonly"in j&&j.readonly;d.toggleClass(a,c+"Hover",f&&!g&&!l);d.toggleClass(a,c+"Active",g&&!l);d.toggleClass(a,c+"Focused",i&&!l)}var f=false,g=false,i=false,j=this,h=d.hitch(this,"connect",a);h("onmouseenter",function(){f=true;e()});h("onmouseleave",function(){g=f=false;e()});
h("onmousedown",function(){g=true;e()});h("onmouseup",function(){g=false;e()});h("onfocus",function(){i=true;e()});h("onblur",function(){i=false;e()});this.watch("disabled",e);this.watch("readOnly",e)}});return b._CssStateMixin});
define("dijit/form/_FormWidget",["dojo","dijit","dojo/window","dijit/_Widget","dijit/_Templated","dijit/_CssStateMixin"],function(d,b){d.declare("dijit.form._FormWidget",[b._Widget,b._Templated,b._CssStateMixin],{name:"",alt:"",value:"",type:"text",tabIndex:"0",disabled:false,intermediateChanges:false,scrollOnFocus:true,attributeMap:d.delegate(b._Widget.prototype.attributeMap,{value:"focusNode",id:"focusNode",tabIndex:"focusNode",alt:"focusNode",title:"focusNode"}),postMixInProperties:function(){this.nameAttrSetting=
this.name?'name="'+this.name.replace(/'/g,"&quot;")+'"':"";this.inherited(arguments)},postCreate:function(){this.inherited(arguments);this.connect(this.domNode,"onmousedown","_onMouseDown")},_setDisabledAttr:function(a){this._set("disabled",a);d.attr(this.focusNode,"disabled",a);this.valueNode&&d.attr(this.valueNode,"disabled",a);b.setWaiState(this.focusNode,"disabled",a);if(a){this._set("hovering",false);this._set("active",false);a="tabIndex"in this.attributeMap?this.attributeMap.tabIndex:"focusNode";
d.forEach(d.isArray(a)?a:[a],function(c){c=this[c];d.isWebKit||b.hasDefaultTabStop(c)?c.setAttribute("tabIndex","-1"):c.removeAttribute("tabIndex")},this)}else this.tabIndex!=""&&this.focusNode.setAttribute("tabIndex",this.tabIndex)},setDisabled:function(a){d.deprecated("setDisabled("+a+") is deprecated. Use set('disabled',"+a+") instead.","","2.0");this.set("disabled",a)},_onFocus:function(){this.scrollOnFocus&&d.window.scrollIntoView(this.domNode);this.inherited(arguments)},isFocusable:function(){return!this.disabled&&
this.focusNode&&d.style(this.domNode,"display")!="none"},focus:function(){this.disabled||b.focus(this.focusNode)},compare:function(a,c){return typeof a=="number"&&typeof c=="number"?isNaN(a)&&isNaN(c)?0:a-c:a>c?1:a<c?-1:0},onChange:function(){},_onChangeActive:false,_handleOnChange:function(a,c){if(this._lastValueReported==undefined&&(c===null||!this._onChangeActive))this._resetValue=this._lastValueReported=a;this._pendingOnChange=this._pendingOnChange||typeof a!=typeof this._lastValueReported||this.compare(a,
this._lastValueReported)!=0;if((this.intermediateChanges||c||c===undefined)&&this._pendingOnChange){this._lastValueReported=a;this._pendingOnChange=false;if(this._onChangeActive){this._onChangeHandle&&clearTimeout(this._onChangeHandle);this._onChangeHandle=setTimeout(d.hitch(this,function(){this._onChangeHandle=null;this.onChange(a)}),0)}}},create:function(){this.inherited(arguments);this._onChangeActive=true},destroy:function(){if(this._onChangeHandle){clearTimeout(this._onChangeHandle);this.onChange(this._lastValueReported)}this.inherited(arguments)},
setValue:function(a){d.deprecated("dijit.form._FormWidget:setValue("+a+") is deprecated.  Use set('value',"+a+") instead.","","2.0");this.set("value",a)},getValue:function(){d.deprecated(this.declaredClass+"::getValue() is deprecated. Use get('value') instead.","","2.0");return this.get("value")},_onMouseDown:function(a){if(!a.ctrlKey&&d.mouseButtons.isLeft(a)&&this.isFocusable())var c=this.connect(d.body(),"onmouseup",function(){this.isFocusable()&&this.focus();this.disconnect(c)})}});d.declare("dijit.form._FormValueWidget",
b.form._FormWidget,{readOnly:false,attributeMap:d.delegate(b.form._FormWidget.prototype.attributeMap,{value:"",readOnly:"focusNode"}),_setReadOnlyAttr:function(a){d.attr(this.focusNode,"readOnly",a);b.setWaiState(this.focusNode,"readonly",a);this._set("readOnly",a)},postCreate:function(){this.inherited(arguments);if(d.isIE<9||d.isIE&&d.isQuirks)this.connect(this.focusNode||this.domNode,"onkeydown",this._onKeyDown);if(this._resetValue===undefined)this._lastValueReported=this._resetValue=this.value},
_setValueAttr:function(a,c){this._handleOnChange(a,c)},_handleOnChange:function(a){this._set("value",a);this.inherited(arguments)},undo:function(){this._setValueAttr(this._lastValueReported,false)},reset:function(){this._hasBeenBlurred=false;this._setValueAttr(this._resetValue,true)},_onKeyDown:function(a){if(a.keyCode==d.keys.ESCAPE&&!(a.ctrlKey||a.altKey||a.metaKey)){var c;if(d.isIE){a.preventDefault();c=document.createEventObject();c.keyCode=d.keys.ESCAPE;c.shiftKey=a.shiftKey;a.srcElement.fireEvent("onkeypress",
c)}}},_layoutHackIE7:function(){if(d.isIE==7)for(var a=this.domNode,c=a.parentNode,e=a.firstChild||a,f=e.style.filter,g=this;c&&c.clientHeight==0;){(function(){var i=g.connect(c,"onscroll",function(){g.disconnect(i);e.style.filter=(new Date).getMilliseconds();setTimeout(function(){e.style.filter=f},0)})})();c=c.parentNode}}});return b.form._FormWidget});
define("dijit/form/TextBox",["dojo","dijit","text!dijit/form/templates/TextBox.html","dijit/form/_FormWidget"],function(d,b){d.declare("dijit.form.TextBox",b.form._FormValueWidget,{trim:false,uppercase:false,lowercase:false,propercase:false,maxLength:"",selectOnClick:false,placeHolder:"",templateString:d.cache("dijit.form","templates/TextBox.html"),_singleNodeTemplate:'<input class="dijit dijitReset dijitLeft dijitInputField" dojoAttachPoint="textbox,focusNode" autocomplete="off" type="${type}" ${!nameAttrSetting} />',
_buttonInputDisabled:d.isIE?"disabled":"",baseClass:"dijitTextBox",attributeMap:d.delegate(b.form._FormValueWidget.prototype.attributeMap,{maxLength:"focusNode"}),postMixInProperties:function(){var a=this.type.toLowerCase();if(this.templateString&&this.templateString.toLowerCase()=="input"||(a=="hidden"||a=="file")&&this.templateString==b.form.TextBox.prototype.templateString)this.templateString=this._singleNodeTemplate;this.inherited(arguments)},_setPlaceHolderAttr:function(a){this._set("placeHolder",
a);if(!this._phspan){this._attachPoints.push("_phspan");this._phspan=d.create("span",{className:"dijitPlaceHolder dijitInputField"},this.textbox,"after")}this._phspan.innerHTML="";this._phspan.appendChild(document.createTextNode(a));this._updatePlaceHolder()},_updatePlaceHolder:function(){if(this._phspan)this._phspan.style.display=this.placeHolder&&!this._focused&&!this.textbox.value?"":"none"},_getValueAttr:function(){return this.parse(this.get("displayedValue"),this.constraints)},_setValueAttr:function(a,
c,e){var f;if(a!==undefined){f=this.filter(a);if(typeof e!="string")e=f!==null&&(typeof f!="number"||!isNaN(f))?this.filter(this.format(f,this.constraints)):""}if(e!=null&&e!=undefined&&(typeof e!="number"||!isNaN(e))&&this.textbox.value!=e){this.textbox.value=e;this._set("displayedValue",this.get("displayedValue"))}this._updatePlaceHolder();this.inherited(arguments,[f,c])},displayedValue:"",getDisplayedValue:function(){d.deprecated(this.declaredClass+"::getDisplayedValue() is deprecated. Use set('displayedValue') instead.",
"","2.0");return this.get("displayedValue")},_getDisplayedValueAttr:function(){return this.filter(this.textbox.value)},setDisplayedValue:function(a){d.deprecated(this.declaredClass+"::setDisplayedValue() is deprecated. Use set('displayedValue', ...) instead.","","2.0");this.set("displayedValue",a)},_setDisplayedValueAttr:function(a){if(a===null||a===undefined)a="";else if(typeof a!="string")a=String(a);this.textbox.value=a;this._setValueAttr(this.get("value"),undefined);this._set("displayedValue",
this.get("displayedValue"))},format:function(a){return a==null||a==undefined?"":a.toString?a.toString():a},parse:function(a){return a},_refreshState:function(){},_onInput:function(a){if(a&&a.type&&/key/i.test(a.type)&&a.keyCode)switch(a.keyCode){case d.keys.SHIFT:case d.keys.ALT:case d.keys.CTRL:case d.keys.TAB:return}if(this.intermediateChanges){var c=this;setTimeout(function(){c._handleOnChange(c.get("value"),false)},0)}this._refreshState();this._set("displayedValue",this.get("displayedValue"))},
postCreate:function(){d.isIE&&setTimeout(d.hitch(this,function(){var a=d.getComputedStyle(this.domNode);if(a)if(a=a.fontFamily){var c=this.domNode.getElementsByTagName("INPUT");if(c)for(var e=0;e<c.length;e++)c[e].style.fontFamily=a}}),0);this.textbox.setAttribute("value",this.textbox.value);this.inherited(arguments);if(d.isMoz||d.isOpera)this.connect(this.textbox,"oninput","_onInput");else{this.connect(this.textbox,"onkeydown","_onInput");this.connect(this.textbox,"onkeyup","_onInput");this.connect(this.textbox,
"onpaste","_onInput");this.connect(this.textbox,"oncut","_onInput")}},_blankValue:"",filter:function(a){if(a===null)return this._blankValue;if(typeof a!="string")return a;if(this.trim)a=d.trim(a);if(this.uppercase)a=a.toUpperCase();if(this.lowercase)a=a.toLowerCase();if(this.propercase)a=a.replace(/[^\s]+/g,function(c){return c.substring(0,1).toUpperCase()+c.substring(1)});return a},_setBlurValue:function(){this._setValueAttr(this.get("value"),true)},_onBlur:function(){if(!this.disabled){this._setBlurValue();
this.inherited(arguments);this._selectOnClickHandle&&this.disconnect(this._selectOnClickHandle);if(this.selectOnClick&&d.isMoz)this.textbox.selectionStart=this.textbox.selectionEnd=undefined;this._updatePlaceHolder()}},_onFocus:function(a){if(!(this.disabled||this.readOnly)){if(this.selectOnClick&&a=="mouse")this._selectOnClickHandle=this.connect(this.domNode,"onmouseup",function(){this.disconnect(this._selectOnClickHandle);var c;if(d.isIE){c=d.doc.selection.createRange();c=c.parentElement()==this.textbox&&
c.text.length==0}else c=this.textbox.selectionStart==this.textbox.selectionEnd;c&&b.selectInputText(this.textbox)});this._updatePlaceHolder();this.inherited(arguments);this._refreshState()}},reset:function(){this.textbox.value="";this.inherited(arguments)}});b.selectInputText=function(a,c,e){var f=d.global,g=d.doc;a=d.byId(a);if(isNaN(c))c=0;if(isNaN(e))e=a.value?a.value.length:0;b.focus(a);if(g.selection&&d.body().createTextRange){if(a.createTextRange){a=a.createTextRange();a.collapse(true);a.moveStart("character",
-99999);a.moveStart("character",c);a.moveEnd("character",e-c);a.select()}}else f.getSelection&&a.setSelectionRange&&a.setSelectionRange(c,e)};return b.form.TextBox});define("text!dijit/templates/Tooltip.html",function(){return'<div class="dijitTooltip dijitTooltipLeft" id="dojoTooltip"\n\t><div class="dijitTooltipContainer dijitTooltipContents" dojoAttachPoint="containerNode" role=\'alert\'></div\n\t><div class="dijitTooltipConnector" dojoAttachPoint="connectorNode"></div\n></div>'});
define("dijit/Tooltip",["dojo","dijit","dijit/_Widget","dijit/_Templated","text!dijit/templates/Tooltip.html"],function(d,b){d.declare("dijit._MasterTooltip",[b._Widget,b._Templated],{duration:b.defaultDuration,templateString:d.cache("dijit","templates/Tooltip.html"),postCreate:function(){d.body().appendChild(this.domNode);this.bgIframe=new b.BackgroundIframe(this.domNode);this.fadeIn=d.fadeIn({node:this.domNode,duration:this.duration,onEnd:d.hitch(this,"_onShow")});this.fadeOut=d.fadeOut({node:this.domNode,
duration:this.duration,onEnd:d.hitch(this,"_onHide")})},show:function(a,c,e,f){if(!(this.aroundNode&&this.aroundNode===c)){this.domNode.width="auto";if(this.fadeOut.status()=="playing")this._onDeck=arguments;else{this.containerNode.innerHTML=a;b.placeOnScreenAroundElement(this.domNode,c,b.getPopupAroundAlignment(e&&e.length?e:b.Tooltip.defaultPosition,!f),d.hitch(this,"orient"));d.style(this.domNode,"opacity",0);this.fadeIn.play();this.isShowingNow=true;this.aroundNode=c}}},orient:function(a,c,e,
f,g){this.connectorNode.style.top="";var i=f.w-this.connectorNode.offsetWidth;a.className="dijitTooltip "+{"BL-TL":"dijitTooltipBelow dijitTooltipABLeft","TL-BL":"dijitTooltipAbove dijitTooltipABLeft","BR-TR":"dijitTooltipBelow dijitTooltipABRight","TR-BR":"dijitTooltipAbove dijitTooltipABRight","BR-BL":"dijitTooltipRight","BL-BR":"dijitTooltipLeft"}[c+"-"+e];this.domNode.style.width="auto";var j=d.contentBox(this.domNode),h=Math.min(Math.max(i,1),j.w),l=h<j.w;this.domNode.style.width=h+"px";if(l){this.containerNode.style.overflow=
"auto";l=this.containerNode.scrollWidth;this.containerNode.style.overflow="visible";if(l>h){l=l+d.style(this.domNode,"paddingLeft")+d.style(this.domNode,"paddingRight");this.domNode.style.width=l+"px"}}if(e.charAt(0)=="B"&&c.charAt(0)=="B"){a=d.marginBox(a);c=this.connectorNode.offsetHeight;if(a.h>f.h){this.connectorNode.style.top=f.h-g.h/2-c/2+"px";this.connectorNode.style.bottom=""}else{this.connectorNode.style.bottom=Math.min(Math.max(g.h/2-c/2,0),a.h-c)+"px";this.connectorNode.style.top=""}}else{this.connectorNode.style.top=
"";this.connectorNode.style.bottom=""}return Math.max(0,j.w-i)},_onShow:function(){if(d.isIE)this.domNode.style.filter=""},hide:function(a){if(this._onDeck&&this._onDeck[1]==a)this._onDeck=null;else if(this.aroundNode===a){this.fadeIn.stop();this.isShowingNow=false;this.aroundNode=null;this.fadeOut.play()}},_onHide:function(){this.domNode.style.cssText="";this.containerNode.innerHTML="";if(this._onDeck){this.show.apply(this,this._onDeck);this._onDeck=null}}});b.showTooltip=function(a,c,e,f){if(!b._masterTT)b._masterTT=
new b._MasterTooltip;return b._masterTT.show(a,c,e,f)};b.hideTooltip=function(a){if(!b._masterTT)b._masterTT=new b._MasterTooltip;return b._masterTT.hide(a)};d.declare("dijit.Tooltip",b._Widget,{label:"",showDelay:400,connectId:[],position:[],_setConnectIdAttr:function(a){d.forEach(this._connections||[],function(e){d.forEach(e,d.hitch(this,"disconnect"))},this);var c=d.isArrayLike(a)?a:a?[a]:[];this._connections=d.map(c,function(e){return(e=d.byId(e))?[this.connect(e,"onmouseenter","_onTargetMouseEnter"),
this.connect(e,"onmouseleave","_onTargetMouseLeave"),this.connect(e,"onfocus","_onTargetFocus"),this.connect(e,"onblur","_onTargetBlur")]:[]},this);this._set("connectId",a);this._connectIds=c},addTarget:function(a){a=a.id||a;d.indexOf(this._connectIds,a)==-1&&this.set("connectId",this._connectIds.concat(a))},removeTarget:function(a){a=d.indexOf(this._connectIds,a.id||a);if(a>=0){this._connectIds.splice(a,1);this.set("connectId",this._connectIds)}},buildRendering:function(){this.inherited(arguments);
d.addClass(this.domNode,"dijitTooltipData")},startup:function(){this.inherited(arguments);var a=this.connectId;d.forEach(d.isArrayLike(a)?a:[a],this.addTarget,this)},_onTargetMouseEnter:function(a){this._onHover(a)},_onTargetMouseLeave:function(a){this._onUnHover(a)},_onTargetFocus:function(a){this._focus=true;this._onHover(a)},_onTargetBlur:function(a){this._focus=false;this._onUnHover(a)},_onHover:function(a){if(!this._showTimer){var c=a.target;this._showTimer=setTimeout(d.hitch(this,function(){this.open(c)}),
this.showDelay)}},_onUnHover:function(){if(!this._focus){if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer}this.close()}},open:function(a){if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer}b.showTooltip(this.label||this.domNode.innerHTML,a,this.position,!this.isLeftToRight());this._connectNode=a;this.onShow(a,this.position)},close:function(){if(this._connectNode){b.hideTooltip(this._connectNode);delete this._connectNode;this.onHide()}if(this._showTimer){clearTimeout(this._showTimer);
delete this._showTimer}},onShow:function(){},onHide:function(){},uninitialize:function(){this.close();this.inherited(arguments)}});b.Tooltip.defaultPosition=["after","before"];return b.Tooltip});
(function(){function d(c,e,f,g,i,j){if(e[c]){f.push(c);if(e[c]===true||e[c]===1)g.push(i+c+"/"+j)}}function b(c,e,f,g,i){e=g+e+"/"+i;require._fileExists(c.nameToUrl(e,null))&&f.push(e)}var a=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",{version:"0.24.0",load:function(c,e,f,g){g=g||{};var i=a.exec(c),j=i[1],h=i[4],l=i[5],p=h.split("-"),t=[],r={},s,v,z="";if(i[5]){j=i[1];c=j+l}else{c=c;l=i[4];h=g.locale||(g.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||
"root").toLowerCase());p=h.split("-")}if(g.isBuild){t.push(c);b(e,"root",t,j,l);for(s=0;v=p[s];s++){z+=(z?"-":"")+v;b(e,z,t,j,l)}e(t);f()}else e([c],function(y){var k=[];d("root",y,k,t,j,l);for(s=0;v=p[s];s++){z+=(z?"-":"")+v;d(z,y,k,t,j,l)}e(t,function(){var n,o;for(n=k.length-1;n>-1&&(v=k[n]);n--){o=y[v];if(o===true||o===1)o=e(j+v+"/"+l);require.mixin(r,o)}f(r)})})}})})();
define("dijit/form/nls/validate",{root:{invalidMessage:"The value entered is not valid.",missingMessage:"This value is required.",rangeMessage:"This value is out of range."},zh:true,"zh-tw":true,tr:true,th:true,sv:true,sl:true,sk:true,ru:true,ro:true,pt:true,"pt-pt":true,pl:true,nl:true,nb:true,ko:true,kk:true,ja:true,it:true,hu:true,he:true,fr:true,fi:true,es:true,el:true,de:true,da:true,cs:true,ca:true,ar:true});
define("dijit/form/ValidationTextBox",["dojo","dijit","text!dijit/form/templates/ValidationTextBox.html","dojo/i18n","dijit/form/TextBox","dijit/Tooltip","i18n!dijit/form/nls/validate"],function(d,b){d.declare("dijit.form.ValidationTextBox",b.form.TextBox,{templateString:d.cache("dijit.form","templates/ValidationTextBox.html"),baseClass:"dijitTextBox dijitValidationTextBox",required:false,promptMessage:"",invalidMessage:"$_unset_$",missingMessage:"$_unset_$",message:"",constraints:{},regExp:".*",
regExpGen:function(){return this.regExp},state:"",tooltipPosition:[],_setValueAttr:function(){this.inherited(arguments);this.validate(this._focused)},validator:function(a,c){return(new RegExp("^(?:"+this.regExpGen(c)+")"+(this.required?"":"?")+"$")).test(a)&&(!this.required||!this._isEmpty(a))&&(this._isEmpty(a)||this.parse(a,c)!==undefined)},_isValidSubset:function(){return this.textbox.value.search(this._partialre)==0},isValid:function(){return this.validator(this.textbox.value,this.constraints)},
_isEmpty:function(a){return(this.trim?/^\s*$/:/^$/).test(a)},getErrorMessage:function(){return this.required&&this._isEmpty(this.textbox.value)?this.missingMessage:this.invalidMessage},getPromptMessage:function(){return this.promptMessage},_maskValidSubsetError:true,validate:function(a){var c="",e=this.disabled||this.isValid(a);if(e)this._maskValidSubsetError=true;var f=this._isEmpty(this.textbox.value),g=!e&&a&&this._isValidSubset();this._set("state",e?"":((!this._hasBeenBlurred||a)&&f||g)&&this._maskValidSubsetError?
"Incomplete":"Error");b.setWaiState(this.focusNode,"invalid",e?"false":"true");if(this.state=="Error"){this._maskValidSubsetError=a&&g;c=this.getErrorMessage(a)}else if(this.state=="Incomplete"){c=this.getPromptMessage(a);this._maskValidSubsetError=!this._hasBeenBlurred||a}else if(f)c=this.getPromptMessage(a);this.set("message",c);return e},displayMessage:function(a){b.hideTooltip(this.domNode);a&&this._focused&&b.showTooltip(a,this.domNode,this.tooltipPosition,!this.isLeftToRight())},_refreshState:function(){this.validate(this._focused);
this.inherited(arguments)},constructor:function(){this.constraints={}},_setConstraintsAttr:function(a){if(!a.locale&&this.lang)a.locale=this.lang;this._set("constraints",a);this._computePartialRE()},_computePartialRE:function(){var a=this.regExpGen(this.constraints);this.regExp=a;var c="";a!=".*"&&this.regExp.replace(/\\.|\[\]|\[.*?[^\\]{1}\]|\{.*?\}|\(\?[=:!]|./g,function(f){switch(f.charAt(0)){case "{":case "+":case "?":case "*":case "^":case "$":case "|":case "(":c+=f;break;case ")":c+="|$)";break;
default:c+="(?:"+f+"|$)";break}});try{"".search(c)}catch(e){c=this.regExp;console.warn("RegExp error in "+this.declaredClass+": "+this.regExp)}this._partialre="^(?:"+c+")$"},postMixInProperties:function(){this.inherited(arguments);this.messages=d.i18n.getLocalization("dijit.form","validate",this.lang);if(this.invalidMessage=="$_unset_$")this.invalidMessage=this.messages.invalidMessage;if(!this.invalidMessage)this.invalidMessage=this.promptMessage;if(this.missingMessage=="$_unset_$")this.missingMessage=
this.messages.missingMessage;if(!this.missingMessage)this.missingMessage=this.invalidMessage;this._setConstraintsAttr(this.constraints)},_setDisabledAttr:function(){this.inherited(arguments);this._refreshState()},_setRequiredAttr:function(a){this._set("required",a);b.setWaiState(this.focusNode,"required",a);this._refreshState()},_setMessageAttr:function(a){this._set("message",a);this.displayMessage(a)},reset:function(){this._maskValidSubsetError=true;this.inherited(arguments)},_onBlur:function(){this.displayMessage("");
this.inherited(arguments)}});d.declare("dijit.form.MappedTextBox",b.form.ValidationTextBox,{postMixInProperties:function(){this.inherited(arguments);this.nameAttrSetting=""},serialize:function(a){return a.toString?a.toString():""},toString:function(){var a=this.filter(this.get("value"));return a!=null?typeof a=="string"?a:this.serialize(a,this.constraints):""},validate:function(){this.valueNode.value=this.toString();return this.inherited(arguments)},buildRendering:function(){this.inherited(arguments);
this.valueNode=d.place("<input type='hidden'"+(this.name?" name='"+this.name.replace(/'/g,"&quot;")+"'":"")+"/>",this.textbox,"after")},reset:function(){this.valueNode.value="";this.inherited(arguments)}});d.declare("dijit.form.RangeBoundTextBox",b.form.MappedTextBox,{rangeMessage:"",rangeCheck:function(a,c){return("min"in c?this.compare(a,c.min)>=0:true)&&("max"in c?this.compare(a,c.max)<=0:true)},isInRange:function(){return this.rangeCheck(this.get("value"),this.constraints)},_isDefinitelyOutOfRange:function(){var a=
this.get("value"),c=false,e=false;if("min"in this.constraints){c=this.constraints.min;c=this.compare(a,typeof c=="number"&&c>=0&&a!=0?0:c);c=typeof c=="number"&&c<0}if("max"in this.constraints){e=this.constraints.max;e=this.compare(a,typeof e!="number"||e>0?e:0);e=typeof e=="number"&&e>0}return c||e},_isValidSubset:function(){return this.inherited(arguments)&&!this._isDefinitelyOutOfRange()},isValid:function(a){return this.inherited(arguments)&&(this._isEmpty(this.textbox.value)&&!this.required||
this.isInRange(a))},getErrorMessage:function(a){var c=this.get("value");if(c!==null&&c!==""&&c!==undefined&&(typeof c!="number"||!isNaN(c))&&!this.isInRange(a))return this.rangeMessage;return this.inherited(arguments)},postMixInProperties:function(){this.inherited(arguments);if(!this.rangeMessage){this.messages=d.i18n.getLocalization("dijit.form","validate",this.lang);this.rangeMessage=this.messages.rangeMessage}},_setConstraintsAttr:function(){this.inherited(arguments);if(this.focusNode){this.constraints.min!==
undefined?b.setWaiState(this.focusNode,"valuemin",this.constraints.min):b.removeWaiState(this.focusNode,"valuemin");this.constraints.max!==undefined?b.setWaiState(this.focusNode,"valuemax",this.constraints.max):b.removeWaiState(this.focusNode,"valuemax")}},_setValueAttr:function(a){b.setWaiState(this.focusNode,"valuenow",a);this.inherited(arguments)}});return b.form.ValidationTextBox});
define("orion/util",["dojo","dijit","dojo/hash","dijit/form/ValidationTextBox"],function(d,b){function a(m){o=m}function c(){return o}function e(m){var q="",w=navigator.platform.indexOf("Mac")!==-1;if(m.mod1)q+=w?"Cmd+":"Ctrl+";if(m.mod2)q+="Shift+";if(m.mod3)q+="Alt+";if(m.alphaKey)return q+m.alphaKey;for(var u in d.keys)if(typeof(d.keys[u]==="number"))if(d.keys[u]===m.keyCode)return q+u;var x;switch(m.keyCode){case 59:x=m.mod2?":":";";break;case 61:x=m.mod2?"+":"=";break;case 188:x=m.mod2?"<":",";
break;case 190:x=m.mod2?">":".";break;case 191:x=m.mod2?"?":"/";break;case 192:x=m.mod2?"~":"`";break;case 219:x=m.mod2?"{":"[";break;case 220:x=m.mod2?"|":"\\";break;case 221:x=m.mod2?"}":"]";break;case 222:x=m.mod2?'"':"'";break}if(x)return q+x;return q+String.fromCharCode(m.keyCode)}function f(m,q){m.startup();if(typeof q==="string"){var w=d.byId(q);if(!w)if(w=b.byId(q))w=w.domNode;q=w?w:null}if(q){q=d.position(q);m._setStyleAttr("left:"+(q.x+16)+"px !important;");m._setStyleAttr("top:"+(q.y+16)+
"px !important;")}m.show()}function g(m,q,w,u,x,B,C,D,F){C=function(K){return function(L){var R=b.byId(m),T=R.get("value");if(K&&L.keyCode===d.keys.ESCAPE){w&&d.style(q,"display","inline");R.destroyRecursive();B&&B()}else if(!(K&&L.keyCode!==d.keys.ENTER)){if(!R.isValid()||!F&&T===u)w&&d.style(q,"display","inline");else x(T);R.destroyRecursive();B&&B()}}};var J=new b.form.ValidationTextBox({id:m,required:true,value:u||""});d.place(J.domNode,q,"after");d.addClass(J.domNode,"userEditBoxPrompt");w&&
d.style(q,"display","none");d.connect(J,"onKeyDown",C(true));d.connect(J,"onBlur",C(false));window.setTimeout(function(){J.focus();if(u){var K=d.byId(m),L=D?u.indexOf(D):-1;L>0?b.selectInputText(K,0,L):K.select()}},0)}function i(m){var q=window.navigator.platform.indexOf("Mac")!==-1;return q&&m.metaKey||!q&&m.ctrlKey}function j(m,q){if(q&&i(q))window.open(m);else window.location=m}function h(m){if(!m)return m;var q=window.location.href.split("#")[0];q=q.substring(0,q.length-window.location.pathname.length);
if(m.indexOf(q)===0)return m.substring(q.length);return m}function l(m){var q,w,u,x,B;m=m.split("#");var C=m[m.length-1].split(/\?(?=(?:line|char))/);m=h(C[0]);if(C.length>1){C=C[1].split(/\&(?=(?:line|char))/);for(var D=0;D<C.length;D++){var F=C[D].split("=");if(F.length>1)switch(F[0]){case "char":F=F[1].split(",");if(u===undefined){q=window.parseInt(F[0]);if(F.length>1)w=window.parseInt(F[1])}else{x=window.parseInt(F[0]);if(F.length>1)B=window.parseInt(F[1])}break;case "line":F=F[1].split(",");
u=window.parseInt(F[0]);break;default:break}}}return{filePath:m,start:q,end:w,line:u,offset:x,length:B}}function p(m,q,w,u,x,B){if(typeof q==="number"){m="#"+m+"?char="+q;if(typeof w==="number")m=m+","+w;else if(typeof B==="number")m=m+","+(q+B);return m}if(typeof u==="number"){m="#"+m+"?line="+u;if(typeof x==="number"){m=m+"&char="+x;if(typeof B==="number")m=m+","+(x+B)}return m}return"#"+m}function t(m){if(!m)return m;var q=window.location.href.split("#")[0];return q.substring(0,q.length-window.location.pathname.length)+
m}function r(m){return this.makeRelative(m).indexOf("/workspace")===0}function s(m,q){m.children=q;for(var w in q)q[w].parent=m;m.children.sort(function(u,x){var B=u.Directory;if(B!==x.Directory)return B?-1:1;u=u.Name&&u.Name.toLowerCase();x=x.Name&&x.Name.toLowerCase();if(u<x)return-1;if(u>x)return 1;return 0})}function v(m){m.children.sort(function(q,w){var u=q.type==="dir";if(u!==(w.type==="dir"))return u?-1:1;q=q.name&&q.name.toLowerCase();w=w.name&&w.name.toLowerCase();if(q<w)return-1;if(q>w)return 1;
return 0})}function z(m,q){m.Parents&&m.Parents.length===0&&q.getService("orion.core.preference").then(function(w){return w.getPreferences("/window/recent")}).then(function(w){var u=w.get("projects");if(typeof u==="string")u=JSON.parse(u);var x=[];if(u&&u.length&&u.length>0)for(var B=0;B<u.length;B++)u[B].location!==m.ChildrenLocation&&u[B].name!==m.Name&&x.push(u[B]);x.push({name:m.Name,location:m.ChildrenLocation});if(x.length>5)x=x.slice(-5,x.length);w.put("projects",x)})}function y(m){return typeof m.textContent!==
"undefined"?m.textContent:m.innerText}function k(m){return y(document.createTextNode(m))}function n(m,q){if(typeof m.textContent!=="undefined")m.textContent=q;else m.innerText=q}var o=null;return{setUserName:a,getUserName:c,getUserKeyString:e,openDialog:f,getUserText:g,openInNewWindow:i,followLink:j,getPositionInfo:l,hashFromPosition:p,makeRelative:h,makeFullPath:t,isAtRoot:r,processNavigatorParent:s,processSearchResultParent:v,rememberSuccessfulTraversal:z,getText:y,safeText:k,setText:n}});
define("text!dijit/templates/Menu.html",function(){return'<table class="dijit dijitMenu dijitMenuPassive dijitReset dijitMenuTable" role="menu" tabIndex="${tabIndex}" dojoAttachEvent="onkeypress:_onKeyPress" cellspacing="0">\n\t<tbody class="dijitReset" dojoAttachPoint="containerNode"></tbody>\n</table>'});
define("dijit/_Container",["dojo","dijit"],function(d,b){d.declare("dijit._Container",null,{isContainer:true,buildRendering:function(){this.inherited(arguments);if(!this.containerNode)this.containerNode=this.domNode},addChild:function(a,c){var e=this.containerNode;if(c&&typeof c=="number"){var f=this.getChildren();if(f&&f.length>=c){e=f[c-1].domNode;c="after"}}d.place(a.domNode,e,c);this._started&&!a._started&&a.startup()},removeChild:function(a){if(typeof a=="number")a=this.getChildren()[a];if(a)(a=
a.domNode)&&a.parentNode&&a.parentNode.removeChild(a)},hasChildren:function(){return this.getChildren().length>0},destroyDescendants:function(a){d.forEach(this.getChildren(),function(c){c.destroyRecursive(a)})},_getSiblingOfChild:function(a,c){a=a.domNode;c=c>0?"nextSibling":"previousSibling";do a=a[c];while(a&&(a.nodeType!=1||!b.byNode(a)));return a&&b.byNode(a)},getIndexOfChild:function(a){return d.indexOf(this.getChildren(),a)},startup:function(){if(!this._started){d.forEach(this.getChildren(),
function(a){a.startup()});this.inherited(arguments)}}});return b._Container});
define("dijit/_KeyNavContainer",["dojo","dijit","dijit/_Container"],function(d,b){d.declare("dijit._KeyNavContainer",b._Container,{tabIndex:"0",_keyNavCodes:{},connectKeyNavHandlers:function(a,c){var e=this._keyNavCodes={},f=d.hitch(this,this.focusPrev),g=d.hitch(this,this.focusNext);d.forEach(a,function(i){e[i]=f});d.forEach(c,function(i){e[i]=g});e[d.keys.HOME]=d.hitch(this,"focusFirstChild");e[d.keys.END]=d.hitch(this,"focusLastChild");this.connect(this.domNode,"onkeypress","_onContainerKeypress");
this.connect(this.domNode,"onfocus","_onContainerFocus")},startupKeyNavChildren:function(){d.forEach(this.getChildren(),d.hitch(this,"_startupChild"))},addChild:function(a){b._KeyNavContainer.superclass.addChild.apply(this,arguments);this._startupChild(a)},focus:function(){this.focusFirstChild()},focusFirstChild:function(){var a=this._getFirstFocusableChild();a&&this.focusChild(a)},focusLastChild:function(){var a=this._getLastFocusableChild();a&&this.focusChild(a)},focusNext:function(){this.focusChild(this._getNextFocusableChild(this.focusedChild,
1))},focusPrev:function(){this.focusChild(this._getNextFocusableChild(this.focusedChild,-1),true)},focusChild:function(a,c){this.focusedChild&&a!==this.focusedChild&&this._onChildBlur(this.focusedChild);a.set("tabIndex",this.tabIndex);a.focus(c?"end":"start");this._set("focusedChild",a)},_startupChild:function(a){a.set("tabIndex","-1");this.connect(a,"_onFocus",function(){a.set("tabIndex",this.tabIndex)});this.connect(a,"_onBlur",function(){a.set("tabIndex","-1")})},_onContainerFocus:function(a){if(a.target===
this.domNode){this.focusFirstChild();d.attr(this.domNode,"tabIndex","-1")}},_onBlur:function(){this.tabIndex&&d.attr(this.domNode,"tabIndex",this.tabIndex);this.inherited(arguments)},_onContainerKeypress:function(a){if(!(a.ctrlKey||a.altKey)){var c=this._keyNavCodes[a.charOrCode];if(c){c();d.stopEvent(a)}}},_onChildBlur:function(){},_getFirstFocusableChild:function(){return this._getNextFocusableChild(null,1)},_getLastFocusableChild:function(){return this._getNextFocusableChild(null,-1)},_getNextFocusableChild:function(a,
c){if(a)a=this._getSiblingOfChild(a,c);for(var e=this.getChildren(),f=0;f<e.length;f++){a||(a=e[c>0?0:e.length-1]);if(a.isFocusable())return a;a=this._getSiblingOfChild(a,c)}return null}});return b._KeyNavContainer});define("text!dijit/templates/MenuItem.html",function(){return'<tr class="dijitReset dijitMenuItem" dojoAttachPoint="focusNode" role="menuitem" tabIndex="-1"\n\t\tdojoAttachEvent="onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick">\n\t<td class="dijitReset dijitMenuItemIconCell" role="presentation">\n\t\t<img src="${_blankGif}" alt="" class="dijitIcon dijitMenuItemIcon" dojoAttachPoint="iconNode"/>\n\t</td>\n\t<td class="dijitReset dijitMenuItemLabel" colspan="2" dojoAttachPoint="containerNode"></td>\n\t<td class="dijitReset dijitMenuItemAccelKey" style="display: none" dojoAttachPoint="accelKeyNode"></td>\n\t<td class="dijitReset dijitMenuArrowCell" role="presentation">\n\t\t<div dojoAttachPoint="arrowWrapper" style="visibility: hidden">\n\t\t\t<img src="${_blankGif}" alt="" class="dijitMenuExpand"/>\n\t\t\t<span class="dijitMenuExpandA11y">+</span>\n\t\t</div>\n\t</td>\n</tr>'});
define("dijit/_Contained",["dojo","dijit"],function(d,b){d.declare("dijit._Contained",null,{getParent:function(){var a=b.getEnclosingWidget(this.domNode.parentNode);return a&&a.isContainer?a:null},_getSibling:function(a){var c=this.domNode;do c=c[a+"Sibling"];while(c&&c.nodeType!=1);return c&&b.byNode(c)},getPreviousSibling:function(){return this._getSibling("previous")},getNextSibling:function(){return this._getSibling("next")},getIndexInParent:function(){var a=this.getParent();if(!a||!a.getIndexOfChild)return-1;
return a.getIndexOfChild(this)}});return b._Contained});
define("dijit/MenuItem",["dojo","dijit","text!dijit/templates/MenuItem.html","dijit/_Widget","dijit/_Templated","dijit/_Contained","dijit/_CssStateMixin"],function(d,b){d.declare("dijit.MenuItem",[b._Widget,b._Templated,b._Contained,b._CssStateMixin],{templateString:d.cache("dijit","templates/MenuItem.html"),attributeMap:d.delegate(b._Widget.prototype.attributeMap,{label:{node:"containerNode",type:"innerHTML"},iconClass:{node:"iconNode",type:"class"}}),baseClass:"dijitMenuItem",label:"",iconClass:"",
accelKey:"",disabled:false,_fillContent:function(a){a&&!("label"in this.params)&&this.set("label",a.innerHTML)},buildRendering:function(){this.inherited(arguments);var a=this.id+"_text";d.attr(this.containerNode,"id",a);if(this.accelKeyNode){d.attr(this.accelKeyNode,"id",this.id+"_accel");a+=" "+this.id+"_accel"}b.setWaiState(this.domNode,"labelledby",a);d.setSelectable(this.domNode,false)},_onHover:function(){this.getParent().onItemHover(this)},_onUnhover:function(){this.getParent().onItemUnhover(this);
this._set("hovering",false)},_onClick:function(a){this.getParent().onItemClick(this,a);d.stopEvent(a)},onClick:function(){},focus:function(){try{d.isIE==8&&this.containerNode.focus();b.focus(this.focusNode)}catch(a){}},_onFocus:function(){this._setSelected(true);this.getParent()._onItemFocus(this);this.inherited(arguments)},_setSelected:function(a){d.toggleClass(this.domNode,"dijitMenuItemSelected",a)},setLabel:function(a){d.deprecated("dijit.MenuItem.setLabel() is deprecated.  Use set('label', ...) instead.",
"","2.0");this.set("label",a)},setDisabled:function(a){d.deprecated("dijit.Menu.setDisabled() is deprecated.  Use set('disabled', bool) instead.","","2.0");this.set("disabled",a)},_setDisabledAttr:function(a){b.setWaiState(this.focusNode,"disabled",a?"true":"false");this._set("disabled",a)},_setAccelKeyAttr:function(a){this.accelKeyNode.style.display=a?"":"none";this.accelKeyNode.innerHTML=a;d.attr(this.containerNode,"colSpan",a?"1":"2");this._set("accelKey",a)}});return b.MenuItem});
define("dijit/PopupMenuItem",["dojo","dijit","dijit/MenuItem"],function(d,b){d.declare("dijit.PopupMenuItem",b.MenuItem,{_fillContent:function(){if(this.srcNodeRef){var a=d.query("*",this.srcNodeRef);b.PopupMenuItem.superclass._fillContent.call(this,a[0]);this.dropDownContainer=this.srcNodeRef}},startup:function(){if(!this._started){this.inherited(arguments);if(!this.popup){var a=d.query("[widgetId]",this.dropDownContainer)[0];this.popup=b.byNode(a)}d.body().appendChild(this.popup.domNode);this.popup.startup();
this.popup.domNode.style.display="none";this.arrowWrapper&&d.style(this.arrowWrapper,"visibility","");b.setWaiState(this.focusNode,"haspopup","true")}},destroyDescendants:function(){if(this.popup){this.popup._destroyed||this.popup.destroyRecursive();delete this.popup}this.inherited(arguments)}});return b.PopupMenuItem});define("text!dijit/templates/CheckedMenuItem.html",function(){return'<tr class="dijitReset dijitMenuItem" dojoAttachPoint="focusNode" role="menuitemcheckbox" tabIndex="-1"\n\t\tdojoAttachEvent="onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick">\n\t<td class="dijitReset dijitMenuItemIconCell" role="presentation">\n\t\t<img src="${_blankGif}" alt="" class="dijitMenuItemIcon dijitCheckedMenuItemIcon" dojoAttachPoint="iconNode"/>\n\t\t<span class="dijitCheckedMenuItemIconChar">&#10003;</span>\n\t</td>\n\t<td class="dijitReset dijitMenuItemLabel" colspan="2" dojoAttachPoint="containerNode,labelNode"></td>\n\t<td class="dijitReset dijitMenuItemAccelKey" style="display: none" dojoAttachPoint="accelKeyNode"></td>\n\t<td class="dijitReset dijitMenuArrowCell" role="presentation">&nbsp;</td>\n</tr>'});
define("dijit/CheckedMenuItem",["dojo","dijit","text!dijit/templates/CheckedMenuItem.html","dijit/MenuItem"],function(d,b){d.declare("dijit.CheckedMenuItem",b.MenuItem,{templateString:d.cache("dijit","templates/CheckedMenuItem.html"),checked:false,_setCheckedAttr:function(a){d.toggleClass(this.domNode,"dijitCheckedMenuItemChecked",a);b.setWaiState(this.domNode,"checked",a);this._set("checked",a)},onChange:function(){},_onClick:function(){if(!this.disabled){this.set("checked",!this.checked);this.onChange(this.checked)}this.inherited(arguments)}});
return b.CheckedMenuItem});define("text!dijit/templates/MenuSeparator.html",function(){return'<tr class="dijitMenuSeparator">\n\t<td class="dijitMenuSeparatorIconCell">\n\t\t<div class="dijitMenuSeparatorTop"></div>\n\t\t<div class="dijitMenuSeparatorBottom"></div>\n\t</td>\n\t<td colspan="3" class="dijitMenuSeparatorLabelCell">\n\t\t<div class="dijitMenuSeparatorTop dijitMenuSeparatorLabel"></div>\n\t\t<div class="dijitMenuSeparatorBottom"></div>\n\t</td>\n</tr>'});
define("dijit/MenuSeparator",["dojo","dijit","text!dijit/templates/MenuSeparator.html","dijit/_Widget","dijit/_Templated","dijit/_Contained"],function(d,b){d.declare("dijit.MenuSeparator",[b._Widget,b._Templated,b._Contained],{templateString:d.cache("dijit","templates/MenuSeparator.html"),buildRendering:function(){this.inherited(arguments);d.setSelectable(this.domNode,false)},isFocusable:function(){return false}});return b.MenuSeparator});
define("dijit/Menu",["dojo","dijit","text!dijit/templates/Menu.html","dojo/window","dijit/_Widget","dijit/_KeyNavContainer","dijit/_Templated","dijit/MenuItem","dijit/PopupMenuItem","dijit/CheckedMenuItem","dijit/MenuSeparator"],function(d,b){d.declare("dijit._MenuBase",[b._Widget,b._Templated,b._KeyNavContainer],{parentMenu:null,popupDelay:500,startup:function(){if(!this._started){d.forEach(this.getChildren(),function(a){a.startup()});this.startupKeyNavChildren();this.inherited(arguments)}},onExecute:function(){},
onCancel:function(){},_moveToPopup:function(a){if(this.focusedChild&&this.focusedChild.popup&&!this.focusedChild.disabled)this.focusedChild._onClick(a);else(a=this._getTopMenu())&&a._isMenuBar&&a.focusNext()},_onPopupHover:function(){if(this.currentPopup&&this.currentPopup._pendingClose_timer){var a=this.currentPopup.parentMenu;a.focusedChild&&a.focusedChild._setSelected(false);a.focusedChild=this.currentPopup.from_item;a.focusedChild._setSelected(true);this._stopPendingCloseTimer(this.currentPopup)}},
onItemHover:function(a){if(this.isActive){this.focusChild(a);if(this.focusedChild.popup&&!this.focusedChild.disabled&&!this.hover_timer)this.hover_timer=setTimeout(d.hitch(this,"_openPopup"),this.popupDelay)}this.focusedChild&&this.focusChild(a);this._hoveredChild=a},_onChildBlur:function(a){this._stopPopupTimer();a._setSelected(false);var c=a.popup;if(c){this._stopPendingCloseTimer(c);c._pendingClose_timer=setTimeout(function(){c._pendingClose_timer=null;if(c.parentMenu)c.parentMenu.currentPopup=
null;b.popup.close(c)},this.popupDelay)}},onItemUnhover:function(a){this.isActive&&this._stopPopupTimer();if(this._hoveredChild==a)this._hoveredChild=null},_stopPopupTimer:function(){if(this.hover_timer){clearTimeout(this.hover_timer);this.hover_timer=null}},_stopPendingCloseTimer:function(a){if(a._pendingClose_timer){clearTimeout(a._pendingClose_timer);a._pendingClose_timer=null}},_stopFocusTimer:function(){if(this._focus_timer){clearTimeout(this._focus_timer);this._focus_timer=null}},_getTopMenu:function(){for(var a=
this;a.parentMenu;a=a.parentMenu);return a},onItemClick:function(a,c){typeof this.isShowingNow=="undefined"&&this._markActive();this.focusChild(a);if(a.disabled)return false;if(a.popup)this._openPopup();else{this.onExecute();a.onClick(c)}},_openPopup:function(){this._stopPopupTimer();var a=this.focusedChild;if(a){var c=a.popup;if(!c.isShowingNow){if(this.currentPopup){this._stopPendingCloseTimer(this.currentPopup);b.popup.close(this.currentPopup)}c.parentMenu=this;c.from_item=a;var e=this;b.popup.open({parent:this,
popup:c,around:a.domNode,orient:this._orient||(this.isLeftToRight()?{TR:"TL",TL:"TR",BR:"BL",BL:"BR"}:{TL:"TR",TR:"TL",BL:"BR",BR:"BL"}),onCancel:function(){e.focusChild(a);e._cleanUp();a._setSelected(true);e.focusedChild=a},onExecute:d.hitch(this,"_cleanUp")});this.currentPopup=c;c.connect(c.domNode,"onmouseenter",d.hitch(e,"_onPopupHover"));if(c.focus)c._focus_timer=setTimeout(d.hitch(c,function(){this._focus_timer=null;this.focus()}),0)}}},_markActive:function(){this.isActive=true;d.replaceClass(this.domNode,
"dijitMenuActive","dijitMenuPassive")},onOpen:function(){this.isShowingNow=true;this._markActive()},_markInactive:function(){this.isActive=false;d.replaceClass(this.domNode,"dijitMenuPassive","dijitMenuActive")},onClose:function(){this._stopFocusTimer();this._markInactive();this.isShowingNow=false;this.parentMenu=null},_closeChild:function(){this._stopPopupTimer();if(this.currentPopup){b._curFocus&&d.isDescendant(b._curFocus,this.currentPopup.domNode)&&this.focusedChild.focusNode.focus();b.popup.close(this.currentPopup);
this.currentPopup=null}if(this.focusedChild){this.focusedChild._setSelected(false);this.focusedChild._onUnhover();this.focusedChild=null}},_onItemFocus:function(a){this._hoveredChild&&this._hoveredChild!=a&&this._hoveredChild._onUnhover()},_onBlur:function(){this._cleanUp();this.inherited(arguments)},_cleanUp:function(){this._closeChild();typeof this.isShowingNow=="undefined"&&this._markInactive()}});d.declare("dijit.Menu",b._MenuBase,{constructor:function(){this._bindings=[]},templateString:d.cache("dijit",
"templates/Menu.html"),baseClass:"dijitMenu",targetNodeIds:[],contextMenuForWindow:false,leftClickToOpen:false,refocus:true,postCreate:function(){this.contextMenuForWindow?this.bindDomNode(d.body()):d.forEach(this.targetNodeIds,this.bindDomNode,this);var a=d.keys,c=this.isLeftToRight();this._openSubMenuKey=c?a.RIGHT_ARROW:a.LEFT_ARROW;this._closeSubMenuKey=c?a.LEFT_ARROW:a.RIGHT_ARROW;this.connectKeyNavHandlers([a.UP_ARROW],[a.DOWN_ARROW])},_onKeyPress:function(a){if(!(a.ctrlKey||a.altKey))switch(a.charOrCode){case this._openSubMenuKey:this._moveToPopup(a);
d.stopEvent(a);break;case this._closeSubMenuKey:if(this.parentMenu)this.parentMenu._isMenuBar?this.parentMenu.focusPrev():this.onCancel(false);else d.stopEvent(a);break}},_iframeContentWindow:function(a){return d.window.get(this._iframeContentDocument(a))||this._iframeContentDocument(a).__parent__||a.name&&d.doc.frames[a.name]||null},_iframeContentDocument:function(a){return a.contentDocument||a.contentWindow&&a.contentWindow.document||a.name&&d.doc.frames[a.name]&&d.doc.frames[a.name].document||
null},bindDomNode:function(a){a=d.byId(a);var c;if(a.tagName.toLowerCase()=="iframe"){var e=a,f=this._iframeContentWindow(e);c=d.withGlobal(f,d.body)}else c=a==d.body()?d.doc.documentElement:a;var g={node:a,iframe:e};d.attr(a,"_dijitMenu"+this.id,this._bindings.push(g));var i=d.hitch(this,function(j){return[d.connect(j,this.leftClickToOpen?"onclick":"oncontextmenu",this,function(h){d.stopEvent(h);this._scheduleOpen(h.target,e,{x:h.pageX,y:h.pageY})}),d.connect(j,"onkeydown",this,function(h){if(h.shiftKey&&
h.keyCode==d.keys.F10){d.stopEvent(h);this._scheduleOpen(h.target,e)}})]});g.connects=c?i(c):[];if(e){g.onloadHandler=d.hitch(this,function(){var j=this._iframeContentWindow(e);c=d.withGlobal(j,d.body);g.connects=i(c)});e.addEventListener?e.addEventListener("load",g.onloadHandler,false):e.attachEvent("onload",g.onloadHandler)}},unBindDomNode:function(a){var c;try{c=d.byId(a)}catch(e){return}a="_dijitMenu"+this.id;if(c&&d.hasAttr(c,a)){var f=d.attr(c,a)-1,g=this._bindings[f];d.forEach(g.connects,d.disconnect);
var i=g.iframe;if(i)i.removeEventListener?i.removeEventListener("load",g.onloadHandler,false):i.detachEvent("onload",g.onloadHandler);d.removeAttr(c,a);delete this._bindings[f]}},_scheduleOpen:function(a,c,e){if(!this._openTimer)this._openTimer=setTimeout(d.hitch(this,function(){delete this._openTimer;this._openMyself({target:a,iframe:c,coords:e})}),1)},_openMyself:function(a){function c(){l.refocus&&b.focus(p);b.popup.close(l)}var e=a.target,f=a.iframe;if(a=a.coords){if(f){e=d.position(f,true);var g=
this._iframeContentWindow(f);g=d.withGlobal(g,"_docScroll",d);var i=d.getComputedStyle(f),j=d._toPixelValue,h=(d.isIE&&d.isQuirks?0:j(f,i.paddingLeft))+(d.isIE&&d.isQuirks?j(f,i.borderLeftWidth):0);f=(d.isIE&&d.isQuirks?0:j(f,i.paddingTop))+(d.isIE&&d.isQuirks?j(f,i.borderTopWidth):0);a.x+=e.x+h-g.x;a.y+=e.y+f-g.y}}else{a=d.position(e,true);a.x+=10;a.y+=10}var l=this,p=b.getFocus(this);b.popup.open({popup:this,x:a.x,y:a.y,onExecute:c,onCancel:c,orient:this.isLeftToRight()?"L":"R"});this.focus();this._onBlur=
function(){this.inherited("_onBlur",arguments);b.popup.close(this)}},uninitialize:function(){d.forEach(this._bindings,function(a){a&&this.unBindDomNode(a.node)},this);this.inherited(arguments)}});return b.Menu});define("text!dijit/form/templates/Button.html",function(){return'<span class="dijit dijitReset dijitInline"\n\t><span class="dijitReset dijitInline dijitButtonNode"\n\t\tdojoAttachEvent="ondijitclick:_onButtonClick"\n\t\t><span class="dijitReset dijitStretch dijitButtonContents"\n\t\t\tdojoAttachPoint="titleNode,focusNode"\n\t\t\trole="button" aria-labelledby="${id}_label"\n\t\t\t><span class="dijitReset dijitInline dijitIcon" dojoAttachPoint="iconNode"></span\n\t\t\t><span class="dijitReset dijitToggleButtonIconChar">&#x25CF;</span\n\t\t\t><span class="dijitReset dijitInline dijitButtonText"\n\t\t\t\tid="${id}_label"\n\t\t\t\tdojoAttachPoint="containerNode"\n\t\t\t></span\n\t\t></span\n\t></span\n\t><input ${!nameAttrSetting} type="${type}" value="${value}" class="dijitOffScreen" tabIndex="-1"\n\t\tdojoAttachPoint="valueNode"\n/></span>'});
define("text!dijit/form/templates/DropDownButton.html",function(){return'<span class="dijit dijitReset dijitInline"\n\t><span class=\'dijitReset dijitInline dijitButtonNode\'\n\t\tdojoAttachEvent="ondijitclick:_onButtonClick" dojoAttachPoint="_buttonNode"\n\t\t><span class="dijitReset dijitStretch dijitButtonContents"\n\t\t\tdojoAttachPoint="focusNode,titleNode,_arrowWrapperNode"\n\t\t\trole="button" aria-haspopup="true" aria-labelledby="${id}_label"\n\t\t\t><span class="dijitReset dijitInline dijitIcon"\n\t\t\t\tdojoAttachPoint="iconNode"\n\t\t\t></span\n\t\t\t><span class="dijitReset dijitInline dijitButtonText"\n\t\t\t\tdojoAttachPoint="containerNode,_popupStateNode"\n\t\t\t\tid="${id}_label"\n\t\t\t></span\n\t\t\t><span class="dijitReset dijitInline dijitArrowButtonInner"></span\n\t\t\t><span class="dijitReset dijitInline dijitArrowButtonChar">&#9660;</span\n\t\t></span\n\t></span\n\t><input ${!nameAttrSetting} type="${type}" value="${value}" class="dijitOffScreen" tabIndex="-1"\n\t\tdojoAttachPoint="valueNode"\n/></span>'});
define("text!dijit/form/templates/ComboButton.html",function(){return'<table class="dijit dijitReset dijitInline dijitLeft"\n\tcellspacing=\'0\' cellpadding=\'0\' role="presentation"\n\t><tbody role="presentation"><tr role="presentation"\n\t\t><td class="dijitReset dijitStretch dijitButtonNode" dojoAttachPoint="buttonNode" dojoAttachEvent="ondijitclick:_onButtonClick,onkeypress:_onButtonKeyPress"\n\t\t><div id="${id}_button" class="dijitReset dijitButtonContents"\n\t\t\tdojoAttachPoint="titleNode"\n\t\t\trole="button" aria-labelledby="${id}_label"\n\t\t\t><div class="dijitReset dijitInline dijitIcon" dojoAttachPoint="iconNode" role="presentation"></div\n\t\t\t><div class="dijitReset dijitInline dijitButtonText" id="${id}_label" dojoAttachPoint="containerNode" role="presentation"></div\n\t\t></div\n\t\t></td\n\t\t><td id="${id}_arrow" class=\'dijitReset dijitRight dijitButtonNode dijitArrowButton\'\n\t\t\tdojoAttachPoint="_popupStateNode,focusNode,_buttonNode"\n\t\t\tdojoAttachEvent="onkeypress:_onArrowKeyPress"\n\t\t\ttitle="${optionsTitle}"\n\t\t\trole="button" aria-haspopup="true"\n\t\t\t><div class="dijitReset dijitArrowButtonInner" role="presentation"></div\n\t\t\t><div class="dijitReset dijitArrowButtonChar" role="presentation">&#9660;</div\n\t\t></td\n\t\t><td style="display:none !important;"\n\t\t\t><input ${!nameAttrSetting} type="${type}" value="${value}" dojoAttachPoint="valueNode"\n\t\t/></td></tr></tbody\n></table>'});
define("dijit/_HasDropDown",["dojo","dijit","dijit/_Widget"],function(d,b){d.declare("dijit._HasDropDown",null,{_buttonNode:null,_arrowWrapperNode:null,_popupStateNode:null,_aroundNode:null,dropDown:null,autoWidth:true,forceWidth:false,maxHeight:0,dropDownPosition:["below","above"],_stopClickEvents:true,_onDropDownMouseDown:function(a){if(!(this.disabled||this.readOnly)){d.stopEvent(a);this._docHandler=this.connect(d.doc,"onmouseup","_onDropDownMouseUp");this.toggleDropDown()}},_onDropDownMouseUp:function(a){a&&
this._docHandler&&this.disconnect(this._docHandler);var c=this.dropDown,e=false;if(a&&this._opened){var f=d.position(this._buttonNode,true);if(!(a.pageX>=f.x&&a.pageX<=f.x+f.w)||!(a.pageY>=f.y&&a.pageY<=f.y+f.h)){for(f=a.target;f&&!e;)if(d.hasClass(f,"dijitPopup"))e=true;else f=f.parentNode;if(e){f=a.target;if(c.onItemClick){for(var g;f&&!(g=b.byNode(f));)f=f.parentNode;g&&g.onClick&&g.getParent&&g.getParent().onItemClick(g,a)}return}}}this._opened&&c.focus&&c.autoFocus!==false&&window.setTimeout(d.hitch(c,
"focus"),1)},_onDropDownClick:function(a){this._stopClickEvents&&d.stopEvent(a)},buildRendering:function(){this.inherited(arguments);this._buttonNode=this._buttonNode||this.focusNode||this.domNode;this._popupStateNode=this._popupStateNode||this.focusNode||this._buttonNode;var a={after:this.isLeftToRight()?"Right":"Left",before:this.isLeftToRight()?"Left":"Right",above:"Up",below:"Down",left:"Left",right:"Right"}[this.dropDownPosition[0]]||this.dropDownPosition[0]||"Down";d.addClass(this._arrowWrapperNode||
this._buttonNode,"dijit"+a+"ArrowButton")},postCreate:function(){this.inherited(arguments);this.connect(this._buttonNode,"onmousedown","_onDropDownMouseDown");this.connect(this._buttonNode,"onclick","_onDropDownClick");this.connect(this.focusNode,"onkeypress","_onKey");this.connect(this.focusNode,"onkeyup","_onKeyUp")},destroy:function(){if(this.dropDown){this.dropDown._destroyed||this.dropDown.destroyRecursive();delete this.dropDown}this.inherited(arguments)},_onKey:function(a){if(!(this.disabled||
this.readOnly)){var c=this.dropDown,e=a.target;if(c&&this._opened&&c.handleKey)if(c.handleKey(a)===false){d.stopEvent(a);return}if(c&&this._opened&&a.charOrCode==d.keys.ESCAPE){this.closeDropDown();d.stopEvent(a)}else if(!this._opened&&(a.charOrCode==d.keys.DOWN_ARROW||(a.charOrCode==d.keys.ENTER||a.charOrCode==" ")&&((e.tagName||"").toLowerCase()!=="input"||e.type&&e.type.toLowerCase()!=="text"))){this._toggleOnKeyUp=true;d.stopEvent(a)}}},_onKeyUp:function(){if(this._toggleOnKeyUp){delete this._toggleOnKeyUp;
this.toggleDropDown();var a=this.dropDown;a&&a.focus&&setTimeout(d.hitch(a,"focus"),1)}},_onBlur:function(){this.closeDropDown(b._curFocus&&this.dropDown&&d.isDescendant(b._curFocus,this.dropDown.domNode));this.inherited(arguments)},isLoaded:function(){return true},loadDropDown:function(a){a()},toggleDropDown:function(){if(!(this.disabled||this.readOnly))if(this._opened)this.closeDropDown();else this.isLoaded()?this.openDropDown():this.loadDropDown(d.hitch(this,"openDropDown"))},openDropDown:function(){var a=
this.dropDown,c=a.domNode,e=this._aroundNode||this.domNode,f=this;if(!this._preparedNode){this._preparedNode=true;if(c.style.width)this._explicitDDWidth=true;if(c.style.height)this._explicitDDHeight=true}if(this.maxHeight||this.forceWidth||this.autoWidth){var g={display:"",visibility:"hidden"};if(!this._explicitDDWidth)g.width="";if(!this._explicitDDHeight)g.height="";d.style(c,g);g=this.maxHeight;if(g==-1){g=d.window.getBox();var i=d.position(e,false);g=Math.floor(Math.max(i.y,g.h-(i.y+i.h)))}a.startup&&
!a._started&&a.startup();b.popup.moveOffScreen(a);i=d._getMarginSize(c);var j=g&&i.h>g;d.style(c,{overflowX:"hidden",overflowY:j?"auto":"hidden"});if(j){i.h=g;if("w"in i)i.w+=16}else delete i.h;if(this.forceWidth)i.w=e.offsetWidth;else if(this.autoWidth)i.w=Math.max(i.w,e.offsetWidth);else delete i.w;d.isFunction(a.resize)?a.resize(i):d.marginBox(c,i)}a=b.popup.open({parent:this,popup:a,around:e,orient:b.getPopupAroundAlignment(this.dropDownPosition&&this.dropDownPosition.length?this.dropDownPosition:
["below"],this.isLeftToRight()),onExecute:function(){f.closeDropDown(true)},onCancel:function(){f.closeDropDown(true)},onClose:function(){d.attr(f._popupStateNode,"popupActive",false);d.removeClass(f._popupStateNode,"dijitHasDropDownOpen");f._opened=false}});d.attr(this._popupStateNode,"popupActive","true");d.addClass(f._popupStateNode,"dijitHasDropDownOpen");this._opened=true;return a},closeDropDown:function(a){if(this._opened){a&&this.focus();b.popup.close(this.dropDown);this._opened=false}}});
return b._HasDropDown});
define("dijit/form/Button",["dojo","dijit","text!dijit/form/templates/Button.html","text!dijit/form/templates/DropDownButton.html","text!dijit/form/templates/ComboButton.html","dijit/form/_FormWidget","dijit/_Container","dijit/_HasDropDown"],function(d,b){d.declare("dijit.form.Button",b.form._FormWidget,{label:"",showLabel:true,iconClass:"",type:"button",baseClass:"dijitButton",templateString:d.cache("dijit.form","templates/Button.html"),attributeMap:d.delegate(b.form._FormWidget.prototype.attributeMap,{value:"valueNode"}),
_onClick:function(a){if(this.disabled)return false;this._clicked();return this.onClick(a)},_onButtonClick:function(a){if(this._onClick(a)===false)a.preventDefault();else if(this.type=="submit"&&!(this.valueNode||this.focusNode).form)for(var c=this.domNode;c.parentNode;c=c.parentNode){var e=b.byNode(c);if(e&&typeof e._onSubmit=="function"){e._onSubmit(a);break}}else if(this.valueNode){this.valueNode.click();a.preventDefault()}},buildRendering:function(){this.inherited(arguments);d.setSelectable(this.focusNode,
false)},_fillContent:function(a){if(a&&(!this.params||!("label"in this.params)))this.set("label",a.innerHTML)},_setShowLabelAttr:function(a){this.containerNode&&d.toggleClass(this.containerNode,"dijitDisplayNone",!a);this._set("showLabel",a)},onClick:function(){return true},_clicked:function(){},setLabel:function(a){d.deprecated("dijit.form.Button.setLabel() is deprecated.  Use set('label', ...) instead.","","2.0");this.set("label",a)},_setLabelAttr:function(a){this._set("label",a);this.containerNode.innerHTML=
a;if(this.showLabel==false&&!this.params.title)this.titleNode.title=d.trim(this.containerNode.innerText||this.containerNode.textContent||"")},_setIconClassAttr:function(a){d.replaceClass(this.iconNode,a||"dijitNoIcon",this.iconClass||"dijitNoIcon");this._set("iconClass",a)}});d.declare("dijit.form.DropDownButton",[b.form.Button,b._Container,b._HasDropDown],{baseClass:"dijitDropDownButton",templateString:d.cache("dijit.form","templates/DropDownButton.html"),_fillContent:function(){if(this.srcNodeRef){var a=
d.query("*",this.srcNodeRef);b.form.DropDownButton.superclass._fillContent.call(this,a[0]);this.dropDownContainer=this.srcNodeRef}},startup:function(){if(!this._started){if(!this.dropDown&&this.dropDownContainer){var a=d.query("[widgetId]",this.dropDownContainer)[0];this.dropDown=b.byNode(a);delete this.dropDownContainer}this.dropDown&&b.popup.hide(this.dropDown);this.inherited(arguments)}},isLoaded:function(){var a=this.dropDown;return!!a&&(!a.href||a.isLoaded)},loadDropDown:function(){var a=this.dropDown;
if(a)if(this.isLoaded())this.openDropDown();else{var c=d.connect(a,"onLoad",this,function(){d.disconnect(c);this.openDropDown()});a.refresh()}},isFocusable:function(){return this.inherited(arguments)&&!this._mouseDown}});d.declare("dijit.form.ComboButton",b.form.DropDownButton,{templateString:d.cache("dijit.form","templates/ComboButton.html"),attributeMap:d.mixin(d.clone(b.form.Button.prototype.attributeMap),{id:"",tabIndex:["focusNode","titleNode"],title:"titleNode"}),optionsTitle:"",baseClass:"dijitComboButton",
cssStateNodes:{buttonNode:"dijitButtonNode",titleNode:"dijitButtonContents",_popupStateNode:"dijitDownArrowButton"},_focusedNode:null,_onButtonKeyPress:function(a){if(a.charOrCode==d.keys[this.isLeftToRight()?"RIGHT_ARROW":"LEFT_ARROW"]){b.focus(this._popupStateNode);d.stopEvent(a)}},_onArrowKeyPress:function(a){if(a.charOrCode==d.keys[this.isLeftToRight()?"LEFT_ARROW":"RIGHT_ARROW"]){b.focus(this.titleNode);d.stopEvent(a)}},focus:function(a){this.disabled||b.focus(a=="start"?this.titleNode:this._popupStateNode)}});
d.declare("dijit.form.ToggleButton",b.form.Button,{baseClass:"dijitToggleButton",checked:false,attributeMap:d.mixin(d.clone(b.form.Button.prototype.attributeMap),{checked:"focusNode"}),_clicked:function(){this.set("checked",!this.checked)},_setCheckedAttr:function(a,c){this._set("checked",a);d.attr(this.focusNode||this.domNode,"checked",a);b.setWaiState(this.focusNode||this.domNode,"pressed",a);this._handleOnChange(a,c)},setChecked:function(a){d.deprecated("setChecked("+a+") is deprecated. Use set('checked',"+
a+") instead.","","2.0");this.set("checked",a)},reset:function(){this._hasBeenBlurred=false;this.set("checked",this.params.checked||false)}});return b.form.Button});define("dijit/form/DropDownButton",["dojo","dijit","dijit/form/Button"],function(d,b){return b.form.DropDownButton});
define("orion/commands",["require","dojo","dijit","orion/util","dijit/Menu","dijit/form/DropDownButton","dijit/MenuItem","dijit/PopupMenuItem","dijit/MenuSeparator","dijit/Tooltip"],function(d,b,a,c){function e(h){this._domScope={};this._objectScope={};this._globalScope={};this._namedGroups={};this._activeBindings={};this._init(h)}function f(h){this._init(h)}function g(h,l,p,t,r){this.keyCode=typeof h==="string"?h.toUpperCase().charCodeAt(0):h;this.mod1=l!==undefined&&l!==null?l:false;this.mod2=p!==
undefined&&p!==null?p:false;this.mod3=t!==undefined&&t!==null?t:false;this.mod4=r!==undefined&&r!==null?r:false}var i=b.declare(a.MenuItem,{_onClick:function(){this.hrefCallback||this.inherited(arguments)}});e.prototype={_init:function(h){this._registry=h.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.page.command",this);this._selection=h.selection;b.connect(window.document,"onkeydown",b.hitch(this,function(l){l=l||window.event;var p=l.target.nodeName.toLowerCase();
if(p==="input")switch(l.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(p==="textarea")return;this._processKey(l)}))},_processKey:function(h){function l(s){if(window.document.all)s.keyCode=0;else{s.preventDefault();s.stopPropagation()}}for(var p in this._activeBindings)if(this._activeBindings[p]&&this._activeBindings[p].keyBinding&&
this._activeBindings[p].command)if(this._activeBindings[p].keyBinding.match(h)){var t=this._activeBindings[p],r=t.command;if(r.hrefCallback){l(h);h=r.hrefCallback.call(t.handler||window,t.items,p,t.userData);h.then?h.then(function(s){window.open(s)}):window.open(h);return}else if(r.callback){l(h);window.setTimeout(function(){r.callback.call(t.handler||window,t.items,p,null,t.userData)},0);return}}},getSelectionService:function(){return this._selection},showKeyBindings:function(h){for(var l in this._activeBindings)this._activeBindings[l]&&
this._activeBindings[l].keyBinding&&this._activeBindings[l].command&&b.place("<span>"+c.getUserKeyString(this._activeBindings[l].keyBinding)+" = "+this._activeBindings[l].command.name+"<br></span>",h,"last")},addCommand:function(h,l){switch(l){case "dom":this._domScope[h.id]=h;break;case "object":this._objectScope[h.id]=h;break;case "global":this._globalScope[h.id]=h;break;default:throw"unrecognized command scope "+l;}},addCommandGroup:function(h,l,p,t,r){var s=this._namedGroups;if(t)s=this._createEntryForPath(t);
if(s[h]){if(p)s[h].title=p;if(l)s[h].position=l;if(r)s[h].scopeId=r}else{s[h]={title:p,position:l,children:{},scopeId:r};s.sortedCommands=null}},_createEntryForPath:function(h){var l=this._namedGroups;if(h){h=h.split("/");for(var p=0;p<h.length;p++)if(h[p].length>1){l[h[p]]||(l[h[p]]={position:0,children:{}});l=l[h[p]].children}}return l},registerCommandContribution:function(h,l,p,t,r,s){t=this._createEntryForPath(t);t[h]={scopeId:p,position:l};if(r)if(l=this._domScope[h]||this._globalScope[h])this._activeBindings[h]=
{command:l,keyBinding:r,keyOnly:s};t.sortedCommands=null},_isLastChildSeparator:function(h,l){if(l==="image")return h.childNodes.length>0&&b.hasClass(h.childNodes[h.childNodes.length-1],"commandSeparator");if(l==="menu"){h=h.getChildren();return h.length>0&&h[h.length-1]instanceof a.MenuSeparator}return false},renderCommands:function(h,l,p,t,r,s,v,z,y,k){if(typeof h==="string")h=b.byId(h);if(p){var n;if(l==="object")n=this._objectScope;else if(l==="dom")n=this._domScope;else if(l==="global")n=this._globalScope;
else throw"Unrecognized command scope "+l;this._render(this._namedGroups,h,l,p,t,r,s,v,n,z,y,k);if(r==="image")this._isLastChildSeparator(h,r)&&h.removeChild(h.childNodes[h.childNodes.length-1]);else if(r==="menu")if(this._isLastChildSeparator(h,r)){p=h.getChildren()[h.getChildren().length-1];h.removeChild(p);p.destroy()}}else{var o=this;this._selection&&this._selection.getSelections(function(m){o.renderCommands(h,l,m,t,r,s,v,z,y,k)})}},_render:function(h,l,p,t,r,s,v,z,y,k,n,o){var m=h.sortedCommands;
if(!m){m=[];for(var q in h){var w=h[q];if(w&&typeof w.position==="number"){w.id=q;m.push(w)}}m.sort(function(D,F){return D.position-F.position});h.sortedCommands=m}for(h=0;h<m.length;h++){var u;if(m[h].children){q=m[h];if(!(q.scopeId&&l.id!==q.scopeId)){var x;if(s==="image")if(q.title){w=new a.Menu({style:"display: none;"});w.eclipseScopeId=l.eclipseScopeId||l.id;this._render(m[h].children,w,p,t,r,"menu",v,z,y,k,n,o);x=w.getChildren();if(this._isLastChildSeparator(w,"menu")){u=x[x.length-1];w.removeChild(u);
u.destroy();x=w.getChildren()}if(x.length>0){u=x[0].eclipseCommand;if(x.length>1){u=new a.form.DropDownButton({label:q.title,dropDown:w});b.addClass(u.domNode,"commandLink");v&&b.addClass(u.domNode,v);b.place(u.domNode,l,"last")}else{w="image"+u.id+h;q=u._asImage(w,t,r,z,v,k,n,o);b.place(q,l,"last")}}}else{var B;if(l.childNodes.length>0&&!this._isLastChildSeparator(l,s))B=this.generateSeparatorImage(l);this._render(m[h].children,l,p,t,r,s,v,z,y,k,n,o);if(l.childNodes.length>0)if(l.childNodes[l.childNodes.length-
1]!==B)B=this.generateSeparatorImage(l)}else if(q.title){w=new a.Menu;this._render(m[h].children,w,p,t,r,s,v,z,y,k,n,o);w.getChildren().length>0&&l.addChild(new a.PopupMenuItem({label:q.title,popup:w}))}else{var C;if(l.getChildren().length>0&&!this._isLastChildSeparator(l,s)){C=new a.MenuSeparator;l.addChild(C)}this._render(m[h].children,l,p,t,r,s,v,z,y,k,n,o);q=l.getChildren();if(q[q.length-1]!==C){C=new a.MenuSeparator;l.addChild(C)}}}}else{w=(q=y[m[h].id])?true:false;if(q){if(p==="dom")w=s==="image"?
l.id===m[h].scopeId:s==="menu"?l.eclipseScopeId===m[h].scopeId:false;if(this._activeBindings[q.id]&&this._activeBindings[q.id].keyBinding){u=this._activeBindings[q.id];u.items=t;u.userData=z;u.handler=r;if(u.keyOnly)w=false}if(w&&q.visibleWhen)w=q.visibleWhen(t)}if(w)if(q.choiceCallback){w=new a.Menu({style:"display: none;"});if(s==="image"){u=new a.form.DropDownButton({label:q.name,dropDown:w});if(q.image){b.addClass(u.iconNode,"commandImage");v&&b.addClass(u.iconNode,v);u.iconNode.src=q.image}b.place(u.domNode,
l,"last");u.eclipseCommand=q;u.eclipseChoices=w;b.connect(u,"onClick",u,function(){this.eclipseCommand.populateChoicesMenu(this.eclipseChoices,t,r,z)})}else if(s==="menu"){u=new a.PopupMenuItem({label:q.name,popup:w});l.addChild(u);u.eclipseCommand=q;u.eclipseChoices=w;b.connect(l,"_openPopup",u,function(){this.eclipseCommand.populateChoicesMenu(this.eclipseChoices,t,r,z)})}}else if(s==="image"){w="image"+q.id+h;q=q._asImage(w,t,r,z,v,k,n,o);b.place(q,l,"last")}else s==="menu"&&q._addMenuItem(l,t,
r,z,v)}}},generateSeparatorImage:function(h){h=b.create("span",null,h,"last");b.addClass(h,"core-sprite-sep");b.addClass(h,"commandImage");b.addClass(h,"commandSprite");b.addClass(h,"commandSeparator");return h}};e.prototype.constructor=e;f.prototype={_init:function(h){this.id=h.id;this.name=h.name||"Empty Command";this.tooltip=h.tooltip||h.name;this.callback=h.callback;this.hrefCallback=h.hrefCallback;this.choiceCallback=h.choiceCallback;this.image=h.image||d.toUrl("images/none.png");this.imageClass=
h.imageClass;this.spriteClass=h.spriteClass||"commandSprite";this.visibleWhen=h.visibleWhen;this._deviceSupportsHover=false},_asImage:function(h,l,p,t,r,s,v,z){p=p||this;var y=b.create("a");y.id=this.name+"link";var k=null;if(this.tooltip)y.title=this.tooltip;if(s||!this.hasImage()){h=window.document.createTextNode(this.name);b.place(h,y,"last")}else{k=new Image;k.alt=this.name;k.title=this.tooltip||this.name;k.name=h;k.id=h}if(this.hrefCallback){h=this.hrefCallback.call(p,l,this.id,t);if(h.then)h.then(function(n){y.href=
n});else y.href=h}else if(this.callback)k?b.connect(k,"onclick",this,function(){this.callback.call(p,l,this.id,k.id,t)}):b.connect(y,"onclick",this,function(){this.callback.call(p,l,this.id,y.id,t)});if(k){if(this._deviceSupportsHover){k.src=d.toUrl("images/none.png");b.connect(k,"onmouseover",this,function(){k.src=this.image});b.connect(k,"onmouseout",this,function(){k.src=d.toUrl("images/none.png")})}else{k.src=this.image;b.connect(k,"onmouseover",this,function(){v?b.addClass(k,v):b.addClass(k,
"commandOver")});b.connect(k,"onmouseout",this,function(){k.src=this.image;v?b.removeClass(k,v):b.removeClass(k,"commandOver")})}b.addClass(k,"commandImage");r&&b.addClass(k,r);if(this.imageClass){b.addClass(k,this.spriteClass);b.addClass(k,this.imageClass)}b.place(k,y,"last")}z?b.addClass(y,z):b.addClass(y,"commandLink");r&&b.addClass(y,r);return y},_asLink:function(h,l,p){l=l||this;var t=window.document.createElement("a");if(this.tooltip)t.title=this.tooltip;b.place(window.document.createTextNode(this.name),
t,"only");t.href="";t.id=this.id+"link";if(this.callback)b.connect(t,"onclick",this,function(){this.callback.call(l,h,this.id,t.id)});else if(this.hrefCallback){var r=this.hrefCallback.call(l,h,this.id);if(r)if(r.then)r.then(function(s){t.href=s});else t.href=r}b.addClass(t,"commandLink");p&&b.addClass(t,p);return t},_addMenuItem:function(h,l,p,t,r){var s=new i({labelType:this.hrefCallback?"html":"text",label:this.name,iconClass:this.imageClass,hrefCallback:!!this.hrefCallback});this.tooltip&&new a.Tooltip({connectId:[s.domNode],
label:this.tooltip});if(this.hrefCallback){var v=this.hrefCallback.call(p,l,this.id,h.id,t);if(v)v.then?v.then(b.hitch(this,function(z){s.set("label","<a href='"+z+"'>"+this.name+"</a>")})):s.set("label","<a href='"+v+"'>"+this.name+"</a>")}else if(this.callback)s.onClick=b.hitch(this,function(){this.callback.call(p,l,this.id,null,t)});s.eclipseCommand=this;h.addChild(s);if(this.imageClass)b.addClass(s.iconNode,this.spriteClass);else if(this.image){b.addClass(s.iconNode,"commandImage");r&&b.addClass(s.iconNode,
r);s.iconNode.src=this.image}},populateChoicesMenu:function(h,l,p,t){h.focusedChild=null;b.forEach(h.getChildren(),function(v){h.removeChild(v);v.destroy()});p=this.getChoices(l,p,t);for(t=0;t<p.length;t++){var r=p[t],s;if(r.name){s=new a.MenuItem({label:r.name,iconClass:r.imageClass,onClick:this.makeChoiceCallback(r,l)});if(r.imageClass)b.addClass(s.iconNode,r.spriteClass||"commandSprite");else if(r.image){b.addClass(s.iconNode,"commandImage");s.iconNode.src=r.image}}else s=new a.MenuSeparator;h.addChild(s)}},
getChoices:function(h,l,p){if(this.choiceCallback)return this.choiceCallback.call(l,h,p);return null},makeChoiceCallback:function(h,l){return function(p){h.callback&&h.callback.call(h,l,p)}},hasImage:function(){return this.imageClass||this.image!==d.toUrl("images/none.png")}};f.prototype.constructor=f;var j=window.navigator.platform.indexOf("Mac")!==-1;g.prototype={match:function(h){if(this.keyCode===h.keyCode){if(this.mod1!==(j?h.metaKey:h.ctrlKey))return false;if(this.mod2!==h.shiftKey)return false;
if(this.mod3!==h.altKey)return false;if(j&&this.mod4!==h.ctrlKey)return false;return true}return false},equals:function(h){if(!h)return false;if(this.keyCode!==h.keyCode)return false;if(this.mod1!==h.mod1)return false;if(this.mod2!==h.mod2)return false;if(this.mod3!==h.mod3)return false;if(this.mod4!==h.mod4)return false;return true}};g.prototype.constructor=g;return{CommandService:e,CommandKeyBinding:g,Command:f,CommandMenuItem:i}});var orion=orion||{};orion.textview=orion.textview||{};
orion.textview.KeyBinding=function(){function d(a,c,e,f,g){this.keyCode=typeof a==="string"?a.toUpperCase().charCodeAt(0):a;this.mod1=c!==undefined&&c!==null?c:false;this.mod2=e!==undefined&&e!==null?e:false;this.mod3=f!==undefined&&f!==null?f:false;this.mod4=g!==undefined&&g!==null?g:false}var b=window.navigator.platform.indexOf("Mac")!==-1;d.prototype={match:function(a){if(this.keyCode===a.keyCode){if(this.mod1!==(b?a.metaKey:a.ctrlKey))return false;if(this.mod2!==a.shiftKey)return false;if(this.mod3!==
a.altKey)return false;if(b&&this.mod4!==a.ctrlKey)return false;return true}return false},equals:function(a){if(!a)return false;if(this.keyCode!==a.keyCode)return false;if(this.mod1!==a.mod1)return false;if(this.mod2!==a.mod2)return false;if(this.mod3!==a.mod3)return false;if(this.mod4!==a.mod4)return false;return true}};return d}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/textview/keyBinding",[],function(){return orion.textview});
define("text!dijit/templates/Dialog.html",function(){return'<div class="dijitDialog" role="dialog" aria-labelledby="${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="ondijitclick: onCancel" title="${buttonCancel}" role="button" tabIndex="-1">\n\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t</span>\n\t</div>\n\t\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent"></div>\n</div>'});
define("dojo/dnd/common",["dojo"],function(d){d.getObject("dnd",true,d);d.dnd.getCopyKeyState=d.isCopyKey;d.dnd._uniqueId=0;d.dnd.getUniqueId=function(){var b;do b=d._scopeName+"Unique"+ ++d.dnd._uniqueId;while(d.byId(b));return b};d.dnd._empty={};d.dnd.isFormElement=function(b){b=b.target;if(b.nodeType==3)b=b.parentNode;return" button textarea input select option ".indexOf(" "+b.tagName.toLowerCase()+" ")>=0};return d.dnd});
define("dojo/dnd/autoscroll",["dojo","dojo/window"],function(d){d.getObject("dnd",true,d);d.dnd.getViewport=d.window.getBox;d.dnd.V_TRIGGER_AUTOSCROLL=32;d.dnd.H_TRIGGER_AUTOSCROLL=32;d.dnd.V_AUTOSCROLL_VALUE=16;d.dnd.H_AUTOSCROLL_VALUE=16;d.dnd.autoScroll=function(b){var a=d.window.getBox(),c=0,e=0;if(b.clientX<d.dnd.H_TRIGGER_AUTOSCROLL)c=-d.dnd.H_AUTOSCROLL_VALUE;else if(b.clientX>a.w-d.dnd.H_TRIGGER_AUTOSCROLL)c=d.dnd.H_AUTOSCROLL_VALUE;if(b.clientY<d.dnd.V_TRIGGER_AUTOSCROLL)e=-d.dnd.V_AUTOSCROLL_VALUE;
else if(b.clientY>a.h-d.dnd.V_TRIGGER_AUTOSCROLL)e=d.dnd.V_AUTOSCROLL_VALUE;window.scrollBy(c,e)};d.dnd._validNodes={div:1,p:1,td:1};d.dnd._validOverflow={auto:1,scroll:1};d.dnd.autoScrollNodes=function(b){for(var a=b.target;a;){if(a.nodeType==1&&a.tagName.toLowerCase()in d.dnd._validNodes){var c=d.getComputedStyle(a);if(c.overflow.toLowerCase()in d.dnd._validOverflow){var e=d._getContentBox(a,c);c=d.position(a,true);var f=Math.min(d.dnd.H_TRIGGER_AUTOSCROLL,e.w/2),g=Math.min(d.dnd.V_TRIGGER_AUTOSCROLL,
e.h/2),i=b.pageX-c.x,j=b.pageY-c.y,h=c=0;if(d.isWebKit||d.isOpera){i+=d.body().scrollLeft;j+=d.body().scrollTop}if(i>0&&i<e.w)if(i<f)c=-f;else if(i>e.w-f)c=f;if(j>0&&j<e.h)if(j<g)h=-g;else if(j>e.h-g)h=g;e=a.scrollLeft;f=a.scrollTop;a.scrollLeft+=c;a.scrollTop+=h;if(e!=a.scrollLeft||f!=a.scrollTop)return}}try{a=a.parentNode}catch(l){a=null}}d.dnd.autoScroll(b)};return d.dnd});
define("dojo/dnd/Mover",["dojo","dojo/dnd/common","dojo/dnd/autoscroll"],function(d){d.declare("dojo.dnd.Mover",null,{constructor:function(b,a,c){this.node=d.byId(b);var e=a.touches?a.touches[0]:a;this.marginBox={l:e.pageX,t:e.pageY};this.mouseButton=a.button;a=this.host=c;b=b.ownerDocument;this.events=[d.connect(b,"onmousemove",this,"onFirstMove"),d.connect(b,"ontouchmove",this,"onFirstMove"),d.connect(b,"onmousemove",this,"onMouseMove"),d.connect(b,"ontouchmove",this,"onMouseMove"),d.connect(b,
"onmouseup",this,"onMouseUp"),d.connect(b,"ontouchend",this,"onMouseUp"),d.connect(b,"ondragstart",d.stopEvent),d.connect(b.body,"onselectstart",d.stopEvent)];a&&a.onMoveStart&&a.onMoveStart(this)},onMouseMove:function(b){d.dnd.autoScroll(b);var a=this.marginBox,c=b.touches?b.touches[0]:b;this.host.onMove(this,{l:a.l+c.pageX,t:a.t+c.pageY},b);d.stopEvent(b)},onMouseUp:function(b){if(d.isWebKit&&d.isMac&&this.mouseButton==2?b.button==0:this.mouseButton==b.button)this.destroy();d.stopEvent(b)},onFirstMove:function(b){var a=
this.node.style,c,e=this.host;switch(a.position){case "relative":case "absolute":c=Math.round(parseFloat(a.left))||0;a=Math.round(parseFloat(a.top))||0;break;default:a.position="absolute";a=d.marginBox(this.node);c=d.doc.body;var f=d.getComputedStyle(c),g=d._getMarginBox(c,f);f=d._getContentBox(c,f);c=a.l-(f.l-g.l);a=a.t-(f.t-g.t);break}this.marginBox.l=c-this.marginBox.l;this.marginBox.t=a-this.marginBox.t;e&&e.onFirstMove&&e.onFirstMove(this,b);d.disconnect(this.events.shift());d.disconnect(this.events.shift())},
destroy:function(){d.forEach(this.events,d.disconnect);var b=this.host;b&&b.onMoveStop&&b.onMoveStop(this);this.events=this.node=this.host=null}});return d.dnd.Mover});
define("dojo/dnd/Moveable",["dojo","dojo/dnd/Mover"],function(d){d.declare("dojo.dnd.Moveable",null,{handle:"",delay:0,skip:false,constructor:function(b,a){this.node=d.byId(b);a||(a={});this.handle=a.handle?d.byId(a.handle):null;if(!this.handle)this.handle=this.node;this.delay=a.delay>0?a.delay:0;this.skip=a.skip;this.mover=a.mover?a.mover:d.dnd.Mover;this.events=[d.connect(this.handle,"onmousedown",this,"onMouseDown"),d.connect(this.handle,"ontouchstart",this,"onMouseDown"),d.connect(this.handle,
"ondragstart",this,"onSelectStart"),d.connect(this.handle,"onselectstart",this,"onSelectStart")]},markupFactory:function(b,a){return new d.dnd.Moveable(a,b)},destroy:function(){d.forEach(this.events,d.disconnect);this.events=this.node=this.handle=null},onMouseDown:function(b){if(!(this.skip&&d.dnd.isFormElement(b))){if(this.delay){this.events.push(d.connect(this.handle,"onmousemove",this,"onMouseMove"),d.connect(this.handle,"ontouchmove",this,"onMouseMove"),d.connect(this.handle,"onmouseup",this,
"onMouseUp"),d.connect(this.handle,"ontouchend",this,"onMouseUp"));var a=b.touches?b.touches[0]:b;this._lastX=a.pageX;this._lastY=a.pageY}else this.onDragDetected(b);d.stopEvent(b)}},onMouseMove:function(b){var a=b.touches?b.touches[0]:b;if(Math.abs(a.pageX-this._lastX)>this.delay||Math.abs(a.pageY-this._lastY)>this.delay){this.onMouseUp(b);this.onDragDetected(b)}d.stopEvent(b)},onMouseUp:function(b){for(var a=0;a<2;++a)d.disconnect(this.events.pop());d.stopEvent(b)},onSelectStart:function(b){if(!this.skip||
!d.dnd.isFormElement(b))d.stopEvent(b)},onDragDetected:function(b){new this.mover(this.node,b,this)},onMoveStart:function(b){d.publish("/dnd/move/start",[b]);d.addClass(d.body(),"dojoMove");d.addClass(this.node,"dojoMoveItem")},onMoveStop:function(b){d.publish("/dnd/move/stop",[b]);d.removeClass(d.body(),"dojoMove");d.removeClass(this.node,"dojoMoveItem")},onFirstMove:function(){},onMove:function(b,a){this.onMoving(b,a);var c=b.node.style;c.left=a.l+"px";c.top=a.t+"px";this.onMoved(b,a)},onMoving:function(){},
onMoved:function(){}});return d.dnd.Moveable});
define("dojo/dnd/move",["dojo","dojo/dnd/Mover","dojo/dnd/Moveable"],function(d){d.declare("dojo.dnd.move.constrainedMoveable",d.dnd.Moveable,{constraints:function(){},within:false,markupFactory:function(b,a){return new d.dnd.move.constrainedMoveable(a,b)},constructor:function(b,a){a||(a={});this.constraints=a.constraints;this.within=a.within},onFirstMove:function(b){var a=this.constraintBox=this.constraints.call(this,b);a.r=a.l+a.w;a.b=a.t+a.h;if(this.within){b=d._getMarginSize(b.node);a.r-=b.w;
a.b-=b.h}},onMove:function(b,a){var c=this.constraintBox,e=b.node.style;this.onMoving(b,a);a.l=a.l<c.l?c.l:c.r<a.l?c.r:a.l;a.t=a.t<c.t?c.t:c.b<a.t?c.b:a.t;e.left=a.l+"px";e.top=a.t+"px";this.onMoved(b,a)}});d.declare("dojo.dnd.move.boxConstrainedMoveable",d.dnd.move.constrainedMoveable,{box:{},markupFactory:function(b,a){return new d.dnd.move.boxConstrainedMoveable(a,b)},constructor:function(b,a){var c=a&&a.box;this.constraints=function(){return c}}});d.declare("dojo.dnd.move.parentConstrainedMoveable",
d.dnd.move.constrainedMoveable,{area:"content",markupFactory:function(b,a){return new d.dnd.move.parentConstrainedMoveable(a,b)},constructor:function(b,a){var c=a&&a.area;this.constraints=function(){var e=this.node.parentNode,f=d.getComputedStyle(e),g=d._getMarginBox(e,f);if(c=="margin")return g;var i=d._getMarginExtents(e,f);g.l+=i.l;g.t+=i.t;g.w-=i.w;g.h-=i.h;if(c=="border")return g;i=d._getBorderExtents(e,f);g.l+=i.l;g.t+=i.t;g.w-=i.w;g.h-=i.h;if(c=="padding")return g;i=d._getPadExtents(e,f);g.l+=
i.l;g.t+=i.t;g.w-=i.w;g.h-=i.h;return g}}});d.dnd.constrainedMover=d.dnd.move.constrainedMover;d.dnd.boxConstrainedMover=d.dnd.move.boxConstrainedMover;d.dnd.parentConstrainedMover=d.dnd.move.parentConstrainedMover;return d.dnd.move});
define("dojo/dnd/TimedMoveable",["dojo","dojo/dnd/Moveable"],function(d){(function(){var b=d.dnd.Moveable.prototype.onMove;d.declare("dojo.dnd.TimedMoveable",d.dnd.Moveable,{timeout:40,constructor:function(a,c){c||(c={});if(c.timeout&&typeof c.timeout=="number"&&c.timeout>=0)this.timeout=c.timeout},markupFactory:function(a,c){return new d.dnd.TimedMoveable(c,a)},onMoveStop:function(a){if(a._timer){clearTimeout(a._timer);b.call(this,a,a._leftTop)}d.dnd.Moveable.prototype.onMoveStop.apply(this,arguments)},
onMove:function(a,c){a._leftTop=c;if(!a._timer){var e=this;a._timer=setTimeout(function(){a._timer=null;b.call(e,a,a._leftTop)},this.timeout)}}})})();return d.dnd.TimedMoveable});
define("dojo/fx/Toggler",["dojo"],function(d){d.declare("dojo.fx.Toggler",null,{node:null,showFunc:d.fadeIn,hideFunc:d.fadeOut,showDuration:200,hideDuration:200,constructor:function(b){var a=this;d.mixin(a,b);a.node=b.node;a._showArgs=d.mixin({},b);a._showArgs.node=a.node;a._showArgs.duration=a.showDuration;a.showAnim=a.showFunc(a._showArgs);a._hideArgs=d.mixin({},b);a._hideArgs.node=a.node;a._hideArgs.duration=a.hideDuration;a.hideAnim=a.hideFunc(a._hideArgs);d.connect(a.showAnim,"beforeBegin",d.hitch(a.hideAnim,
"stop",true));d.connect(a.hideAnim,"beforeBegin",d.hitch(a.showAnim,"stop",true))},show:function(b){return this.showAnim.play(b||0)},hide:function(b){return this.hideAnim.play(b||0)}});return d.fx.Toggler});
define("dojo/fx",["dojo","dojo/fx/Toggler"],function(d){(function(){var b={_fire:function(e,f){if(this[e])this[e].apply(this,f||[]);return this}},a=function(e){this._index=-1;this._animations=e||[];this._current=this._onAnimateCtx=this._onEndCtx=null;this.duration=0;d.forEach(this._animations,function(f){this.duration+=f.duration;if(f.delay)this.duration+=f.delay},this)};d.extend(a,{_onAnimate:function(){this._fire("onAnimate",arguments)},_onEnd:function(){d.disconnect(this._onAnimateCtx);d.disconnect(this._onEndCtx);
this._onAnimateCtx=this._onEndCtx=null;if(this._index+1==this._animations.length)this._fire("onEnd");else{this._current=this._animations[++this._index];this._onAnimateCtx=d.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd");this._current.play(0,true)}},play:function(e,f){if(!this._current)this._current=this._animations[this._index=0];if(!f&&this._current.status()=="playing")return this;var g=d.connect(this._current,"beforeBegin",this,
function(){this._fire("beforeBegin")}),i=d.connect(this._current,"onBegin",this,function(){this._fire("onBegin",arguments)}),j=d.connect(this._current,"onPlay",this,function(){this._fire("onPlay",arguments);d.disconnect(g);d.disconnect(i);d.disconnect(j)});this._onAnimateCtx&&d.disconnect(this._onAnimateCtx);this._onAnimateCtx=d.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx&&d.disconnect(this._onEndCtx);this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd");this._current.play.apply(this._current,
arguments);return this},pause:function(){if(this._current){var e=d.connect(this._current,"onPause",this,function(){this._fire("onPause",arguments);d.disconnect(e)});this._current.pause()}return this},gotoPercent:function(e,f){this.pause();var g=this.duration*e;this._current=null;d.some(this._animations,function(i){if(i.duration<=g){this._current=i;return true}g-=i.duration;return false});this._current&&this._current.gotoPercent(g/this._current.duration,f);return this},stop:function(e){if(this._current){if(e){for(;this._index+
1<this._animations.length;++this._index)this._animations[this._index].stop(true);this._current=this._animations[this._index]}var f=d.connect(this._current,"onStop",this,function(){this._fire("onStop",arguments);d.disconnect(f)});this._current.stop()}return this},status:function(){return this._current?this._current.status():"stopped"},destroy:function(){this._onAnimateCtx&&d.disconnect(this._onAnimateCtx);this._onEndCtx&&d.disconnect(this._onEndCtx)}});d.extend(a,b);d.fx.chain=function(e){return new a(e)};
var c=function(e){this._animations=e||[];this._connects=[];this.duration=this._finished=0;d.forEach(e,function(g){var i=g.duration;if(g.delay)i+=g.delay;if(this.duration<i)this.duration=i;this._connects.push(d.connect(g,"onEnd",this,"_onEnd"))},this);this._pseudoAnimation=new d.Animation({curve:[0,1],duration:this.duration});var f=this;d.forEach(["beforeBegin","onBegin","onPlay","onAnimate","onPause","onStop","onEnd"],function(g){f._connects.push(d.connect(f._pseudoAnimation,g,function(){f._fire(g,
arguments)}))})};d.extend(c,{_doAction:function(e,f){d.forEach(this._animations,function(g){g[e].apply(g,f)});return this},_onEnd:function(){++this._finished>this._animations.length&&this._fire("onEnd")},_call:function(e,f){var g=this._pseudoAnimation;g[e].apply(g,f)},play:function(){this._finished=0;this._doAction("play",arguments);this._call("play",arguments);return this},pause:function(){this._doAction("pause",arguments);this._call("pause",arguments);return this},gotoPercent:function(e,f){var g=
this.duration*e;d.forEach(this._animations,function(i){i.gotoPercent(i.duration<g?1:g/i.duration,f)});this._call("gotoPercent",arguments);return this},stop:function(){this._doAction("stop",arguments);this._call("stop",arguments);return this},status:function(){return this._pseudoAnimation.status()},destroy:function(){d.forEach(this._connects,d.disconnect)}});d.extend(c,b);d.fx.combine=function(e){return new c(e)};d.fx.wipeIn=function(e){var f=e.node=d.byId(e.node),g=f.style,i;e=d.animateProperty(d.mixin({properties:{height:{start:function(){i=
g.overflow;g.overflow="hidden";if(g.visibility=="hidden"||g.display=="none"){g.height="1px";g.display="";g.visibility="";return 1}else{var j=d.style(f,"height");return Math.max(j,1)}},end:function(){return f.scrollHeight}}}},e));d.connect(e,"onEnd",function(){g.height="auto";g.overflow=i});return e};d.fx.wipeOut=function(e){var f=(e.node=d.byId(e.node)).style,g;e=d.animateProperty(d.mixin({properties:{height:{end:1}}},e));d.connect(e,"beforeBegin",function(){g=f.overflow;f.overflow="hidden";f.display=
""});d.connect(e,"onEnd",function(){f.overflow=g;f.height="auto";f.display="none"});return e};d.fx.slideTo=function(e){var f=null,g=null,i=function(j){return function(){var h=d.getComputedStyle(j),l=h.position;f=l=="absolute"?j.offsetTop:parseInt(h.top)||0;g=l=="absolute"?j.offsetLeft:parseInt(h.left)||0;if(l!="absolute"&&l!="relative"){h=d.position(j,true);f=h.y;g=h.x;j.style.position="absolute";j.style.top=f+"px";j.style.left=g+"px"}}}(e.node=d.byId(e.node));i();e=d.animateProperty(d.mixin({properties:{top:e.top||
0,left:e.left||0}},e));d.connect(e,"beforeBegin",e,i);return e}})();return d.fx});
define("dijit/form/_FormMixin",["dojo","dijit","dojo/window"],function(d,b){d.declare("dijit.form._FormMixin",null,{state:"",reset:function(){d.forEach(this.getDescendants(),function(a){a.reset&&a.reset()})},validate:function(){var a=false;return d.every(d.map(this.getDescendants(),function(c){c._hasBeenBlurred=true;var e=c.disabled||!c.validate||c.validate();if(!e&&!a){d.window.scrollIntoView(c.containerNode||c.domNode);c.focus();a=true}return e}),function(c){return c})},setValues:function(a){d.deprecated(this.declaredClass+
"::setValues() is deprecated. Use set('value', val) instead.","","2.0");return this.set("value",a)},_setValueAttr:function(a){var c={};d.forEach(this.getDescendants(),function(i){if(i.name)(c[i.name]||(c[i.name]=[])).push(i)});for(var e in c)if(c.hasOwnProperty(e)){var f=c[e],g=d.getObject(e,false,a);if(g!==undefined){d.isArray(g)||(g=[g]);if(typeof f[0].checked=="boolean")d.forEach(f,function(i){i.set("value",d.indexOf(g,i.value)!=-1)});else f[0].multiple?f[0].set("value",g):d.forEach(f,function(i,
j){i.set("value",g[j])})}}},getValues:function(){d.deprecated(this.declaredClass+"::getValues() is deprecated. Use get('value') instead.","","2.0");return this.get("value")},_getValueAttr:function(){var a={};d.forEach(this.getDescendants(),function(c){var e=c.name;if(!(!e||c.disabled)){var f=c.get("value");if(typeof c.checked=="boolean")if(/Radio/.test(c.declaredClass))if(f!==false)d.setObject(e,f,a);else{f=d.getObject(e,false,a);f===undefined&&d.setObject(e,null,a)}else{c=d.getObject(e,false,a);
if(!c){c=[];d.setObject(e,c,a)}f!==false&&c.push(f)}else{c=d.getObject(e,false,a);if(typeof c!="undefined")d.isArray(c)?c.push(f):d.setObject(e,[c,f],a);else d.setObject(e,f,a)}}});return a},isValid:function(){return this.state==""},onValidStateChange:function(){},_getState:function(){var a=d.map(this._descendants,function(c){return c.get("state")||""});return d.indexOf(a,"Error")>=0?"Error":d.indexOf(a,"Incomplete")>=0?"Incomplete":""},disconnectChildren:function(){d.forEach(this._childConnections||
[],d.hitch(this,"disconnect"));d.forEach(this._childWatches||[],function(a){a.unwatch()})},connectChildren:function(a){var c=this;this.disconnectChildren();this._descendants=this.getDescendants();a=a?function(i,j){c[i]=j}:d.hitch(this,"_set");a("value",this.get("value"));a("state",this._getState());var e=this._childConnections=[],f=this._childWatches=[];d.forEach(d.filter(this._descendants,function(i){return i.validate}),function(i){d.forEach(["state","disabled"],function(j){f.push(i.watch(j,function(){c.set("state",
c._getState())}))})});var g=function(){c._onChangeDelayTimer&&clearTimeout(c._onChangeDelayTimer);c._onChangeDelayTimer=setTimeout(function(){delete c._onChangeDelayTimer;c._set("value",c.get("value"))},10)};d.forEach(d.filter(this._descendants,function(i){return i.onChange}),function(i){e.push(c.connect(i,"onChange",g));f.push(i.watch("disabled",g))})},startup:function(){this.inherited(arguments);this.connectChildren(true);this.watch("state",function(a,c,e){this.onValidStateChange(e=="")})},destroy:function(){this.disconnectChildren();
this.inherited(arguments)}});return b.form._FormMixin});
define("dijit/_DialogMixin",["dojo","dijit","dijit/_Widget"],function(d,b){d.declare("dijit._DialogMixin",null,{attributeMap:b._Widget.prototype.attributeMap,execute:function(){},onCancel:function(){},onExecute:function(){},_onSubmit:function(){this.onExecute();this.execute(this.get("value"))},_getFocusItems:function(){var a=b._getTabNavigable(this.containerNode);this._firstFocusItem=a.lowest||a.first||this.closeButtonNode||this.domNode;this._lastFocusItem=a.last||a.highest||this._firstFocusItem}});
return b._DialogMixin});
define("dijit/DialogUnderlay",["dojo","dijit","dojo/window","dijit/_Widget","dijit/_Templated"],function(d,b){d.declare("dijit.DialogUnderlay",[b._Widget,b._Templated],{templateString:"<div class='dijitDialogUnderlayWrapper'><div class='dijitDialogUnderlay' dojoAttachPoint='node'></div></div>",dialogId:"","class":"",attributeMap:{id:"domNode"},_setDialogIdAttr:function(a){d.attr(this.node,"id",a+"_underlay");this._set("dialogId",a)},_setClassAttr:function(a){this.node.className="dijitDialogUnderlay "+
a;this._set("class",a)},postCreate:function(){d.body().appendChild(this.domNode)},layout:function(){var a=this.node.style,c=this.domNode.style;c.display="none";var e=d.window.getBox();c.top=e.t+"px";c.left=e.l+"px";a.width=e.w+"px";a.height=e.h+"px";c.display="block"},show:function(){this.domNode.style.display="block";this.layout();this.bgIframe=new b.BackgroundIframe(this.domNode)},hide:function(){this.bgIframe.destroy();delete this.bgIframe;this.domNode.style.display="none"}});return b.DialogUnderlay});
define("dijit/layout/_LayoutWidget",["dojo","dijit","dijit/_Widget","dijit/_Container","dijit/_Contained"],function(d,b){d.declare("dijit.layout._LayoutWidget",[b._Widget,b._Container,b._Contained],{baseClass:"dijitLayoutContainer",isLayoutContainer:true,buildRendering:function(){this.inherited(arguments);d.addClass(this.domNode,"dijitContainer")},startup:function(){if(!this._started){this.inherited(arguments);var a=this.getParent&&this.getParent();if(!(a&&a.isLayoutContainer)){this.resize();this.connect(d.isIE?
this.domNode:d.global,"onresize",function(){this.resize()})}}},resize:function(a,c){var e=this.domNode;if(a){d.marginBox(e,a);if(a.t)e.style.top=a.t+"px";if(a.l)e.style.left=a.l+"px"}c=c||{};d.mixin(c,a||{});if(!("h"in c)||!("w"in c))c=d.mixin(d.marginBox(e),c);a=d.getComputedStyle(e);var f=d._getMarginExtents(e,a),g=d._getBorderExtents(e,a);c=this._borderBox={w:c.w-(f.w+g.w),h:c.h-(f.h+g.h)};f=d._getPadExtents(e,a);this._contentBox={l:d._toPixelValue(e,a.paddingLeft),t:d._toPixelValue(e,a.paddingTop),
w:c.w-f.w,h:c.h-f.h};this.layout()},layout:function(){},_setupChild:function(a){d.addClass(a.domNode,this.baseClass+"-child "+(a.baseClass?this.baseClass+"-"+a.baseClass:""))},addChild:function(a){this.inherited(arguments);this._started&&this._setupChild(a)},removeChild:function(a){d.removeClass(a.domNode,this.baseClass+"-child"+(a.baseClass?" "+this.baseClass+"-"+a.baseClass:""));this.inherited(arguments)}});b.layout.marginBox2contentBox=function(a,c){var e=d.getComputedStyle(a),f=d._getMarginExtents(a,
e),g=d._getPadBorderExtents(a,e);return{l:d._toPixelValue(a,e.paddingLeft),t:d._toPixelValue(a,e.paddingTop),w:c.w-(f.w+g.w),h:c.h-(f.h+g.h)}};(function(){var a=function(e){return e.substring(0,1).toUpperCase()+e.substring(1)},c=function(e,f){var g=e.resize?e.resize(f):d.marginBox(e.domNode,f);if(g)d.mixin(e,g);else{d.mixin(e,d.marginBox(e.domNode));d.mixin(e,f)}};b.layout.layoutChildren=function(e,f,g,i,j){f=d.mixin({},f);d.addClass(e,"dijitLayoutContainer");g=d.filter(g,function(h){return h.region!=
"center"&&h.layoutAlign!="client"}).concat(d.filter(g,function(h){return h.region=="center"||h.layoutAlign=="client"}));d.forEach(g,function(h){var l=h.domNode,p=h.region||h.layoutAlign,t=l.style;t.left=f.l+"px";t.top=f.t+"px";t.position="absolute";d.addClass(l,"dijitAlign"+a(p));l={};if(i&&i==h.id)l[h.region=="top"||h.region=="bottom"?"h":"w"]=j;if(p=="top"||p=="bottom"){l.w=f.w;c(h,l);f.h-=h.h;if(p=="top")f.t+=h.h;else t.top=f.t+f.h+"px"}else if(p=="left"||p=="right"){l.h=f.h;c(h,l);f.w-=h.w;if(p==
"left")f.l+=h.w;else t.left=f.l+f.w+"px"}else if(p=="client"||p=="center")c(h,f)})}})();return b.layout._LayoutWidget});
define("dijit/layout/_ContentPaneResizeMixin",["dojo","dijit","dijit/_Contained","dijit/layout/_LayoutWidget"],function(d,b){d.declare("dijit.layout._ContentPaneResizeMixin",null,{doLayout:true,isContainer:true,isLayoutContainer:true,_startChildren:function(){d.forEach(this.getChildren(),function(a){a.startup();a._started=true})},startup:function(){if(!this._started){var a=b._Contained.prototype.getParent.call(this);this._childOfLayoutWidget=a&&a.isLayoutContainer;this._needLayout=!this._childOfLayoutWidget;
this.inherited(arguments);this._startChildren();this._isShown()&&this._onShow();this._childOfLayoutWidget||this.connect(d.isIE?this.domNode:d.global,"onresize",function(){this._needLayout=!this._childOfLayoutWidget;this.resize()})}},_checkIfSingleChild:function(){var a=d.query("> *",this.containerNode).filter(function(f){return f.tagName!=="SCRIPT"}),c=a.filter(function(f){return d.hasAttr(f,"data-dojo-type")||d.hasAttr(f,"dojoType")||d.hasAttr(f,"widgetId")}),e=d.filter(c.map(b.byNode),function(f){return f&&
f.domNode&&f.resize});if(a.length==c.length&&e.length==1)this._singleChild=e[0];else delete this._singleChild;d.toggleClass(this.containerNode,this.baseClass+"SingleChild",!!this._singleChild)},resize:function(a,c){!this._wasShown&&this.open!==false&&this._onShow();this._resizeCalled=true;this._scheduleLayout(a,c)},_scheduleLayout:function(a,c){if(this._isShown())this._layout(a,c);else{this._needLayout=true;this._changeSize=a;this._resultSize=c}},_layout:function(a,c){a&&d.marginBox(this.domNode,
a);var e=this.containerNode;if(e===this.domNode){c=c||{};d.mixin(c,a||{});if(!("h"in c)||!("w"in c))c=d.mixin(d.marginBox(e),c);this._contentBox=b.layout.marginBox2contentBox(e,c)}else this._contentBox=d.contentBox(e);this._layoutChildren();delete this._needLayout},_layoutChildren:function(){this.doLayout&&this._checkIfSingleChild();if(this._singleChild&&this._singleChild.resize){var a=this._contentBox||d.contentBox(this.containerNode);this._singleChild.resize({w:a.w,h:a.h})}else d.forEach(this.getChildren(),
function(c){c.resize&&c.resize()})},_isShown:function(){if(this._childOfLayoutWidget){if(this._resizeCalled&&"open"in this)return this.open;return this._resizeCalled}else if("open"in this)return this.open;else{var a=this.domNode,c=this.domNode.parentNode;return a.style.display!="none"&&a.style.visibility!="hidden"&&!d.hasClass(a,"dijitHidden")&&c&&c.style&&c.style.display!="none"}},_onShow:function(){this._needLayout&&this._layout(this._changeSize,this._resultSize);this.inherited(arguments);this._wasShown=
true}});return b.layout._ContentPaneResizeMixin});
define("dojo/html",["dojo","dojo/parser"],function(d){d.getObject("html",true,d);(function(){var b=0;d.html._secureForInnerHtml=function(a){return a.replace(/(?:\s*<!DOCTYPE\s[^>]+>|<title[^>]*>[\s\S]*?<\/title>)/ig,"")};d.html._emptyNode=d.empty;d.html._setNodeContent=function(a,c){d.empty(a);if(c){if(typeof c=="string")c=d._toDom(c,a.ownerDocument);if(!c.nodeType&&d.isArrayLike(c))for(var e=c.length,f=0;f<c.length;f=e==c.length?f+1:0)d.place(c[f],a,"last");else d.place(c,a,"last")}return a};d.declare("dojo.html._ContentSetter",
null,{node:"",content:"",id:"",cleanContent:false,extractContent:false,parseContent:false,parserScope:d._scopeName,startup:true,constructor:function(a,c){d.mixin(this,a||{});c=this.node=d.byId(this.node||c);if(!this.id)this.id=["Setter",c?c.id||c.tagName:"",b++].join("_")},set:function(a,c){if(undefined!==a)this.content=a;c&&this._mixin(c);this.onBegin();this.setContent();this.onEnd();return this.node},setContent:function(){var a=this.node;if(!a)throw new Error(this.declaredClass+": setContent given no node");
try{a=d.html._setNodeContent(a,this.content)}catch(c){var e=this.onContentError(c);try{a.innerHTML=e}catch(f){console.error("Fatal "+this.declaredClass+".setContent could not change content due to "+f.message,f)}}this.node=a},empty:function(){if(this.parseResults&&this.parseResults.length){d.forEach(this.parseResults,function(a){a.destroy&&a.destroy()});delete this.parseResults}d.html._emptyNode(this.node)},onBegin:function(){var a=this.content;if(d.isString(a)){if(this.cleanContent)a=d.html._secureForInnerHtml(a);
if(this.extractContent){var c=a.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);if(c)a=c[1]}}this.empty();this.content=a;return this.node},onEnd:function(){this.parseContent&&this._parse();return this.node},tearDown:function(){delete this.parseResults;delete this.node;delete this.content},onContentError:function(a){return"Error occured setting content: "+a},_mixin:function(a){var c={},e;for(e in a)e in c||(this[e]=a[e])},_parse:function(){var a=this.node;try{var c={};d.forEach(["dir","lang","textDir"],
function(f){if(this[f])c[f]=this[f]},this);this.parseResults=d.parser.parse({rootNode:a,noStart:!this.startup,inherited:c,scope:this.parserScope})}catch(e){this._onError("Content",e,"Error parsing in _ContentSetter#"+this.id)}},_onError:function(a,c,e){a=this["on"+a+"Error"].call(this,c);if(e)console.error(e,c);else a&&d.html._setNodeContent(this.node,a,true)}});d.html.set=function(a,c,e){if(undefined==c){console.warn("dojo.html.set: no cont argument provided, using empty string");c=""}return e?(new d.html._ContentSetter(d.mixin(e,
{content:c,node:a}))).set():d.html._setNodeContent(a,c,true)}})();return d.html});define("dijit/nls/loading",{root:{loadingState:"Loading...",errorState:"Sorry, an error occurred"},zh:true,"zh-tw":true,tr:true,th:true,sv:true,sl:true,sk:true,ru:true,ro:true,pt:true,"pt-pt":true,pl:true,nl:true,nb:true,ko:true,kk:true,ja:true,it:true,hu:true,he:true,fr:true,fi:true,es:true,el:true,de:true,da:true,cs:true,ca:true,ar:true});
define("dijit/layout/ContentPane",["dojo","dijit","dijit/_Widget","dijit/layout/_ContentPaneResizeMixin","dojo/string","dojo/html","i18n!dijit/nls/loading"],function(d,b){d.declare("dijit.layout.ContentPane",[b._Widget,b.layout._ContentPaneResizeMixin],{href:"",extractContent:false,parseOnLoad:true,parserScope:d._scopeName,preventCache:false,preload:false,refreshOnShow:false,loadingMessage:"<span class='dijitContentPaneLoading'>${loadingState}</span>",errorMessage:"<span class='dijitContentPaneError'>${errorState}</span>",
isLoaded:false,baseClass:"dijitContentPane",ioArgs:{},onLoadDeferred:null,attributeMap:d.delegate(b._Widget.prototype.attributeMap,{title:[]}),stopParser:true,template:false,create:function(a,c){if((!a||!a.template)&&c&&!("href"in a)&&!("content"in a)){var e=d.doc.createDocumentFragment();for(c=d.byId(c);c.firstChild;)e.appendChild(c.firstChild);a=d.delegate(a,{content:e})}this.inherited(arguments,[a,c])},postMixInProperties:function(){this.inherited(arguments);var a=d.i18n.getLocalization("dijit",
"loading",this.lang);this.loadingMessage=d.string.substitute(this.loadingMessage,a);this.errorMessage=d.string.substitute(this.errorMessage,a)},buildRendering:function(){this.inherited(arguments);if(!this.containerNode)this.containerNode=this.domNode;this.domNode.title="";d.attr(this.domNode,"role")||b.setWaiRole(this.domNode,"group")},_startChildren:function(){this.inherited(arguments);this._contentSetter&&d.forEach(this._contentSetter.parseResults,function(a){if(!a._started&&!a._destroyed&&d.isFunction(a.startup)){a.startup();
a._started=true}},this)},setHref:function(a){d.deprecated("dijit.layout.ContentPane.setHref() is deprecated. Use set('href', ...) instead.","","2.0");return this.set("href",a)},_setHrefAttr:function(a){this.cancel();this.onLoadDeferred=new d.Deferred(d.hitch(this,"cancel"));this.onLoadDeferred.addCallback(d.hitch(this,"onLoad"));this._set("href",a);if(this.preload||this._created&&this._isShown())this._load();else this._hrefChanged=true;return this.onLoadDeferred},setContent:function(a){d.deprecated("dijit.layout.ContentPane.setContent() is deprecated.  Use set('content', ...) instead.",
"","2.0");this.set("content",a)},_setContentAttr:function(a){this._set("href","");this.cancel();this.onLoadDeferred=new d.Deferred(d.hitch(this,"cancel"));this._created&&this.onLoadDeferred.addCallback(d.hitch(this,"onLoad"));this._setContent(a||"");this._isDownloaded=false;return this.onLoadDeferred},_getContentAttr:function(){return this.containerNode.innerHTML},cancel:function(){this._xhrDfd&&this._xhrDfd.fired==-1&&this._xhrDfd.cancel();delete this._xhrDfd;this.onLoadDeferred=null},uninitialize:function(){this._beingDestroyed&&
this.cancel();this.inherited(arguments)},destroyRecursive:function(){this._beingDestroyed||this.inherited(arguments)},_onShow:function(){this.inherited(arguments);if(this.href)if(!this._xhrDfd&&(!this.isLoaded||this._hrefChanged||this.refreshOnShow))return this.refresh()},refresh:function(){this.cancel();this.onLoadDeferred=new d.Deferred(d.hitch(this,"cancel"));this.onLoadDeferred.addCallback(d.hitch(this,"onLoad"));this._load();return this.onLoadDeferred},_load:function(){this._setContent(this.onDownloadStart(),
true);var a=this,c={preventCache:this.preventCache||this.refreshOnShow,url:this.href,handleAs:"text"};d.isObject(this.ioArgs)&&d.mixin(c,this.ioArgs);var e=this._xhrDfd=(this.ioMethod||d.xhrGet)(c);e.addCallback(function(f){try{a._isDownloaded=true;a._setContent(f,false);a.onDownloadEnd()}catch(g){a._onError("Content",g)}delete a._xhrDfd;return f});e.addErrback(function(f){e.canceled||a._onError("Download",f);delete a._xhrDfd;return f});delete this._hrefChanged},_onLoadHandler:function(a){this._set("isLoaded",
true);try{this.onLoadDeferred.callback(a)}catch(c){console.error("Error "+this.widgetId+" running custom onLoad code: "+c.message)}},_onUnloadHandler:function(){this._set("isLoaded",false);try{this.onUnload()}catch(a){console.error("Error "+this.widgetId+" running custom onUnload code: "+a.message)}},destroyDescendants:function(){this.isLoaded&&this._onUnloadHandler();var a=this._contentSetter;d.forEach(this.getChildren(),function(c){c.destroyRecursive&&c.destroyRecursive()});if(a){d.forEach(a.parseResults,
function(c){c.destroyRecursive&&c.domNode&&c.domNode.parentNode==d.body()&&c.destroyRecursive()});delete a.parseResults}d.html._emptyNode(this.containerNode);delete this._singleChild},_setContent:function(a,c){this.destroyDescendants();var e=this._contentSetter;if(!(e&&e instanceof d.html._ContentSetter))e=this._contentSetter=new d.html._ContentSetter({node:this.containerNode,_onError:d.hitch(this,this._onError),onContentError:d.hitch(this,function(g){g=this.onContentError(g);try{this.containerNode.innerHTML=
g}catch(i){console.error("Fatal "+this.id+" could not change content due to "+i.message,i)}})});var f=d.mixin({cleanContent:this.cleanContent,extractContent:this.extractContent,parseContent:this.parseOnLoad,parserScope:this.parserScope,startup:false,dir:this.dir,lang:this.lang},this._contentSetterParams||{});e.set(d.isObject(a)&&a.domNode?a.domNode:a,f);delete this._contentSetterParams;this.doLayout&&this._checkIfSingleChild();if(!c){if(this._started){this._startChildren();this._scheduleLayout()}this._onLoadHandler(a)}},
_onError:function(a,c,e){this.onLoadDeferred.errback(c);a=this["on"+a+"Error"].call(this,c);if(e)console.error(e,c);else a&&this._setContent(a,true)},onLoad:function(){},onUnload:function(){},onDownloadStart:function(){return this.loadingMessage},onContentError:function(){},onDownloadError:function(){return this.errorMessage},onDownloadEnd:function(){}});return b.layout.ContentPane});
define("dijit/nls/common",{root:{buttonOk:"OK",buttonCancel:"Cancel",buttonSave:"Save",itemClose:"Close"},zh:true,"zh-tw":true,tr:true,th:true,sv:true,sl:true,sk:true,ru:true,ro:true,pt:true,"pt-pt":true,pl:true,nl:true,nb:true,ko:true,kk:true,ja:true,it:true,hu:true,he:true,fr:true,fi:true,es:true,el:true,de:true,da:true,cs:true,ca:true,ar:true});define("text!dijit/templates/TooltipDialog.html",function(){return'<div role="presentation" tabIndex="-1">\n\t<div class="dijitTooltipContainer" role="presentation">\n\t\t<div class ="dijitTooltipContents dijitTooltipFocusNode" dojoAttachPoint="containerNode" role="dialog"></div>\n\t</div>\n\t<div class="dijitTooltipConnector" role="presentation"></div>\n</div>'});
define("dijit/TooltipDialog",["dojo","dijit","text!dijit/templates/TooltipDialog.html","dijit/layout/ContentPane","dijit/_Templated","dijit/form/_FormMixin","dijit/_DialogMixin"],function(d,b){d.declare("dijit.TooltipDialog",[b.layout.ContentPane,b._Templated,b.form._FormMixin,b._DialogMixin],{title:"",doLayout:false,autofocus:true,baseClass:"dijitTooltipDialog",_firstFocusItem:null,_lastFocusItem:null,templateString:d.cache("dijit","templates/TooltipDialog.html"),_setTitleAttr:function(a){this.containerNode.title=
a;this._set("title",a)},postCreate:function(){this.inherited(arguments);this.connect(this.containerNode,"onkeypress","_onKey")},orient:function(a,c,e){a="dijitTooltipAB"+(e.charAt(1)=="L"?"Left":"Right")+" dijitTooltip"+(e.charAt(0)=="T"?"Below":"Above");d.replaceClass(this.domNode,a,this._currentOrientClass||"");this._currentOrientClass=a},focus:function(){this._getFocusItems(this.containerNode);b.focus(this._firstFocusItem)},onOpen:function(a){this.orient(this.domNode,a.aroundCorner,a.corner);this._onShow()},
onClose:function(){this.onHide()},_onKey:function(a){var c=a.target,e=d.keys;a.charOrCode===e.TAB&&this._getFocusItems(this.containerNode);var f=this._firstFocusItem==this._lastFocusItem;if(a.charOrCode==e.ESCAPE){setTimeout(d.hitch(this,"onCancel"),0);d.stopEvent(a)}else if(c==this._firstFocusItem&&a.shiftKey&&a.charOrCode===e.TAB){f||b.focus(this._lastFocusItem);d.stopEvent(a)}else if(c==this._lastFocusItem&&a.charOrCode===e.TAB&&!a.shiftKey){f||b.focus(this._firstFocusItem);d.stopEvent(a)}else a.charOrCode===
e.TAB&&a.stopPropagation()}});return b.TooltipDialog});
define("dijit/Dialog",["dojo","dijit","text!dijit/templates/Dialog.html","dojo/dnd/move","dojo/dnd/TimedMoveable","dojo/fx","dojo/window","dijit/_Widget","dijit/_Templated","dijit/_CssStateMixin","dijit/form/_FormMixin","dijit/_DialogMixin","dijit/DialogUnderlay","dijit/layout/ContentPane","i18n!dijit/nls/common","dijit/TooltipDialog"],function(d,b){d.declare("dijit._DialogBase",[b._Templated,b.form._FormMixin,b._DialogMixin,b._CssStateMixin],{templateString:d.cache("dijit","templates/Dialog.html"),
baseClass:"dijitDialog",cssStateNodes:{closeButtonNode:"dijitDialogCloseIcon"},attributeMap:d.delegate(b._Widget.prototype.attributeMap,{title:[{node:"titleNode",type:"innerHTML"},{node:"titleBar",type:"attribute"}],"aria-describedby":""}),open:false,duration:b.defaultDuration,refocus:true,autofocus:true,_firstFocusItem:null,_lastFocusItem:null,doLayout:false,draggable:true,"aria-describedby":"",postMixInProperties:function(){var a=d.i18n.getLocalization("dijit","common");d.mixin(this,a);this.inherited(arguments)},
postCreate:function(){d.style(this.domNode,{display:"none",position:"absolute"});d.body().appendChild(this.domNode);this.inherited(arguments);this.connect(this,"onExecute","hide");this.connect(this,"onCancel","hide");this._modalconnects=[]},onLoad:function(){this._position();if(this.autofocus&&b._DialogLevelManager.isTop(this)){this._getFocusItems(this.domNode);b.focus(this._firstFocusItem)}this.inherited(arguments)},_endDrag:function(a){if(a&&a.node&&a.node===this.domNode)this._relativePosition=
d.position(a.node)},_setup:function(){var a=this.domNode;if(this.titleBar&&this.draggable){this._moveable=d.isIE==6?new d.dnd.TimedMoveable(a,{handle:this.titleBar}):new d.dnd.Moveable(a,{handle:this.titleBar,timeout:0});this._dndListener=d.subscribe("/dnd/move/stop",this,"_endDrag")}else d.addClass(a,"dijitDialogFixed");this.underlayAttrs={dialogId:this.id,"class":d.map(this["class"].split(/\s/),function(c){return c+"_underlay"}).join(" ")}},_size:function(){this._checkIfSingleChild();if(this._singleChild){if(this._singleChildOriginalStyle)this._singleChild.domNode.style.cssText=
this._singleChildOriginalStyle;delete this._singleChildOriginalStyle}else d.style(this.containerNode,{width:"auto",height:"auto"});var a=d._getMarginSize(this.domNode),c=d.window.getBox();if(a.w>=c.w||a.h>=c.h){var e=Math.min(a.w,Math.floor(c.w*0.75));a=Math.min(a.h,Math.floor(c.h*0.75));if(this._singleChild&&this._singleChild.resize){this._singleChildOriginalStyle=this._singleChild.domNode.style.cssText;this._singleChild.resize({w:e,h:a})}else d.style(this.containerNode,{width:e+"px",height:a+"px",
overflow:"auto",position:"relative"})}else this._singleChild&&this._singleChild.resize&&this._singleChild.resize()},_position:function(){if(!d.hasClass(d.body(),"dojoMove")){var a=this.domNode,c=d.window.getBox(),e=this._relativePosition,f=e?null:d._getBorderBox(a),g=Math.floor(c.l+(e?e.x:(c.w-f.w)/2));c=Math.floor(c.t+(e?e.y:(c.h-f.h)/2));d.style(a,{left:g+"px",top:c+"px"})}},_onKey:function(a){if(a.charOrCode){var c=d.keys,e=a.target;a.charOrCode===c.TAB&&this._getFocusItems(this.domNode);var f=
this._firstFocusItem==this._lastFocusItem;if(e==this._firstFocusItem&&a.shiftKey&&a.charOrCode===c.TAB){f||b.focus(this._lastFocusItem);d.stopEvent(a)}else if(e==this._lastFocusItem&&a.charOrCode===c.TAB&&!a.shiftKey){f||b.focus(this._firstFocusItem);d.stopEvent(a)}else{for(;e;){if(e==this.domNode||d.hasClass(e,"dijitPopup"))if(a.charOrCode==c.ESCAPE)this.onCancel();else return;e=e.parentNode}if(a.charOrCode!==c.TAB)d.stopEvent(a);else if(!d.isOpera)try{this._firstFocusItem.focus()}catch(g){}}}},
show:function(){if(!this.open){this._started||this.startup();if(!this._alreadyInitialized){this._setup();this._alreadyInitialized=true}this._fadeOutDeferred&&this._fadeOutDeferred.cancel();this._modalconnects.push(d.connect(window,"onscroll",this,"layout"));this._modalconnects.push(d.connect(window,"onresize",this,function(){var c=d.window.getBox();if(!this._oldViewport||c.h!=this._oldViewport.h||c.w!=this._oldViewport.w){this.layout();this._oldViewport=c}}));this._modalconnects.push(d.connect(this.domNode,
"onkeypress",this,"_onKey"));d.style(this.domNode,{opacity:0,display:""});this._set("open",true);this._onShow();this._size();this._position();var a;this._fadeInDeferred=new d.Deferred(d.hitch(this,function(){a.stop();delete this._fadeInDeferred}));a=d.fadeIn({node:this.domNode,duration:this.duration,beforeBegin:d.hitch(this,function(){b._DialogLevelManager.show(this,this.underlayAttrs)}),onEnd:d.hitch(this,function(){if(this.autofocus&&b._DialogLevelManager.isTop(this)){this._getFocusItems(this.domNode);
b.focus(this._firstFocusItem)}this._fadeInDeferred.callback(true);delete this._fadeInDeferred})}).play();return this._fadeInDeferred}},hide:function(){if(this._alreadyInitialized){this._fadeInDeferred&&this._fadeInDeferred.cancel();var a;this._fadeOutDeferred=new d.Deferred(d.hitch(this,function(){a.stop();delete this._fadeOutDeferred}));a=d.fadeOut({node:this.domNode,duration:this.duration,onEnd:d.hitch(this,function(){this.domNode.style.display="none";b._DialogLevelManager.hide(this);this.onHide();
this._fadeOutDeferred.callback(true);delete this._fadeOutDeferred})}).play();if(this._scrollConnected)this._scrollConnected=false;d.forEach(this._modalconnects,d.disconnect);this._modalconnects=[];this._relativePosition&&delete this._relativePosition;this._set("open",false);return this._fadeOutDeferred}},layout:function(){if(this.domNode.style.display!="none"){b._underlay&&b._underlay.layout();this._position()}},destroy:function(){this._fadeInDeferred&&this._fadeInDeferred.cancel();this._fadeOutDeferred&&
this._fadeOutDeferred.cancel();this._moveable&&this._moveable.destroy();this._dndListener&&d.unsubscribe(this._dndListener);d.forEach(this._modalconnects,d.disconnect);b._DialogLevelManager.hide(this);this.inherited(arguments)}});d.declare("dijit.Dialog",[b.layout.ContentPane,b._DialogBase],{});b._DialogLevelManager={show:function(a,c){var e=b._dialogStack;e[e.length-1].focus=b.getFocus(a);var f=b._underlay;if(!f||f._destroyed)f=b._underlay=new b.DialogUnderlay(c);else f.set(a.underlayAttrs);var g=
e[e.length-1].dialog?e[e.length-1].zIndex+2:950;e.length==1&&f.show();d.style(b._underlay.domNode,"zIndex",g-1);d.style(a.domNode,"zIndex",g);e.push({dialog:a,underlayAttrs:c,zIndex:g})},hide:function(a){var c=b._dialogStack;if(c[c.length-1].dialog==a){c.pop();var e=c[c.length-1];if(c.length==1)b._underlay._destroyed||b._underlay.hide();else{d.style(b._underlay.domNode,"zIndex",e.zIndex-1);b._underlay.set(e.underlayAttrs)}if(a.refocus){c=e.focus;if(!c||e.dialog&&!d.isDescendant(c.node,e.dialog.domNode)){e.dialog._getFocusItems(e.dialog.domNode);
c=e.dialog._firstFocusItem}try{b.focus(c)}catch(f){}}}else{e=d.indexOf(d.map(c,function(g){return g.dialog}),a);e!=-1&&c.splice(e,1)}},isTop:function(a){var c=b._dialogStack;return c[c.length-1].dialog==a}};b._dialogStack=[{dialog:null,focus:null,underlayAttrs:null}];return b.Dialog});
define("orion/widgets/_OrionDialogMixin",["dojo","dijit"],function(d,b){d.declare("orion.widgets._OrionDialogMixin",null,{postMixInProperties:function(){this.inherited(arguments);this.title=this.options.title||"Information Needed";this.buttonCancel="Cancel"},postCreate:function(){this.inherited(arguments);d.connect(this,"onKeyPress",d.hitch(this,function(a){a.keyCode===d.keys.ENTER&&this._onSubmit()}))},onHide:function(){this.inherited(arguments);setTimeout(d.hitch(this,function(){if(d.isDescendant(b._curFocus,
this.domNode))b._curFocus=null;if(d.isDescendant(b._prevFocus,this.domNode))b._prevFocus=null;this.destroyRecursive()}),this.duration)}})});define("text!orion/widgets/templates/OpenResourceDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" title="${title}" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<div style="display:table">\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div style="display:table-cell; padding:5;">\n\t\t\t\t\t<label for="resourceName" style="padding-right:10">${selectFile}</label>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div style="display:table-cell; padding:5;">\n\t\t\t\t\t<input type="text" dojoType="dijit.form.TextBox" dojoAttachPoint="resourceName" \n\t\t\t\t\t\tplaceHolder="${searchPlaceHolder}"\n\t\t\t\t\t\tintermediateChanges="true" style="width:30em;">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div dojoAttachPoint="results" style="max-height:400px; height:auto; overflow-y:auto;"></div>\n\t\t\t</div>\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div dojoAttachPoint="statusbar" style="display:table-cell;"></div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>'});
define("orion/widgets/OpenResourceDialog",["dojo","dijit","dijit/Dialog","dijit/form/TextBox","orion/widgets/_OrionDialogMixin","text!orion/widgets/templates/OpenResourceDialog.html"],function(d,b){return d.declare("orion.widgets.OpenResourceDialog",[b.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:d.cache("orion","widgets/templates/OpenResourceDialog.html"),SEARCH_DELAY:500,timeoutId:null,time:null,options:null,searchLocation:null,searcher:null,constructor:function(){this.inherited(arguments);
this.timeoutId=null;this.time=0;this.searchLocation=(this.options=arguments[0])&&this.options.SearchLocation;this.searcher=this.options&&this.options.searcher;if(!this.searchLocation)throw new Error("Missing required argument: SearchLocation");if(!this.searcher)throw new Error("Missing required argument: searcher");},postMixInProperties:function(){this.options.title=this.options.title||"Find File Named";this.selectFile="Type the name of a file to open (? = any character, * = any string):";this.searchPlaceHolder=
"Search";this.inherited(arguments)},postCreate:function(){this.inherited(arguments);d.connect(this.resourceName,"onChange",this,function(){this.time=+new Date;clearTimeout(this.timeoutId);this.timeoutId=setTimeout(d.hitch(this,this.checkSearch),0)});d.connect(this.resourceName,"onKeyPress",this,function(a){if(a.keyCode===d.keys.ENTER&&this.results){a=d.query("a",this.results);if(a.length>0){window.open(a[0].href);this.hide()}}});d.connect(this,"onMouseUp",function(a){a.target.focus()})},checkSearch:function(){clearTimeout(this.timeoutId);
var a=(new Date).getTime();if(a-this.time>this.SEARCH_DELAY){this.time=a;this.doSearch()}else this.timeoutId=setTimeout(d.hitch(this,"checkSearch"),50)},doSearch:function(){var a=this.resourceName&&this.resourceName.get("value");if(a){d.place("<div>Searching&#x2026;</div>",this.results,"only");var c=this;setTimeout(function(){var e=c.searcher.createSearchQuery(c.searchLocation,null,a);c.searcher.search(c.results,e,false,false,d.hitch(c,c.decorateResult),true,true)},0)}},decorateResult:function(a){var c=
this;d.query("a",a).forEach(function(e){d.connect(e,"onmouseup",function(f){!d.mouseButtons.isMiddle(f)&&!d.isCopyKey(f)&&c.hide()})})},show:function(){this.inherited(arguments);this.resourceName.focus()},onHide:function(){clearTimeout(this.timeoutId);this.inherited(arguments)}})});define("text!orion/widgets/templates/LoginDialog.html",function(){return'\n<div>\n\t<div class="dijitTooltipContainer" role="presentation" style="width: 300px; padding-left: 0; padding-right: 0; padding-top: 0.5em; padding-bottom: 0.45em">\n\t\t<div class="dijitTooltipContents dijitTooltipFocusNode" role="dialog"\n\t\t\tdojoattachpoint="containerNode" style="padding: 0">\n\t\t\t<table dojoAttachPoint="authenticated" style="display: none; width: 100%;">\n\t\t\t <tbody dojoAttachPoint="authenticatedList">\n\t\t\t</tbody>\n\t\t\t</span>\n\t\t\t\n\t\t\t<table dojoAttachPoint="otherUnauthenticated" style="display: none; width: 100%;">\n\t\t\t <tbody dojoAttachPoint="otherUnauthenticatedList">\n\t\t\t</tbody>\n\t\t\t</span>\n\t\t</div>\n\t</div>\n\t<div class="dijitTooltipConnector" role="presentation"></div>\n\n</div>'});
define("orion/widgets/LoginDialog",["require","dojo","dijit","orion/util","dijit/TooltipDialog","text!orion/widgets/templates/LoginDialog.html"],function(d,b,a,c){b.declare("orion.widgets.LoginDialog",[a.TooltipDialog],{widgetsInTemplate:true,templateString:b.cache("orion","widgets/templates/LoginDialog.html"),constructor:function(){this.inherited(arguments);this.options=arguments[0]||{};this.authenticatedServices={};this.unauthenticatedServices={}},setPendingAuthentication:function(e){for(var f in this.unauthenticatedServices)delete this.unauthenticatedServices[f].pending;
for(f in e)if(this.unauthenticatedServices[e[f].SignInKey])this.unauthenticatedServices[e[f].SignInKey].pending=true;else if(this.authenticatedServices[e[f].SignInKey]){this.unauthenticatedServices[e[f].SignInKey]=this.authenticatedServices[e[f].SignInKey];this.unauthenticatedServices[e[f].SignInKey].pending=true;delete this.authenticatedServices[e[f].SignInKey]}else this.unauthenticatedServices[e[f].SignInKey]={label:e[f].SignInKey,SignInLocation:e[f].SignInLocation,pending:true};this.renderUnauthenticatedServices();
this.renderAuthenticatedServices()},addUserItem:function(e,f,g,i){if(i){this.unauthenticatedServices[e]&&delete this.unauthenticatedServices[e];this.authenticatedServices[e]={authService:f,label:g,data:i}}else{this.authenticatedServices[e]&&delete this.authenticatedServices[e];this.unauthenticatedServices[e]=this.unauthenticatedServices[e]?{authService:f,label:g,pending:this.unauthenticatedServices[e].pending}:{authService:f,label:g}}b.hitch(this,this.renderAuthenticatedServices)();b.hitch(this,this.renderUnauthenticatedServices)();
if(a.byId("logins"))if(this.isSingleService()&&i){c.setUserName(i.login);e=i.Name&&i.Name.replace(/^\s+|\s+$/g,"")!==""?i.Name:i.login;if(e.length>40)e=e.substring(0,30)+"...";a.byId("logins").setLabel(e)}else a.byId("logins").setLabel("Security")},renderAuthenticatedServices:function(){b.empty(this.authenticatedList);this.authenticated.style.display=this.isEmpty(this.authenticatedServices)?"none":"";var e=this,f=true;for(var g in this.authenticatedServices){if(!f){var i=b.create("tr",null,this.authenticatedList);
b.create("td",{style:"padding: 0; margin 0;",colspan:2,innerHTML:"<hr style='border-bottom: medium none; border-top: 1px solid #D3D3D3; color: gray; height: 0; margin: 2px;'>"},i)}f=false;i=b.create("tr",{className:"navTableHeading"});var j=b.create("td",{innerHTML:"<h2>"+(this.authenticatedServices[g].label?this.authenticatedServices[g].label:g)+"</h2>"},i,"only");b.addClass(j,"LoginWindowLeft");j=b.create("td",{style:"text-align: right"},i,"last");b.addClass(j,"LoginWindowRight");var h=this.authenticatedServices[g].data,
l=this.authenticatedServices[g].authService;h.Location&&b.create("a",{href:d.toUrl("profile/user-profile.html")+"#"+h.Location,innerHTML:"Profile"},j,"last");b.place(document.createTextNode(" "),j,"last");if(l.logout){var p=b.create("a",{innerHTML:"Sign out"},j,"last");b.connect(p,"onmouseover",p,function(){p.style.cursor="pointer"});b.connect(p,"onmouseout",p,function(){p.style.cursor="default"});b.connect(p,"onclick",b.hitch(e,function(t,r){return function(){t.logout().then(b.hitch(e,function(){this.addUserItem(r,
t,this.authenticatedServices[r].label);this.isSingleService()&&a.popup.close(this);localStorage.removeItem(r)}))}})(l,g))}b.place(i,this.authenticatedList,"last");j="N/A";if(h&&h.lastlogintimestamp)j=b.date.locale.format(new Date(h.lastlogintimestamp),{formatLength:"short"});h=h.Name&&h.Name.replace(/^\s+|\s+$/g,"")!==""?h.Name:h.login;i=b.create("tr");j=h.length>40?b.create("td",{innerHTML:h.substring(0,30)+"... logged in since "+j,colspan:2,title:h+" logged in since "+j},i,"only"):b.create("td",
{innerHTML:h+" logged in since "+j,colspan:2},i,"only");b.addClass(j,"LoginWindowLeft");b.addClass(j,"LoginWindowRight");b.addClass(j,"LoginWindowComment");b.place(i,this.authenticatedList,"last")}},renderUnauthenticatedServices:function(){b.empty(this.otherUnauthenticatedList);var e=this;this.otherUnauthenticated.style.display=this.isEmpty(this.unauthenticatedServices)?"none":"";var f=true;for(var g in this.unauthenticatedServices){if(!f||!this.isEmpty(this.authenticatedServices)){var i=b.create("tr",
null,this.otherUnauthenticatedList);b.create("td",{style:"padding: 0; margin 0;",colspan:2,innerHTML:"<hr style='border-bottom: medium none; border-top: 1px solid #D3D3D3; color: gray; height: 0; margin: 2px;'>"},i)}f=false;i=b.create("tr",{className:"navTableHeading"});var j=b.create("td",null,i,"only");b.addClass(j,"LoginWindowLeft");b.create("h2",{innerHTML:this.unauthenticatedServices[g].label?this.unauthenticatedServices[g].label:g},j,"only");j=b.create("td",{style:"text-align: right"},i,"last");
b.addClass(j,"LoginWindowRight");var h=this.unauthenticatedServices[g].authService;if(h)if(h.getAuthForm)b.hitch(e,function(t,r){h.getAuthForm(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(s){s.indexOf("?")==-1?b.create("a",{target:"_blank",href:s+"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+r,innerHTML:"Sign in"},t,"last"):b.create("a",{target:"_blank",href:s+"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+r,innerHTML:"Sign in"},
t,"last")})})(j,g);else{if(h.login){var l=b.create("a",{innerHTML:"Sign in",style:"cursor: hand;"},j,"last");b.connect(l,"onmouseover",l,function(){l.style.cursor="pointer"});b.connect(l,"onmouseout",l,function(){l.style.cursor="default"});b.connect(l,"onclick",b.hitch(e,function(t){return function(){t.login(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(){e.isSingleService()&&a.popup.close(e)})}})(h))}}else{var p=this.unauthenticatedServices[g].SignInLocation;p.indexOf("?")==
-1?b.create("a",{target:"_blank",href:p+"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+g,innerHTML:"Sign in"},j,"last"):b.create("a",{target:"_blank",href:p+"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+g,innerHTML:"Sign in"},j,"last")}b.place(i,this.otherUnauthenticatedList,"last");if(this.unauthenticatedServices[g].pending){i=b.create("tr");j=b.create("td",{innerHTML:"Authentication required!",style:"padding-left: 10px",colspan:2},i,"only");b.addClass(j,
"LoginWindowLeft");b.addClass(j,"LoginWindowRight");b.create("img",{src:d.toUrl("images/warning.gif"),style:"padding-right: 4px; vertical-align: bottom; padding-bottom: 2px;"},j,"first");b.place(i,this.otherUnauthenticatedList,"last")}}},isSingleService:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)===1},isEmpty:function(e){for(var f in e)if(e.hasOwnProperty(f))return false;return true},length:function(e){var f=0;for(var g in e)e.hasOwnProperty(g)&&
f++;return f},getHostname:function(e){var f=document.createElement("img");f.src=e;e=f.src;f.src=null;return e.match(/^(?:f|ht)tp(?:s)?:\/\/([^\/]+)/im)[1].toString()}})});
define("orion/globalCommands",["require","dojo","dijit","orion/commands","orion/util","orion/textview/keyBinding","dijit/Menu","dijit/MenuItem","dijit/form/DropDownButton","orion/widgets/OpenResourceDialog","orion/widgets/LoginDialog"],function(d,b,a,c,e,f){function g(y){var k=document.createElement("a");k.href=y;return k.href}function i(y,k){if(y.getLabel)return y.getLabel();else{y=new b.Deferred;y.callback(k.properties.name);return y}}function j(y){var k=y.getServiceReferences("orion.core.auth"),
n=b.byId("userInfo");if(n){if(!a.byId("logins")){var o=new a.form.DropDownButton({id:"logins",label:"Security",dropDown:z,title:"Login statuses"});b.addClass(o.domNode,"commandImage");b.place(o.domNode,n,"only")}for(n=0;n<k.length;n++){var m=k[n];y.getService(m).then(function(q){i(q,m).then(function(w){q.getKey().then(function(u){q.getUser().then(function(x){z.addUserItem(u,q,w,x)},function(){z.addUserItem(u,q,w)});window.addEventListener("storage",function(){if(v[u]!==localStorage.getItem(u)){v[u]=
localStorage.getItem(u);q.getUser().then(function(x){z.addUserItem(u,q,w,x)},function(){z.addUserItem(u,q,w)})}},false)})})})}}}function h(y){z.setPendingAuthentication(y);var k;for(k in y)if(y.hasOwnProperty(k)){a.popup.open({popup:z,around:b.byId("logins")});return}a.popup.close(z)}function l(y,k,n,o){var m=b.byId("pageActions");if(n)m=b.byId(n);if(m){b.empty(m);y.renderCommands(m,"dom",k,k,"image",null,null,!o)}}function p(y,k,n,o,m,q,w,u){var x=d.toUrl("filesearch._");x=x.substring(0,x.length-
2)+"?q=";var B;o=b.byId(y);if(!o)throw"could not find banner parent, id was "+y;b.place(t,o,"only");b.place('<div id="keyAssist" class="keyAssistFloat"></div>',document.body,"last");var C=b.byId("primaryNav");if(C)for(var D=k.getServiceReferences("orion.page.link"),F=0;F<D.length;F++)k.getService(D[F]).then(function(){for(var R={},T=D[F].getPropertyNames(),S=0;S<T.length;S++)R[T[S]]=D[F].getProperty(T[S]);if(R.href&&R.name){T=b.create("a",{href:R.href},C,"last");b.addClass(T,"commandLink");B=document.createTextNode(R.name);
b.place(B,T,"only")}});var J=b.byId("search");if(!J)throw"failed to generate HTML for banner";b.connect(J,"onkeypress",function(R){if(R.charOrCode===b.keys.ENTER)if(x){if(J.value.length>0){R=m.createSearchQuery("../filesearch?q=",J.value);window.location=d.toUrl("search/search.html")+"#"+R}}else window.alert("Can't search: SearchLocation not available")});if(y=b.byId("pageTitle")){B=document.createTextNode(document.title);b.place(B,y,"last")}var K=function(R,T,S){var ca=new orion.widgets.OpenResourceDialog({SearchLocation:R,
searcher:T});S&&b.connect(ca,"onHide",function(){S.getTextView().focus()});window.setTimeout(function(){ca.show()},0)};y=new c.Command({name:"Find File Named...",tooltip:"Choose a file by name and open an editor on it",id:"eclipse.openResource",callback:function(){K(x,m,w)}});if(w){w.getTextView().setKeyBinding(new f.KeyBinding("r",true,true,false),"Find File Named...");w.getTextView().setAction("Find File Named...",function(){K(x,m,w);return true})}n.addCommand(y,"global");n.registerCommandContribution("eclipse.openResource",
1,"globalActions",null,new c.CommandKeyBinding("t"),true);var L=b.byId("keyAssist");b.connect(document,"onkeypress",b.hitch(this,function(R){if(R.charOrCode===b.keys.ESCAPE)L.style.display="none"}));u&&u.addHandler({isActive:function(){return L.style.display==="block"},cancel:function(){if(this.isActive()){L.style.display="none";return true}return false}});u=new c.Command({name:"Show Keys",tooltip:"Show a list of all the keybindings on this page",id:"eclipse.keyAssist",callback:function(){b.empty(L);
if(w){b.place("<h2>Editor</h2>",L,"last");for(var R=w.getTextView().getActions(false),T=0;T<R.length;T++)for(var S=R[T],ca=w.getTextView().getKeyBindings(S),A=0;A<ca.length;A++)b.place("<span>"+e.getUserKeyString(ca[A])+" = "+S+"<br></span>",L,"last")}b.place("<h2>Global</h2>",L,"last");n.showKeyBindings(L);L.style.display="block";return true}});n.addCommand(u,"global");n.registerCommandContribution("eclipse.keyAssist",1,"globalActions",null,new c.CommandKeyBinding(191,false,true),true);if(w){w.getTextView().setKeyBinding(new c.CommandKeyBinding("L",
true,true),"Show Keys");w.getTextView().setAction("Show Keys",u.callback)}if(u=b.byId("globalActions")){b.empty(u);n.renderCommands(u,"global",q||{},q,"image")}j(k);if(r)(k=b.byId("footer"))&&b.place(r,k,"only")}var t='<table style="border: 2px solid white; margin: 0; padding: 0; border-collapse: collapse; width: 100%;"><tr class="topRowBanner" id="bannerRow1"><td rowspan=3 style="padding-top: 12px; padding-bottom: 12px; padding-left: 8px; width: 148px"><a id="home" href="'+d.toUrl("index.html")+
'"><span class="imageSprite core-sprite-orion toolbarLabel" alt="Orion Logo" align="top"></a></td><td class="leftGlobalToolbar" style="padding-top: 16px"><span id="pageTitle" class="pageTitle"></span></td><td class="rightGlobalToolbar" style="padding-top: 16px"><span id="primaryNav" class="globalActions"></span><span id="globalActions" class="globalActions"></span><input type="search" id="search" class="searchbox"><span id="userInfo"></span><span id="help" class="help"><a id="help" href="'+d.toUrl("help/index.jsp")+
'">?</a></span></td></tr><tr class="topRowBanner" id="bannerRow2"><td colspan=2 style="text-wrap: normal"><span id="location" class="currentLocation" style="text-wrap: normal"></span></td></tr><tr class="topRowBanner" id="bannerRow3"><td colspan=2 style="height: 16px; text-align: left"><span id="statusPane" style="color: #5a5a5a;"></span><span id="notifications"></span></td></tr><tr class="pageToolbar"><td colspan=3 style="padding-left: 16px;" id="pageToolbar" class="pageToolbar"><span id="pageActions" class="pageActions"></span><span id="pageActionsRight" class="pageActions"></span></td></tr><tr class="optionalPageToolbar"><td colspan=3 style="border: 1px solid grey;padding-left: 16px;" id="optionalPageToolbar" class="optionalPageToolbar"><div id="optionalPageActions"  class="pageActions"></div></td></tr></table>',
r='<span class="imageSprite core-sprite-warning"></span> This is a Beta build of Orion.  You can use it, play with it and explore the capabilities but BEWARE your data may be lost. &nbsp;| <a href="http://wiki.eclipse.org/Orion/FAQ">FAQ</a> | <a href="https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Orion&version=0.3">Report a Bug</a> | <a href="http://www.eclipse.org/legal/privacy.php">Privacy Policy</a> | <a href="http://www.eclipse.org/legal/termsofuse.php">Terms of Use</a> | <a href="http://www.eclipse.org/legal/copyright.php">Copyright Agent</a>',
s=g(d.toUrl("auth/NotifyAuthentication.html")),v={},z=new orion.widgets.LoginDialog;return{generateUserInfo:j,generateDomCommandsInBanner:l,generateBanner:p,notifyAuthenticationSite:s,setPendingAuthentication:h}});
define("dojo/date",["dojo"],function(d){d.getObject("date",true,d);d.date.getDaysInMonth=function(b){var a=b.getMonth();if(a==1&&d.date.isLeapYear(b))return 29;return[31,28,31,30,31,30,31,31,30,31,30,31][a]};d.date.isLeapYear=function(b){b=b.getFullYear();return!(b%400)||!(b%4)&&!!(b%100)};d.date.getTimezoneName=function(b){var a=b.toString(),c="",e=a.indexOf("(");if(e>-1)c=a.substring(++e,a.indexOf(")"));else{e=/([A-Z\/]+) \d{4}$/;if(a=a.match(e))c=a[1];else{a=b.toLocaleString();e=/ ([A-Z\/]+)$/;
if(a=a.match(e))c=a[1]}}return c=="AM"||c=="PM"?"":c};d.date.compare=function(b,a,c){b=new Date(+b);a=new Date(+(a||new Date));if(c=="date"){b.setHours(0,0,0,0);a.setHours(0,0,0,0)}else if(c=="time"){b.setFullYear(0,0,0);a.setFullYear(0,0,0)}if(b>a)return 1;if(b<a)return-1;return 0};d.date.add=function(b,a,c){var e=new Date(+b),f=false,g="Date";switch(a){case "day":break;case "weekday":var i;if(a=c%5){a=a;i=parseInt(c/5)}else{a=c>0?5:-5;i=c>0?(c-5)/5:(c+5)/5}var j=b.getDay(),h=0;if(j==6&&c>0)h=1;
else if(j==0&&c<0)h=-1;j=j+a;if(j==0||j==6)h=c>0?2:-2;c=7*i+a+h;break;case "year":g="FullYear";f=true;break;case "week":c*=7;break;case "quarter":c*=3;case "month":f=true;g="Month";break;default:g="UTC"+a.charAt(0).toUpperCase()+a.substring(1)+"s"}g&&e["set"+g](e["get"+g]()+c);f&&e.getDate()<b.getDate()&&e.setDate(0);return e};d.date.difference=function(b,a,c){a=a||new Date;c=c||"day";var e=a.getFullYear()-b.getFullYear(),f=1;switch(c){case "quarter":b=b.getMonth();a=a.getMonth();b=Math.floor(b/3)+
1;a=Math.floor(a/3)+1;a+=e*4;f=a-b;break;case "weekday":e=Math.round(d.date.difference(b,a,"day"));c=parseInt(d.date.difference(b,a,"week"));f=e%7;if(f==0)e=c*5;else{var g=0,i=b.getDay();a=a.getDay();c=parseInt(e/7);f=e%7;b=new Date(b);b.setDate(b.getDate()+c*7);b=b.getDay();if(e>0)switch(true){case i==6:g=-1;break;case i==0:g=0;break;case a==6:g=-1;break;case a==0:g=-2;break;case b+f>5:g=-2}else if(e<0)switch(true){case i==6:g=0;break;case i==0:g=1;break;case a==6:g=2;break;case a==0:g=1;break;case b+
f<0:g=2}e+=g;e-=c*2}f=e;break;case "year":f=e;break;case "month":f=a.getMonth()-b.getMonth()+e*12;break;case "week":f=parseInt(d.date.difference(b,a,"day")/7);break;case "day":f/=24;case "hour":f/=60;case "minute":f/=60;case "second":f/=1E3;case "millisecond":f*=a.getTime()-b.getTime()}return Math.round(f)};return d.date});
define("dojo/cldr/supplemental",["dojo","dojo/i18n"],function(d){d.getObject("cldr.supplemental",true,d);d.cldr.supplemental.getFirstDayOfWeek=function(b){b={mv:5,ae:6,af:6,bh:6,dj:6,dz:6,eg:6,er:6,et:6,iq:6,ir:6,jo:6,ke:6,kw:6,ly:6,ma:6,om:6,qa:6,sa:6,sd:6,so:6,sy:6,tn:6,ye:6,ar:0,as:0,az:0,bw:0,ca:0,cn:0,fo:0,ge:0,gl:0,gu:0,hk:0,il:0,"in":0,jm:0,jp:0,kg:0,kr:0,la:0,mh:0,mn:0,mo:0,mp:0,mt:0,nz:0,ph:0,pk:0,sg:0,th:0,tt:0,tw:0,um:0,us:0,uz:0,vi:0,zw:0}[d.cldr.supplemental._region(b)];return b===undefined?
1:b};d.cldr.supplemental._region=function(b){b=d.i18n.normalizeLocale(b);b=b.split("-");var a=b[1];if(a){if(a.length==4)a=b[2]}else a={de:"de",en:"us",es:"es",fi:"fi",fr:"fr",he:"il",hu:"hu",it:"it",ja:"jp",ko:"kr",nl:"nl",pt:"br",sv:"se",zh:"cn"}[b[0]];return a};d.cldr.supplemental.getWeekend=function(b){var a=d.cldr.supplemental._region(b);b={"in":0,af:4,dz:4,ir:4,om:4,sa:4,ye:4,ae:5,bh:5,eg:5,il:5,iq:5,jo:5,kw:5,ly:5,ma:5,qa:5,sd:5,sy:5,tn:5}[a];a={af:5,dz:5,ir:5,om:5,sa:5,ye:5,ae:6,bh:5,eg:6,
il:6,iq:6,jo:6,kw:6,ly:6,ma:6,qa:6,sd:6,sy:6,tn:6}[a];if(b===undefined)b=6;if(a===undefined)a=0;return{start:b,end:a}};return d.cldr.supplemental});
define("dojo/regexp",["dojo"],function(d){d.getObject("regexp",true,d);d.regexp.escapeString=function(b,a){return b.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,function(c){if(a&&a.indexOf(c)!=-1)return c;return"\\"+c})};d.regexp.buildGroupRE=function(b,a,c){if(!(b instanceof Array))return a(b);for(var e=[],f=0;f<b.length;f++)e.push(a(b[f]));return d.regexp.group(e.join("|"),c)};d.regexp.group=function(b,a){return"("+(a?"?:":"")+b+")"};return d.regexp});
define("dojo/cldr/nls/gregorian",{root:{"months-format-narrow":["1","2","3","4","5","6","7","8","9","10","11","12"],"quarters-standAlone-narrow":["1","2","3","4"],"field-weekday":"Day of the Week","dateFormatItem-yQQQ":"y QQQ","dateFormatItem-yMEd":"EEE, y-M-d","dateFormatItem-MMMEd":"E MMM d",eraNarrow:["BCE","CE"],"dateTimeFormats-appendItem-Day-Of-Week":"{0} {1}","dateFormat-long":"y MMMM d","months-format-wide":["1","2","3","4","5","6","7","8","9","10","11","12"],"dateTimeFormat-medium":"{1} {0}",
"dateFormatItem-EEEd":"d EEE","dayPeriods-format-wide-pm":"PM","dateFormat-full":"EEEE, y MMMM dd","dateFormatItem-Md":"M-d","dayPeriods-format-abbr-am":"AM","dateTimeFormats-appendItem-Second":"{0} ({2}: {1})","field-era":"Era","dateFormatItem-yM":"y-M","months-standAlone-wide":["1","2","3","4","5","6","7","8","9","10","11","12"],"timeFormat-short":"HH:mm","quarters-format-wide":["Q1","Q2","Q3","Q4"],"timeFormat-long":"HH:mm:ss z","field-year":"Year","dateFormatItem-yMMM":"y MMM","dateFormatItem-yQ":"y Q",
"dateTimeFormats-appendItem-Era":"{0} {1}","field-hour":"Hour","months-format-abbr":["1","2","3","4","5","6","7","8","9","10","11","12"],"timeFormat-full":"HH:mm:ss zzzz","dateTimeFormats-appendItem-Week":"{0} ({2}: {1})","field-day-relative+0":"Today","field-day-relative+1":"Tomorrow","dateFormatItem-H":"HH","months-standAlone-abbr":["1","2","3","4","5","6","7","8","9","10","11","12"],"quarters-format-abbr":["Q1","Q2","Q3","Q4"],"quarters-standAlone-wide":["Q1","Q2","Q3","Q4"],"dateFormatItem-M":"L",
"days-standAlone-wide":["1","2","3","4","5","6","7"],"timeFormat-medium":"HH:mm:ss","dateFormatItem-Hm":"HH:mm","quarters-standAlone-abbr":["Q1","Q2","Q3","Q4"],eraAbbr:["BCE","CE"],"field-minute":"Minute","field-dayperiod":"Dayperiod","days-standAlone-abbr":["1","2","3","4","5","6","7"],"dateFormatItem-d":"d","dateFormatItem-ms":"mm:ss","quarters-format-narrow":["1","2","3","4"],"field-day-relative+-1":"Yesterday","dateFormatItem-h":"h a","dateTimeFormat-long":"{1} {0}","dayPeriods-format-narrow-am":"AM",
"dateFormatItem-MMMd":"MMM d","dateFormatItem-MEd":"E, M-d","dateTimeFormat-full":"{1} {0}","field-day":"Day","days-format-wide":["1","2","3","4","5","6","7"],"field-zone":"Zone","dateTimeFormats-appendItem-Day":"{0} ({2}: {1})","dateFormatItem-y":"y","months-standAlone-narrow":["1","2","3","4","5","6","7","8","9","10","11","12"],"dateFormatItem-hm":"h:mm a","dateTimeFormats-appendItem-Year":"{0} {1}","dateTimeFormats-appendItem-Hour":"{0} ({2}: {1})","dayPeriods-format-abbr-pm":"PM","days-format-abbr":["1",
"2","3","4","5","6","7"],eraNames:["BCE","CE"],"days-format-narrow":["1","2","3","4","5","6","7"],"days-standAlone-narrow":["1","2","3","4","5","6","7"],"dateFormatItem-MMM":"LLL","field-month":"Month","dateTimeFormats-appendItem-Quarter":"{0} ({2}: {1})","dayPeriods-format-wide-am":"AM","dateTimeFormats-appendItem-Month":"{0} ({2}: {1})","dateTimeFormats-appendItem-Minute":"{0} ({2}: {1})","dateFormat-short":"yyyy-MM-dd","field-second":"Second","dateFormatItem-yMMMEd":"EEE, y MMM d","dateTimeFormats-appendItem-Timezone":"{0} {1}",
"field-week":"Week","dateFormat-medium":"y MMM d","dayPeriods-format-narrow-pm":"PM","dateTimeFormat-short":"{1} {0}","dateFormatItem-Hms":"HH:mm:ss","dateFormatItem-hms":"h:mm:ss a"},ar:true,ca:true,cs:true,da:true,de:true,el:true,en:true,"en-au":true,"en-ca":true,"en-gb":true,es:true,fi:true,fr:true,"fr-ch":true,he:true,hu:true,it:true,ja:true,ko:true,nb:true,nl:true,pl:true,pt:true,"pt-pt":true,ro:true,ru:true,sk:true,sl:true,sv:true,th:true,tr:true,zh:true,"zh-hant":true,"zh-hk":true,"zh-tw":true});
define("dojo/cldr/nls/en/gregorian",{"dateFormatItem-yM":"M/y","field-dayperiod":"AM/PM","dateFormatItem-yQ":"Q y","dayPeriods-format-wide-pm":"PM","field-minute":"Minute",eraNames:["Before Christ","Anno Domini"],"dateFormatItem-MMMEd":"E, MMM d","dateTimeFormat-full":"{1} {0}","field-day-relative+-1":"Yesterday","field-weekday":"Day of the Week","dateFormatItem-hms":"h:mm:ss a","dateFormatItem-yQQQ":"QQQ y","days-standAlone-wide":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],
"dateFormatItem-MMM":"LLL","months-standAlone-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"dateTimeFormat-short":"{1} {0}","field-era":"Era","field-hour":"Hour","dayPeriods-format-wide-am":"AM","dateTimeFormat-medium":"{1} {0}","dateFormatItem-y":"y","timeFormat-full":"h:mm:ss a zzzz","months-standAlone-abbr":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"dateFormatItem-yMMM":"MMM y","field-day-relative+0":"Today","field-day-relative+1":"Tomorrow","days-standAlone-narrow":["S",
"M","T","W","T","F","S"],eraAbbr:["BC","AD"],"dateFormat-long":"MMMM d, y","timeFormat-medium":"h:mm:ss a","dateFormatItem-EEEd":"d EEE","field-zone":"Zone","dateFormatItem-Hm":"HH:mm","dateFormat-medium":"MMM d, y","dateFormatItem-Hms":"HH:mm:ss","quarters-standAlone-wide":["1st quarter","2nd quarter","3rd quarter","4th quarter"],"dateFormatItem-ms":"mm:ss","field-year":"Year","quarters-standAlone-narrow":["1","2","3","4"],"dateTimeFormat-long":"{1} {0}","field-week":"Week","months-standAlone-wide":["January",
"February","March","April","May","June","July","August","September","October","November","December"],"dateFormatItem-MMMd":"MMM d","timeFormat-long":"h:mm:ss a z","months-format-abbr":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"dayPeriods-format-wide-noon":"noon","timeFormat-short":"h:mm a","field-month":"Month","quarters-format-abbr":["Q1","Q2","Q3","Q4"],"days-format-abbr":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"dateFormatItem-M":"L","days-format-narrow":["S",
"M","T","W","T","F","S"],"field-second":"Second","field-day":"Day","dateFormatItem-MEd":"E, M/d","months-format-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"dateFormatItem-hm":"h:mm a","days-standAlone-abbr":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"dateFormat-short":"M/d/yy","dateFormatItem-yMMMEd":"EEE, MMM d, y","dateFormat-full":"EEEE, MMMM d, y","dateFormatItem-Md":"M/d","dateFormatItem-yMEd":"EEE, M/d/y","months-format-wide":["January","February","March","April","May","June",
"July","August","September","October","November","December"],"dateFormatItem-d":"d","quarters-format-wide":["1st quarter","2nd quarter","3rd quarter","4th quarter"],"days-format-wide":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],eraNarrow:["B","A"]});
define("dojo/date/locale",["dojo","dojo/date","dojo/cldr/supplemental","dojo/regexp","dojo/string","dojo/i18n","i18n!dojo/cldr/nls/gregorian"],function(d){d.getObject("date.locale",true,d);(function(){function b(e,f,g,i){return i.replace(/([a-z])\1*/ig,function(j){var h,l,p=j.charAt(0);j=j.length;var t=["abbr","wide","narrow"];switch(p){case "G":h=f[j<4?"eraAbbr":"eraNames"][e.getFullYear()<0?0:1];break;case "y":h=e.getFullYear();switch(j){case 1:break;case 2:if(!g.fullYear){h=String(h);h=h.substr(h.length-
2);break}default:l=true}break;case "Q":case "q":h=Math.ceil((e.getMonth()+1)/3);l=true;break;case "M":h=e.getMonth();if(j<3){h=h+1;l=true}else{p=["months-format",t[j-3]].join("-");h=f[p][h]}break;case "w":h=d.date.locale._getWeekOfYear(e,0);l=true;break;case "d":h=e.getDate();l=true;break;case "D":h=d.date.locale._getDayOfYear(e);l=true;break;case "E":h=e.getDay();if(j<3){h=h+1;l=true}else{p=["days-format",t[j-3]].join("-");h=f[p][h]}break;case "a":h=e.getHours()<12?"am":"pm";h=g[h]||f["dayPeriods-format-wide-"+
h];break;case "h":case "H":case "K":case "k":l=e.getHours();switch(p){case "h":h=l%12||12;break;case "H":h=l;break;case "K":h=l%12;break;case "k":h=l||24;break}l=true;break;case "m":h=e.getMinutes();l=true;break;case "s":h=e.getSeconds();l=true;break;case "S":h=Math.round(e.getMilliseconds()*Math.pow(10,j-3));l=true;break;case "v":case "z":if(h=d.date.locale._getZone(e,true,g))break;j=4;case "Z":h=d.date.locale._getZone(e,false,g);h=[h<=0?"+":"-",d.string.pad(Math.floor(Math.abs(h)/60),2),d.string.pad(Math.abs(h)%
60,2)];if(j==4){h.splice(0,0,"GMT");h.splice(3,0,":")}h=h.join("");break;default:throw new Error("dojo.date.locale.format: invalid pattern char: "+i);}if(l)h=d.string.pad(h,j);return h})}function a(e,f,g,i){var j=function(p){return p};f=f||j;g=g||j;i=i||j;var h=e.match(/(''|[^'])+/g),l=e.charAt(0)=="'";d.forEach(h,function(p,t){if(p){h[t]=(l?g:f)(p.replace(/''/g,"'"));l=!l}else h[t]=""});return i(h.join(""))}function c(e,f,g,i){i=d.regexp.escapeString(i);g.strict||(i=i.replace(" a"," ?a"));return i.replace(/([a-z])\1*/ig,
function(j){var h;h=j.charAt(0);var l=j.length,p="",t="";if(g.strict){if(l>1)p="0{"+(l-1)+"}";if(l>2)t="0{"+(l-2)+"}"}else{p="0?";t="0{0,2}"}switch(h){case "y":h="\\d{2,4}";break;case "M":h=l>2?"\\S+?":"1[0-2]|"+p+"[1-9]";break;case "D":h="[12][0-9][0-9]|3[0-5][0-9]|36[0-6]|"+t+"[1-9][0-9]|"+p+"[1-9]";break;case "d":h="3[01]|[12]\\d|"+p+"[1-9]";break;case "w":h="[1-4][0-9]|5[0-3]|"+p+"[1-9]";break;case "E":h="\\S+";break;case "h":h="1[0-2]|"+p+"[1-9]";break;case "k":h="1[01]|"+p+"\\d";break;case "H":h=
"1\\d|2[0-3]|"+p+"\\d";break;case "K":h="1\\d|2[0-4]|"+p+"[1-9]";break;case "m":case "s":h="[0-5]\\d";break;case "S":h="\\d{"+l+"}";break;case "a":l=g.am||f["dayPeriods-format-wide-am"];p=g.pm||f["dayPeriods-format-wide-pm"];h=l+"|"+p;if(!g.strict){if(l!=l.toLowerCase())h+="|"+l.toLowerCase();if(p!=p.toLowerCase())h+="|"+p.toLowerCase();if(h.indexOf(".")!=-1)h+="|"+h.replace(/\./g,"")}h=h.replace(/\./g,"\\.");break;default:h=".*"}e&&e.push(j);return"("+h+")"}).replace(/[\xa0 ]/g,"[\\s\\xa0]")}d.date.locale._getZone=
function(e,f){return f?d.date.getTimezoneName(e):e.getTimezoneOffset()};d.date.locale.format=function(e,f){f=f||{};var g=d.i18n.normalizeLocale(f.locale),i=f.formatLength||"short";g=d.date.locale._getGregorianBundle(g);var j=[];e=d.hitch(this,b,e,g,f);if(f.selector=="year")return a(g["dateFormatItem-yyyy"]||"yyyy",e);var h;if(f.selector!="date")(h=f.timePattern||g["timeFormat-"+i])&&j.push(a(h,e));if(f.selector!="time")(h=f.datePattern||g["dateFormat-"+i])&&j.push(a(h,e));return j.length==1?j[0]:
g["dateTimeFormat-"+i].replace(/\{(\d+)\}/g,function(l,p){return j[p]})};d.date.locale.regexp=function(e){return d.date.locale._parseInfo(e).regexp};d.date.locale._parseInfo=function(e){e=e||{};var f=d.i18n.normalizeLocale(e.locale);f=d.date.locale._getGregorianBundle(f);var g=e.formatLength||"short",i=e.datePattern||f["dateFormat-"+g],j=e.timePattern||f["timeFormat-"+g];g=e.selector=="date"?i:e.selector=="time"?j:f["dateTimeFormat-"+g].replace(/\{(\d+)\}/g,function(l,p){return[j,i][p]});var h=[];
return{regexp:a(g,d.hitch(this,c,h,f,e)),tokens:h,bundle:f}};d.date.locale.parse=function(e,f){var g=/[\u200E\u200F\u202A\u202E]/g,i=d.date.locale._parseInfo(f),j=i.tokens,h=i.bundle;e=(new RegExp("^"+i.regexp.replace(g,"")+"$",i.strict?"":"i")).exec(e&&e.replace(g,""));if(!e)return null;var l=["abbr","wide","narrow"],p=[1970,0,1,0,0,0,0],t="";e=d.every(e,function(s,v){if(!v)return true;v=j[v-1];var z=v.length;switch(v.charAt(0)){case "y":if(z!=2&&f.strict)p[0]=s;else if(s<100){s=Number(s);z=""+(new Date).getFullYear();
v=z.substring(0,2)*100;z=Math.min(Number(z.substring(2,4))+20,99);p[0]=s<z?v+s:v-100+s}else{if(f.strict)return false;p[0]=s}break;case "M":if(z>2){v=h["months-format-"+l[z-3]].concat();if(!f.strict){s=s.replace(".","").toLowerCase();v=d.map(v,function(k){return k.replace(".","").toLowerCase()})}s=d.indexOf(v,s);if(s==-1)return false}else s--;p[1]=s;break;case "E":case "e":v=h["days-format-"+l[z-3]].concat();if(!f.strict){s=s.toLowerCase();v=d.map(v,function(k){return k.toLowerCase()})}s=d.indexOf(v,
s);if(s==-1)return false;break;case "D":p[1]=0;case "d":p[2]=s;break;case "a":v=f.am||h["dayPeriods-format-wide-am"];z=f.pm||h["dayPeriods-format-wide-pm"];if(!f.strict){var y=/\./g;s=s.replace(y,"").toLowerCase();v=v.replace(y,"").toLowerCase();z=z.replace(y,"").toLowerCase()}if(f.strict&&s!=v&&s!=z)return false;t=s==z?"p":s==v?"a":"";break;case "K":if(s==24)s=0;case "h":case "H":case "k":if(s>23)return false;p[3]=s;break;case "m":p[4]=s;break;case "s":p[5]=s;break;case "S":p[6]=s}return true});
g=+p[3];if(t==="p"&&g<12)p[3]=g+12;else if(t==="a"&&g==12)p[3]=0;g=new Date(p[0],p[1],p[2],p[3],p[4],p[5],p[6]);f.strict&&g.setFullYear(p[0]);var r=j.join("");i=r.indexOf("d")!=-1;r=r.indexOf("M")!=-1;if(!e||r&&g.getMonth()>p[1]||i&&g.getDate()>p[2])return null;if(r&&g.getMonth()<p[1]||i&&g.getDate()<p[2])g=d.date.add(g,"hour",1);return g}})();(function(){var b=[];d.date.locale.addCustomFormats=function(a,c){b.push({pkg:a,name:c})};d.date.locale._getGregorianBundle=function(a){var c={};d.forEach(b,
function(e){e=d.i18n.getLocalization(e.pkg,e.name,a);c=d.mixin(c,e)},this);return c}})();d.date.locale.addCustomFormats("dojo.cldr","gregorian");d.date.locale.getNames=function(b,a,c,e){var f;e=d.date.locale._getGregorianBundle(e);b=[b,c,a];if(c=="standAlone"){c=b.join("-");f=e[c];if(f[0]==1)f=undefined}b[1]="format";return(f||e[b.join("-")]).concat()};d.date.locale.isWeekend=function(b,a){a=d.cldr.supplemental.getWeekend(a);b=(b||new Date).getDay();if(a.end<a.start){a.end+=7;if(b<a.start)b+=7}return b>=
a.start&&b<=a.end};d.date.locale._getDayOfYear=function(b){return d.date.difference(new Date(b.getFullYear(),0,1,b.getHours()),b)+1};d.date.locale._getWeekOfYear=function(b,a){if(arguments.length==1)a=0;var c=(new Date(b.getFullYear(),0,1)).getDay(),e=(c-a+7)%7;e=Math.floor((d.date.locale._getDayOfYear(b)+e-1)/7);c==a&&e++;return e};return d.date.locale});
define("orion/auth",["dojo","dijit","orion/globalCommands","dojo/date/locale","orion/widgets/LoginDialog"],function(d,b,a){function c(g,i){if(g.status===403){if(typeof e==="undefined")e=new b.Dialog({title:"Forbidden access"});var j=g.message;if(g.responseText)j=JSON.parse(g.responseText).Message||g.message;e.set("content",j);e.show()}if(g.status===401)try{var h=JSON.parse(g.responseText),l=localStorage.getItem(h.SignInKey),p=function(){var r=localStorage.getItem(h.SignInKey);if(l!==r){window.removeEventListener("storage",
p,false);delete f[h.SignInKey];a.setPendingAuthentication(f);i&&i()}};window.addEventListener("storage",p,false);if(h.SignInKey){f[h.SignInKey]=h;a.setPendingAuthentication(f)}}catch(t){}}var e,f={};d.addOnLoad(function(){window.dojo=d;window.eclipse=window.eclipse||{};eclipse.globalCommandUtils=a});return{handleAuthenticationError:c}});
define("dojo/DeferredList",["dojo"],function(d){d.DeferredList=function(b,a,c,e){var f=[];d.Deferred.call(this);var g=this;b.length===0&&!a&&this.resolve([0,[]]);var i=0;d.forEach(b,function(j,h){function l(p,t){f[h]=[p,t];i++;i===b.length&&g.resolve(f)}j.then(function(p){a?g.resolve([h,p]):l(true,p)},function(p){c?g.reject(p):l(false,p);if(e)return null;throw p;})})};d.DeferredList.prototype=new d.Deferred;d.DeferredList.prototype.gatherResults=function(b){b=new d.DeferredList(b,false,true,false);
b.addCallback(function(a){var c=[];d.forEach(a,function(e){c.push(e[1])});return c});return b};return d.DeferredList});
define("orion/preferences",["require","dojo","orion/auth","dojo/DeferredList"],function(d,b,a){function c(h,l){this._name=h;this._providers=l;this._flushPending=false;this._cached=null;this._stores=[];this._dirty=[]}function e(h,l){return{get:function(p,t){if(l===0)return null;p=localStorage.getItem(h+p);if(p===null)return null;p=JSON.parse(p);if(t||l===-1||p._expires&&p._expires>(new Date).getTime()){delete p._expires;return p}return null},set:function(p,t){if(l!==0){if(l!==-1)t._expires=(new Date).getTime()+
1E3*l;if(Object.keys(t).length===0)localStorage.removeItem(h+p);else{var r=JSON.stringify(t);localStorage.setItem(h+p,r);delete t._expires}}},remove:function(p){localStorage.removeItem(h+p)}}}function f(h){this._currentPromises={};this._cache=new e("/orion/preferences/user",0);this._service=null;this.available=function(){var l=this;if(!this._service){var p=h.getServiceReferences("orion.core.preference.provider");p.length>0&&h.getService(p[0],0).then(function(t){l._service=t})}return!!this._service}}
function g(h){this._location=h;this._currentPromise=null;this._cache=new e("/orion/preferences/default",3600)}function i(){this._cache=new e("/orion/preferences/local",-1)}function j(h,l){this._userProvider=new f(h);this._localProvider=new i;l=l||"defaults.pref";if(l.indexOf("://")===-1)l=d.toUrl(l);this._defaultsProvider=new g(l);this._serviceRegistration=h.registerService("orion.core.preference",this)}c.prototype={_flush:function(){for(var h=[],l=0;l<this._stores.length;++l){var p=this._stores[l];
this._dirty.indexOf(p)!==-1&&h.push(this._providers[l].put(this._name,p))}this._dirty=[];return new b.DeferredList(h)},_scheduleFlush:function(h){this._dirty.indexOf(h)===-1&&this._dirty.push(h);if(!this._flushPending){this._flushPending=true;window.setTimeout(b.hitch(this,function(){if(this._flushPending){this._flushPending=false;this._flush()}}),0)}},_getCached:function(){if(!this._cached){this._cached={};for(var h=0;h<this._stores.length;++h){var l=this._stores[h];for(var p in l)if(l.hasOwnProperty(p)&&
typeof this._cached[p]==="undefined")this._cached[p]=l[p]}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(h){return this._getCached()[h]},put:function(h,l){if(this._stores.length!==0){var p=this._stores[0];if(p[h]!==l){p[h]=l;this._cached=null;this._scheduleFlush(p)}}},remove:function(h){for(var l=0;l<this._stores.length;++l){var p=this._stores[l];if(p.hasOwnProperty(h)){delete p[h];this._cached=null;this._scheduleFlush(p);return true}}return false},clear:function(){for(var h=
0;h<this._stores.length;++h){this._stores[h]={};this._scheduleFlush(this._stores[h])}this._cached=null},sync:function(h){if(this._flushPending){this._flushPending=false;return this._flush()}for(var l=this,p=[],t=0;t<this._providers.length;++t)p.push(this._providers[t].get(this._name,h).then(function(r){return function(s){l._stores[r]=s}}(t)));return(new b.DeferredList(p)).then(function(){l._cached=null;l._getCached()})},flush:function(){this._flush()}};f.prototype={get:function(h,l){if(this._currentPromises[h])return this._currentPromises[h];
var p=new b.Deferred,t=null;if(l)this._cache.remove(h);else t=this._cache.get(h);if(t!==null)p.resolve(t);else{this._currentPromises[h]=p;var r=this;this._service.get(h).then(function(s){r._cache.set(h,s);delete r._currentPromises[h];p.resolve(s)},function(s){if(s.status===401){delete r._currentPromises[h];p.resolve({});a.handleAuthenticationError(s,function(){r.get(h)})}else if(s.status===404){s={};r._cache.set(h,s);delete r._currentPromises[h];p.resolve(s)}else{delete r._currentPromises[h];p.resolve(r._cache.get(h,
true)||{})}})}return p},put:function(h,l){var p=new b.Deferred;this._cache.set(h,l);var t=this;this._service.put(h,l).then(function(){p.resolve()},function(r){r.status===401?a.handleAuthenticationError(r,function(){t._service.put(h,l).then(function(){p.resolve()},function(){p.resolve()})}):p.resolve()});return p}};g.prototype={get:function(h,l){if(this._currentPromise)return this._currentPromise;var p=new b.Deferred,t=null;if(l)this._cache.remove(h);else t=this._cache.get(h);if(t!==null)p.resolve(t);
else{this._currentPromise=p;var r=this;b.xhrGet({url:this._location,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,load:function(s){r._cache.set(h,s[h]||{});r._currentPromise=null;p.resolve(s[h]||{})},error:function(s,v){if(v.xhr.status===401){r._currentPromise=null;p.resolve({});p=new b.Deferred;r._currentPromise=p;var z=this;a.handleAuthenticationError(v.xhr,function(){b.xhrGet(z)})}else if(v.xhr.status===404){r._cache.set(h,{});r._currentPromise=null;p.resolve({})}else{r._currentPromise=
null;s=r._cache.get(h,true);s!==null?p.resolve(s[h]||{}):p.resolve({})}}})}return p},put:function(){var h=new b.Deferred;h.resolve();return h}};i.prototype={get:function(h){var l=new b.Deferred;h=this._cache.get(h);h!==null?l.resolve(h):l.resolve({});return l},put:function(h,l){var p=new b.Deferred;this._cache.set(h,l);p.resolve();return p}};j.DEFAULT_SCOPE=1;j.LOCAL_SCOPE=2;j.USER_SCOPE=4;j.prototype={getPreferences:function(h,l){if(!l||typeof l!=="number"||l>7||l<1)l=j.DEFAULT_SCOPE|j.LOCAL_SCOPE|
j.USER_SCOPE;var p=[];j.USER_SCOPE&l&&this._userProvider.available()&&p.push(this._userProvider);j.LOCAL_SCOPE&l&&p.push(this._localProvider);j.DEFAULT_SCOPE&l&&p.push(this._defaultsProvider);var t=new c(h,p);return t.sync().then(function(){return t})}};return{PreferencesService:j}});
define("orion/pluginregistry",["dojo","orion/serviceregistry","dojo/DeferredList"],function(d,b){var a=a||{};a.Plugin=function(c,e,f){function g(y,k,n,o){if(!p)throw new Error("plugin not connected");var m=s++;v[String(m)]=o;f.postMessage({id:m,serviceId:y,method:k,params:n},p)}function i(y){var k={};if(y.methods)for(var n=0;n<y.methods.length;n++){var o=y.methods[n];k[o]=function(m){return function(){var q=Array.prototype.slice.call(arguments),w=new d.Deferred;l._load().then(function(){g(y.serviceId,
m,q,w)});return w.promise}}(o)}return k}function j(){var y=e.services;if(y)for(var k=0;k<y.length;k++){var n=y[k],o=i(n);z[n.serviceId]=f.registerService(n.type,o,n.properties)}}function h(y){try{if(y.method)if("plugin"===y.method){if(e){if(JSON.stringify(e)!==JSON.stringify(y.params[0])){for(var k in z)if(z.hasOwnProperty(k)){z[k].unregister();delete z[k]}e=y.params[0];j();f.updatePlugin(l)}}else{e=y.params[0];j()}if(!r){r=true;t.resolve(l)}}else if("dispatchEvent"===y.method){var n=z[y.serviceId];
n.dispatchEvent.apply(n,y.params)}else if("progress"===y.method){var o=v[String(y.requestId)];o.progress.apply(o,y.params)}else throw new Error("Bad response method: "+y.method);else{o=v[String(y.id)];delete v[String(y.id)];y.error?o.reject(y.error):o.resolve(y.result)}}catch(m){console.log(m)}}var l=this,p=null,t=new d.Deferred,r=false,s=0,v={},z={};this.getLocation=function(){return c};this.getData=function(){return e};this.uninstall=function(){for(var y in z)if(z.hasOwnProperty(y)){z[y].unregister();
delete z[y]}if(p){f.disconnect(p);p=null}f.uninstallPlugin(this)};this.getServiceReferences=function(){var y=[],k;for(k in z)z.hasOwnProperty(k)&&y.push(z[k].getServiceReference());return y};this._load=function(y){if(!p){p=f.connect(c,h);window.setTimeout(function(){if(!r){if(!y){e={};f.updatePlugin(l)}t.reject(new Error("Load timeout for plugin: "+c))}},15E3)}return t.promise};if(typeof c!=="string")throw new Error("invalid url:"+c);e&&j()};a.PluginRegistry=function(c,e){function f(s){if(s.indexOf("://")===
-1){var v=document.createElement("a");v.href=s;return v.href}return s}function g(s){delete h["plugin."+s.getLocation()]}function i(s){s=f(s);for(var v=0,z=l.length;v<z;v++){var y=l[v];if(s===y.getLocation())return y}return null}function j(s){h["plugin."+s.getLocation()]=JSON.stringify(s.getData())}var h=e||localStorage||{},l=[],p=[],t=new b.EventTarget;window.addEventListener("message",function(s){for(var v=0,z=s.source;v<p.length;v++)if(z===p[v].target){if(typeof p[v].useStructuredClone==="undefined")p[v].useStructuredClone=
typeof s.data!=="string";p[v].handler(p[v].useStructuredClone?s.data:JSON.parse(s.data));break}},false);var r={registerService:d.hitch(c,c.registerService),connect:function(s,v){var z=document.createElement("iframe");z.id=s;z.name=s;z.style.display="none";z.style.visibility="hidden";z.src=s;document.body.appendChild(z);s={iframe:z,target:z.contentWindow,handler:v,url:s};p.push(s);return s},disconnect:function(s){for(var v=0;v<p.length;v++)if(s===p[v]){p.splice(v,1);try{document.body.removeChild(s.iframe)}catch(z){}break}},
uninstallPlugin:function(s){g(s);for(var v=0;v<l.length;v++)if(s===l[v]){l.splice(v,1);t.dispatchEvent("pluginRemoved",s);break}},updatePlugin:function(s){h["plugin."+s.getLocation()]=JSON.stringify(s.getData());t.dispatchEvent("pluginUpdated",s)},postMessage:function(s,v){v.target.postMessage(v.useStructuredClone?s:JSON.stringify(s),v.url)}};this.startup=function(s){for(var v=[],z=0;z<s.length;++z){var y=s[z];y=f(y);var k="plugin."+y;if(h[k]){if(i(y)===null){k=JSON.parse(h[k]);y=new a.Plugin(y,k,
r);l.push(y)}}else{h[k]="{}";y=new a.Plugin(y,{},r);l.push(y);v.push(y._load(false))}}return new d.DeferredList(v)};this.shutdown=function(){for(var s=0;s<p.length;s++)try{document.body.removeChild(p[s].iframe)}catch(v){}};this.installPlugin=function(s,v){s=f(s);var z=new d.Deferred,y=i(s);if(y)if(y.getData())z.resolve(y);else{var k=function(n){if(n.getLocation()===s){z.resolve(n);t.removeEventListener("pluginAdded",k)}};t.addEventListener("pluginAdded",k)}else{y=new a.Plugin(s,v,r);l.push(y);if(y.getData()){j(y);
t.dispatchEvent("pluginAdded",y);z.resolve(y)}else y._load(true).then(function(){j(y);t.dispatchEvent("pluginAdded",y);z.resolve(y)},function(n){z.reject(n)})}return z.promise};this.getPlugins=function(){for(var s=[],v=0;v<l.length;v++)l[v].getData()&&s.push(l[v]);return s};this.getPlugin=function(s){if((s=i(s))&&s.getData())return s;return null};this.addEventListener=function(s,v){t.addEventListener(s,v)};this.removeEventListener=function(s,v){t.removeEventListener(s,v)}};return a});
define("orion/bootstrap",["require","dojo","orion/serviceregistry","orion/preferences","orion/pluginregistry"],function(d,b,a,c,e){function f(){var g=new a.ServiceRegistry,i=new c.PreferencesService(g),j=new e.PluginRegistry(g);return i.getPreferences("/plugins").then(function(h){h=h.keys();for(var l=0;l<h.length;++l)if(h[l].indexOf("://")===-1)h[l]=d.toUrl(h[l]);return j.startup(h)}).then(function(){if(g.getServiceReferences("orion.core.preference.provider").length>0)return i.getPreferences("/plugins",
i.USER_SCOPE).then(function(h){h=h.keys();for(var l=0;l<h.length;++l)if(h[l].indexOf("://")===-1)h[l]=d.toUrl(h[l]);return j.startup(h)})}).then(function(){b.addOnWindowUnload(function(){j.shutdown()})}).then(function(){return{serviceRegistry:g,preferences:i,pluginRegistry:j}})}return{startup:f}});
define("orion/selection",["dojo"],function(d){function b(a){this._serviceRegistry=a;this._serviceRegistration=a.registerService("orion.page.selection",this);this._selections=[]}b.prototype={getSelection:function(a){a(this._getSingleSelection())},getSelections:function(a){a(this._selections)},_getSingleSelection:function(){if(this._selections&&this._selections.length>0)return this._selections[0];return null},setSelections:function(a){this._selections=d.isArray(a)?a:a?[a]:null;this._serviceRegistration.dispatchEvent("selectionChanged",
this._getSingleSelection(),this._selections)}};b.prototype.constructor=b;return{Selection:b}});
define("orion/status",["require","dojo"],function(d,b){function a(c,e,f){this._serviceRegistry=c;this._serviceRegistration=c.registerService("orion.page.message",this);this.domId=e;this.progressDomId=f||e}a.prototype={setMessage:function(c,e){b.place(window.document.createTextNode(c),this.domId,"only");if(typeof e==="number"){var f=this;window.setTimeout(function(){var g=b.byId(f.domId);(typeof g.textContent==="string"?g.textContent:g.innerText)===c&&b.place(window.document.createTextNode(""),f.domId,
"only")},e)}},setErrorMessage:function(c){var e=c.responseText||c.message||c;try{e=JSON.parse(e)}catch(f){}c=e.Message||e;var g="red";if(e.Severity)switch(e.Severity){case "Warning":g="#FFCC00";break;case "Error":g="red";break;case "Info":case "Ok":g="green";break}e=b.create("span",{style:{color:g}});b.place(window.document.createTextNode(c),e);b.place(e,this.domId,"only")},setProgressMessage:function(c){b.place(window.document.createTextNode(c),this.progressDomId,"only")},setProgressResult:function(c){c=
c.responseText||c;try{c=JSON.parse(c)}catch(e){}var f=c.Message||c,g=d.toUrl("images/info.gif"),i="info";if(c.Severity)switch(c.Severity){case "Warning":g=d.toUrl("images/warning.gif");i="warning";break;case "Error":g=d.toUrl("images/error.gif");i="error";break}var j=new Image;j.alt=i;j.title="Press to clear message";j.name=i;j.src=g;b.style(j,"opacity","0.7");b.connect(j,"onmouseover",this,function(){b.style(j,"opacity","1")});b.connect(j,"onmouseout",this,function(){b.style(j,"opacity","0.7")});
b.connect(j,"onclick",this,function(){this.setProgressMessage("")});b.place(j,this.progressDomId,"only");c.HTML?b.place(f,this.progressDomId,"last"):b.place(window.document.createTextNode("   "+f),this.progressDomId,"last")},showWhile:function(c,e){var f=this;f.setProgressMessage(e);return c.then(function(g){if(g&&g.Location&&g.Message&&g.Running)return f._doProgressWhile(g);f.setProgressMessage("");g&&g.Result&&f.setProgressResult(g.Result);return g})},_doProgressWhile:function(c){var e=new b.Deferred;
window.setTimeout(function(){b.xhrGet({url:c.Location,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,load:function(f){e.callback(f)}})},2E3);return this.showWhile(e,c.Message)}};a.prototype.constructor=a;return{StatusReportingService:a}});
define("orion/dialogs",[],function(){function d(b){this._serviceRegistry=b;this._serviceRegistration=b.registerService("orion.page.dialog",this)}d.prototype={confirm:function(b,a){a(window.confirm(b))},openFiles:function(){}};d.prototype.constructor=d;return{DialogService:d}});
define("orion/favorites",["require","dojo","orion/util","orion/commands"],function(d,b,a,c){function e(g){this._favorites=[];this._searches=[];this._init(g);this._initializeFavorites()}function f(g){var i=g.parent;if(typeof i==="string")i=b.byId(i);if(!i)throw"no parent";if(!g.serviceRegistry)throw"no service registry";this._parent=i;this._registry=g.serviceRegistry;var j=this,h=new c.Command({name:"Add Favorite",tooltip:"Add link as favorite",imageClass:"core-sprite-add",id:"eclipse.addExternalFave",
callback:b.hitch(this,function(r,s,v){this.getUserURL(v)})}),l=new c.Command({name:"Delete",imageClass:"core-sprite-delete",id:"eclipse.deleteFave",visibleWhen:function(r){return r.isFavorite},callback:function(r){window.confirm("Do you want to remove "+r.name+" from favorites?")&&g.serviceRegistry.getService("orion.core.favorite").then(function(s){s.removeFavorite(r.path)})}}),p=new c.Command({name:"Rename",imageClass:"core-sprite-rename",id:"eclipse.renameFave",visibleWhen:function(r){return r.isFavorite},
callback:b.hitch(this,function(r,s,v,z){this.editFavoriteName(r,s,v,z)})}),t=new c.Command({name:"Delete",imageClass:"core-sprite-delete",id:"eclipse.deleteSearch",visibleWhen:function(r){return r.isSearch},callback:function(r){window.confirm("Do you want to remove "+r.name+" from favorites?")&&g.serviceRegistry.getService("orion.core.favorite").then(function(s){s.removeSearch(r.query)})}});this._registry.getService("orion.page.command").then(function(r){r.addCommand(l,"object");r.addCommand(p,"object");
r.addCommand(t,"object");r.addCommand(h,"dom");r.registerCommandContribution("eclipse.renameFave",1);r.registerCommandContribution("eclipse.deleteFave",2);r.registerCommandContribution("eclipse.deleteSearch",1);r.registerCommandContribution("eclipse.addExternalFave",1,"faveCommands")});this._registry.getService("orion.core.favorite").then(function(r){r.getFavorites().then(function(s){j.render(s.navigator,s.search)});r.addEventListener("favoritesChanged",function(s){j.render(s.navigator,s.search)})})}
e.prototype={_init:function(g){this._registry=g.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.favorite",this)},_notifyListeners:function(){this._serviceRegistration.dispatchEvent("favoritesChanged",{navigator:this._favorites,search:this._searches})},makeFavorites:function(g){g=b.isArray(g)?g:[g];for(var i=0;i<g.length;i++){var j=g[i],h=j.ChildrenLocation?j.ChildrenLocation:j.Location;h=a.makeRelative(h);this.addFavorite(j.Name,h,j.Directory)}this._storeFavorites();
this._notifyListeners()},addFavoriteUrl:function(g){this.addFavorite(g,g,false,true)},addFavorite:function(g,i,j,h){this._favorites.push({name:g,path:i,directory:j,isFavorite:true,isExternalResource:h});this._storeFavorites();this._notifyListeners()},removeFavorite:function(g){for(var i in this._favorites)if(this._favorites[i].path===g){this._favorites.splice(i,1);break}this._storeFavorites();this._notifyListeners()},renameFavorite:function(g,i){var j=false;for(var h in this._favorites)if(this._favorites[h].path===
g){var l=this._favorites[h];if(l.name!==i){l.name=i;j=true}}if(j){this._storeFavorites();this._notifyListeners()}},addFavoriteSearch:function(g,i){this._searches.push({name:g,query:i,isSearch:true});this._storeSearches();this._notifyListeners()},removeSearch:function(g){for(var i in this._searches)if(this._searches[i].query===g){this._searches.splice(i,1);break}this._storeSearches();this._notifyListeners()},_initializeFavorites:function(){var g=this;this._registry.getService("orion.core.preference").then(function(i){i.getPreferences("/window/favorites").then(function(j){var h,
l=j.get("navigate");if(typeof l==="string")l=JSON.parse(l);if(l)for(h in l){l[h].isFavorite=true;g._favorites.push(l[h])}j=j.get("search");if(typeof j==="string")j=JSON.parse(j);if(j)for(h in j){j[h].isSearch=true;g._searches.push(j[h])}g._notifyListeners()})})},_storeFavorites:function(){var g=this._favorites;this._registry.getService("orion.core.preference").then(function(i){return i.getPreferences("/window/favorites")}).then(function(i){i.put("navigate",g)})},_storeSearches:function(){var g=this._searches;
this._registry.getService("orion.core.preference").then(function(i){return i.getPreferences("/window/favorites")}).then(function(i){i.put("search",g)})},getFavorites:function(){return{navigator:this._favorites,search:this._searches}}};e.prototype.constructor=e;f.prototype={getUserURL:function(g){var i=this._registry,j=b.byId("spacer");a.getUserText(g+"EditBox",j,true,"",function(h){i.getService("orion.core.favorite").then(function(l){l.addFavoriteUrl(h)})},null,"Type or paste a URL")},editFavoriteName:function(g,
i,j,h){var l=this._registry;i=b.byId("fave"+h);h=b.byId(j).parentNode;b.style(i,"display","none");h=h.childNodes;for(var p=0;p<h.length;p++)b.style(h[p],"display","none");a.getUserText(j+"EditBox",i,true,g.name,function(t){l.getService("orion.core.favorite").then(function(r){r.renameFavorite(g.path,t)})},function(){for(var t=b.byId(j).parentNode.childNodes,r=0;r<t.length;r++)b.style(t[r],"display","inline")})},render:function(g,i){var j=b.create("table",{id:"faveTable"});b.addClass(j,"favoritesTable");
var h=b.create("thead",null,j);h=b.create("tr",null,h);var l=b.create("td",null,h);b.addClass(l,"paneHeadingContainer");b.place("<span class='paneHeading'>Favorites</span>",l,"only");h=b.create("td",null,h);b.style(h,"textAlign","right");b.addClass(h,"paneHeadingContainer");b.place("<span id='faveCommands' class='paneHeadingToolbar'></span>",h,"only");for(var p,t,r,s=b.create("tbody",null,j),v=0;v<g.length;v++){var z=g[v];if(z.isExternalResource)t=z.path;else{t=z.directory?d.toUrl("navigate/table.html")+
"#"+z.path:d.toUrl("edit/edit.html")+"#"+z.path;if(t==="#")t=""}var y=z.directory?"navlinkonpage":"navlink",k="fave"+v;h=b.create("tr");h.id="row"+k;p=b.create("td",null,h,"last");b.style(p,"whiteSpace","nowrap");l=b.create("td",{id:h.id+"actions"},h,"last");b.style(l,"whiteSpace","nowrap");b.style(l,"textAlign","right");p=b.create("a",{id:k,href:t,className:y},p,"only");b.place(window.document.createTextNode(z.name),p,"only");r=b.create("span",{id:h.id+"actionsWrapper"},l,"only");b.style(r,"visibility",
"hidden");this._registry.getService("orion.page.command").then(function(q){q.renderCommands(r,"object",z,this,"image",null,v)});b.place(h,s,"last");b.connect(h,"onmouseover",h,function(){var q=b.byId(this.id+"actionsWrapper");b.style(q,"visibility","visible")});b.connect(h,"onmouseout",h,function(){var q=b.byId(this.id+"actionsWrapper");b.style(q,"visibility","hidden")})}b.place(j,this._parent,"only");var n=b.byId("faveCommands");this._registry.getService("orion.page.command").then(function(q){q.renderCommands(n,
"dom",this,this,"image")});g=b.create("tr",null,j);g=b.create("td",{colspan:2},g);b.create("span",{id:"spacer"},g);if(i.length>0){h=b.create("thead",null,j);h=b.create("tr",null,h);l=b.create("td",null,h);b.addClass(l,"paneHeadingContainer");b.place("<span class='paneHeading'>Searches</span>",l,"only");h=b.create("td",null,h);b.style(h,"textAlign","right");b.addClass(h,"paneHeadingContainer");s=b.create("tbody",null,j);for(var o=0;o<i.length;o++){var m=i[o];t=d.toUrl("search/search.html")+"#"+m.query;
h=b.create("tr");h.id="searchRow"+o;p=b.create("td",null,h,"last");l=b.create("td",{id:h.id+"actions"},h,"last");b.style(l,"textAlign","right");p=b.create("a",{href:t},p,"only");b.place(window.document.createTextNode(m.name),p,"only");r=b.create("span",{id:h.id+"actionsWrapper"},l,"only");b.style(r,"visibility","hidden");this._registry.getService("orion.page.command").then(function(q){q.renderCommands(r,"object",m,this,"image",null,o)});b.place(h,s,"last");b.connect(h,"onmouseover",h,function(){var q=
b.byId(this.id+"actionsWrapper");b.style(q,"visibility","visible")});b.connect(h,"onmouseout",h,function(){var q=b.byId(this.id+"actionsWrapper");b.style(q,"visibility","hidden")})}}}};f.prototype.constructor=f;return{FavoritesService:e,Favorites:f}});
define("orion/fileClient",["dojo","orion/auth","dojo/DeferredList"],function(d,b){function a(f,g,i){var j=new d.Deferred;f[g].apply(f,i).then(function(h){j.callback(h)},function(h){h.status===401?b.handleAuthenticationError(h,function(){f[g].apply(f,i).then(function(l){j.callback(l)},function(l){j.errback(l)})}):j.errback(h)});return j}function c(f,g,i,j){if(!f.readBlob)throw"source file service does not support binary read";if(!i.writeBlob)throw"target file service does not support binary write";
if(g[g.length-1]!=="/")return a(f,"readBlob",[g]).then(function(p){return a(i,"writeBlob",[j,p])});var h=j.substring(0,j.length-1),l=decodeURIComponent(h.substring(h.lastIndexOf("/")+1));h=h.substring(0,h.lastIndexOf("/")+1);return a(i,"createFolder",[h,l]).then(function(){},function(){}).then(function(){if(g.indexOf("/")===0)g+="?depth=1";return a(f,"fetchChildren",[g]).then(function(p){for(var t=[],r=0;r<p.length;++r){var s=p[r].Location,v=s;if(p[r].Directory)v=s.substring(0,s.length-1);v=decodeURIComponent(v.substring(v.lastIndexOf("/")+
1));v=j+encodeURIComponent(v);if(p[r].Directory)v+="/";t[r]=c(f,s,i,v)}return new d.DeferredList(t)})})}function e(f,g){function i(z){var y=new d.Deferred;y.reject("No Matching FileService for location:"+z);return y}var j=f.getServiceReferences("orion.core.file"),h=j;if(g){h=[];for(var l=0;l<j.length;++l)g(j[l])&&h.push(j[l])}for(var p=[],t=[],r=[],s={fetchChildren:function(){var z=new d.Deferred;z.resolve(r);return z},createWorkspace:function(){var z=new d.Deferred;z.reject("no file service");return z},
loadWorkspaces:function(){var z=new d.Deferred;z.reject("no file service");return z},loadWorkspace:function(){var z=new d.Deferred;z.resolve({Directory:true,Length:0,LocalTimeStamp:0,Name:"",Location:"",Children:r});return z},createProject:i,createFolder:i,createFile:i,deleteFile:i,moveFile:i,copyFile:i,read:i,write:i},v=0;v<h.length;++v){r[v]={Directory:true,Length:0,LocalTimeStamp:0,Location:h[v].getProperty("top"),ChildrenLocation:h[v].getProperty("top"),Name:h[v].getProperty("Name")};g=h[v].getProperty("pattern")||
".*";if(g[0]!=="^")g="^"+g;p[v]=new RegExp(g);f.getService(h[v],0).then(function(z){t[v]=z})}if(t.length===1)s=t[0];this._getService=function(z){if(!z)return s;for(var y=0;y<p.length;++y)if(p[y].test(z))return t[y];throw"No Matching FileService for location:"+z;}}e.prototype={fetchChildren:function(f){return a(this._getService(f),"fetchChildren",arguments)},createWorkspace:function(){return a(this._getService(),"createWorkspace",arguments)},loadWorkspaces:function(){return a(this._getService(),"loadWorkspaces",
arguments)},loadWorkspace:function(f){return a(this._getService(f),"loadWorkspace",arguments)},createProject:function(f){return a(this._getService(f),"createProject",arguments)},createFolder:function(f){return a(this._getService(f),"createFolder",arguments)},createFile:function(f){return a(this._getService(f),"createFile",arguments)},deleteFile:function(f){return a(this._getService(f),"deleteFile",arguments)},moveFile:function(f,g,i){var j=this._getService(f),h=this._getService(g);if(j===h)return a(j,
"moveFile",arguments);var l=f[f.length-1]==="/",p=g;if(p[p.length-1]!=="/")p+="/";if(i)p+=encodeURIComponent(i);else{var t=f;if(l)t=t.substring(0,t.length-1);p+=t.substring(t.lastIndexOf("/")+1)}if(l&&p[p.length-1]!=="/")p+="/";return c(j,f,h,p).then(function(){return a(j,"deleteFile",[f])})},copyFile:function(f,g){var i=this._getService(f),j=this._getService(g);if(i===j)return a(i,"copyFile",arguments);var h=f[f.length-1]==="/",l=g;if(l[l.length-1]!=="/")l+="/";var p=f;if(h)p=p.substring(0,p.length-
1);l+=p.substring(p.lastIndexOf("/")+1);if(h&&l[l.length-1]!=="/")l+="/";return c(i,f,j,l)},read:function(f){return a(this._getService(f),"read",arguments)},write:function(f){return a(this._getService(f),"write",arguments)},remoteImport:function(f){return a(this._getService(f),"remoteImport",arguments)},remoteExport:function(f){return a(this._getService(f),"remoteExport",arguments)}};e.prototype.constructor=e;return{FileClient:e}});
define("orion/treetable",["dojo"],function(d){function b(a){this._init(a)}b.prototype={_init:function(a){var c=a.parent,e=this;if(typeof c==="string")c=d.byId(c);if(!c)throw"no parent";if(!a.model)throw"no tree model";if(!a.renderer)throw"no renderer";this._parent=c;this._treeModel=a.model;this._renderer=a.renderer;this._showRoot=a.showRoot===undefined?false:a.showRoot;this._indent=a.indent===undefined?16:a.indent;this._labelColumnIndex=a.labelColumnIndex===undefined?0:a.labelColumnIndex;this._id=
a.id===undefined?"treetable":a.id;this._root=this._treeModel.getRoot(function(f){if(this._showRoot){f._depth=0;this._generate([f],0)}else e._treeModel.getChildren(f,function(g){e._generate(g,0)})})},_generate:function(a,c){d.empty(this._parent);var e=document.createElement("table");e.id=this._id;this._renderer.initTable(e,this);var f=document.createElement("tbody");f.id=this._id+"tbody";this._generateChildren(a,c,f,"last");e.appendChild(f);this._parent.appendChild(e);this._rowsChanged()},_generateChildren:function(a,
c,e,f){for(var g in a){var i=document.createElement("tr");i.id=this._treeModel.getId(a[g]);i._depth=c;i._item=a[g];this._renderer.render(a[g],i);d.style(i.childNodes[this._labelColumnIndex],"paddingLeft",this._indent*c+"px");d.place(i,e,f);if(f==="after")e=i}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(a,c,e,f,g,i){var j=this._treeModel.getId(a),h;if(j===this._id){this._removeChildRows(j);
this._generateChildren(c,0,d.byId(j+"tbody"),"last");this._rowsChanged()}else{var l=d.byId(j);if(l){l._item=a;if(l&&(e||l._expanded)){l._expanded=true;this._removeChildRows(j);if(c){this._generateChildren(c,l._depth+1,l,"after");this._rowsChanged();if(f&&g){a=d.byId(f);d.addClass(a,g);i&&d.removeClass(a,i)}}else{h=this;c=this._treeModel.getChildren(l._item,function(p){h._generateChildren(p,l._depth+1,l,"after");h._rowsChanged()})}}}else console.log("could not find table row "+j)}},refreshAndExpand:function(a,
c,e,f,g){this.refresh(a,c,true,e,f,g)},getItem:function(a){if(typeof a==="string"){var c=d.byId(a);if(c)return c._item}if(a._item)return a._item;return a},toggle:function(a,c,e,f){var g=d.byId(a);if(g)if(g._expanded){this.collapse(a);if(c){a=d.byId(c);d.addClass(a,f);d.removeClass(a,e)}}else{this.expand(a);if(c){a=d.byId(c);d.addClass(a,e);d.removeClass(a,f)}}},isExpanded:function(a){if(a=d.byId(a))return a._expanded;return false},expand:function(a,c,e){a=typeof a==="string"?a:this._treeModel.getId(a);
var f=d.byId(a);if(f)if(!f._expanded){f._expanded=true;var g=this;this._treeModel.getChildren(f._item,function(i){g._generateChildren(i,f._depth+1,f,"after");g._rowsChanged();c&&c.apply(this,e)})}},_removeChildRows:function(a){d.byId(this._id);var c=a===this._id,e=false,f=-1,g=[];d.query(".treeTableRow").forEach(function(h){if(!e)if(c)if(h._depth>f)g.push(h);else e=true;else if(h.id===a){c=true;f=h._depth}});for(var i in g){var j=g[i];j.parentNode.removeChild(j)}},collapse:function(a){a=typeof a===
"string"?a:this._treeModel.getId(a);var c=d.byId(a);if(c)if(c._expanded){c._expanded=false;this._removeChildRows(a);this._rowsChanged()}}};b.prototype.constructor=b;return{TableTree:b}});
define("orion/explorer",["require","dojo","orion/treetable"],function(d,b,a){var c={};c.Explorer=function(){function e(f,g,i){this.registry=f;this.renderer=i;this.selection=g;this.myTree=null}e.prototype={changedItem:function(f,g){b.hitch(this.myTree,this.myTree.refreshAndExpand)(f,g)},updateCommands:function(f){this.myTree&&b.hitch(this.myTree._renderer,this.myTree._renderer.updateCommands(f))},makeNewItemPlaceHolder:function(f,g,i){f=this.getRow(f);if(i){f=f.childNodes[i];b.place("<br><span id='"+
g+"placeHolderRow'></span>",f,"last");if(i=b.byId(g+"placeHolderRow"))return{tempNode:i,refNode:i}}if(f){b.place("<tr id='"+g+"placeHolderRow'><td id='"+g+"placeHolderCol'></td>",f,"after");i=b.byId(g+"placeHolderRow");f=b.byId(g+"placeHolderCol");if(i&&f)return{tempNode:i,refNode:f}}return null},getRow:function(f){if(f=this.model.getId(f))return b.byId(f)},createTree:function(f,g){var i=f+"innerTree",j=b.byId(i);j&&b.destroy(j);if(g)g.rootId=i;this.model=g;this.myTree=new a.TableTree({id:i,model:g,
showRoot:false,parent:f,labelColumnIndex:this.checkbox?1:0,renderer:this.renderer});this.renderer._initializeUIState()},getRootPath:function(){if(this.model&&this.model.root)return this.model.root.Location;return null},_lastHash:null,checkbox:this.checkbox||true};return e}();c.ExplorerModel=function(){function e(f,g){this.rootPath=f;this.fetchItems=g}e.prototype={destroy:function(){},getRoot:function(f){this.fetchItems(this.rootPath).then(b.hitch(this,function(g){this.root=g;f(g)}))},getChildren:function(f,
g){if(f.Children)g(f.Children);else f.ChildrenLocation?this.fetchItems(f.ChildrenLocation).then(b.hitch(this,function(i){f.Children=i;g(i)})):g([])},getId:function(f){if(f===this.root)f=this.rootId;else{f=f.Location;f=f.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")}return f}};return e}();c.ExplorerFlatModel=function(){function e(f,g,i){this.rootPath=f;this.fetchItems=g;this.root=i}e.prototype=new c.ExplorerModel;e.prototype.getRoot=function(f){this.root?f(this.root):this.fetchItems(this.rootPath).then(b.hitch(this,
function(g){this.root=g;f(g)}))};e.prototype.getChildren=function(f,g){f===this.root?g(this.root):g([])};return e}();c.ExplorerRenderer=function(){function e(f,g){this.explorer=g;this._init(f);this._expandImageClass="core-sprite-twistie_open";this._collapseImageClass="core-sprite-twistie_closed"}e.prototype={initTable:function(f,g){this.tableTree=g;b.empty(f);b.addClass(f,"treetable");this.renderTableHeader(f)},getActionsColumn:function(f,g){b.connect(g,"onmouseover",g,function(){var h=b.byId(this.id+
"actionswrapper");b.style(h,"visibility","visible")});b.connect(g,"onmouseout",g,function(){var h=b.byId(this.id+"actionswrapper");b.style(h,"visibility","hidden")});var i=document.createElement("td");i.id=g.id+"actions";var j=document.createElement("span");j.id=g.id+"actionswrapper";i.appendChild(j);b.style(j,"visibility","hidden");this.explorer.registry.getService("orion.page.command").then(function(h){h.renderCommands(j,"object",f,this.explorer,"image")});return i},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},
getCheckboxColumn:function(f,g){if(this._useCheckboxSelection){f=document.createElement("td");b.addClass(f,"secondaryColumn");var i=document.createElement("input");b.style(i,"verticalAlign","middle");i.type="checkbox";i.id=g.id+"selectedState";b.addClass(i,"selectionCheckmark");i.itemId=g.id;f.appendChild(i);b.connect(i,"onclick",b.hitch(this,function(j){b.toggleClass(g,"checkedRow",!!j.target.checked);this._storeSelections();this.explorer.selection&&this.explorer.selection.setSelections(this.getSelected())}));
return f}},_storeSelections:function(){var f=this.getSelectedIds(),g=this._getUIStatePreferencePath();if(g&&window.sessionStorage)window.sessionStorage[g+"selection"]=JSON.stringify(f)},_restoreSelections:function(f){f=window.sessionStorage[f+"selection"];if(typeof f==="string")f=f.length>0?JSON.parse(f):null;var g;if(f)for(g=0;g<f.length;g++){var i=b.byId(f[g]);if(i){b.addClass(i,"checkedRow");if(i=b.byId(i.id+"selectedState"))i.checked=true}}f=this.getSelected();this.explorer.selection&&this.explorer.selection.setSelections(f)},
_storeExpansions:function(f){window.sessionStorage[f+"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(f){var g=false,i=window.sessionStorage[f+"expanded"];if(typeof i==="string")i=i.length>0?JSON.parse(i):null;var j;if(i)for(j=0;j<i.length;j++)if(b.byId(i[j])){this._expanded.push(i[j]);this.tableTree.expand(i[j],b.hitch(this,function(){this._restoreSelections(f)}));g=true}return!g},_getUIStatePreferencePath:function(){if(this.explorer){var f=this.explorer.getRootPath();if(this._cachePrefix&&
f)return"/"+this._cachePrefix+"/"+f.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")+"/uiState"}return null},expandCollapseImageId:function(f){return f+"__expand"},getExpandImage:function(f,g,i,j){var h=b.create("span",{id:this.expandCollapseImageId(f.id)},g,"last");b.addClass(h,"imageSprite");b.addClass(h,this._collapseImageClass);g=b.create("span",null,g,"last");b.addClass(g,j||"imageSprite");b.addClass(g,i||"core-sprite-folder");h.onclick=b.hitch(this,function(){this.tableTree.toggle(f.id,this.expandCollapseImageId(f.id),
this._expandImageClass,this._collapseImageClass);if(this.tableTree.isExpanded(f.id))this._expanded.push(f.id);else for(var l in this._expanded)if(this._expanded[l]===f.id){this._expanded.splice(l,1);break}(l=this._getUIStatePreferencePath())&&window.sessionStorage&&this._storeExpansions(l)});return h},render:function(f,g){g.cellSpacing="8px";this.renderRow(f,g)},getSelected:function(){var f=[];b.query(".selectionCheckmark").forEach(b.hitch(this,function(g){g.checked&&f.push(this.tableTree.getItem(g.parentNode.parentNode))}));
return f},getSelectedIds:function(){var f=[];b.query(".selectionCheckmark").forEach(b.hitch(this,function(g){g.checked&&f.push(g.parentNode.parentNode.id)}));return f},rowsChanged:function(){b.query(".treeTableRow").forEach(function(f,g){if(g%2){b.addClass(f,"darkTreeTableRow");b.removeClass(f,"lightTreeTableRow")}else{b.addClass(f,"lightTreeTableRow");b.removeClass(f,"darkTreeTableRow")}});this.explorer.selection&&this.explorer.selection.setSelections(this.getSelected())},updateCommands:function(){var f=
this.explorer.registry;b.query(".treeTableRow").forEach(function(g){var i=b.byId(g.id+"actionswrapper");b.empty(i);f.getService("orion.page.command").then(function(j){j.renderCommands(i,"object",g._item,this.explorer,"image")})})},_init:function(f){if(f){this._useCheckboxSelection=f.checkbox===undefined?false:f.checkbox;this._colums=f.colums||[];this._cachePrefix=f.cachePrefix}},_initializeUIState:function(){this._expanded=[];var f=this._getUIStatePreferencePath();f&&window.sessionStorage&&this._restoreExpansions(f)&&
this._restoreSelections(f)}};return e}();c.SelectionRenderer=function(){function e(f,g){this._init(f);this.explorer=g}e.prototype=new c.ExplorerRenderer;e.prototype.renderTableHeader=function(f){var g=document.createElement("thead"),i=document.createElement("tr");b.addClass(g,"navTableHeading");this._useCheckboxSelection&&i.appendChild(this.initCheckboxColumn(f));for(var j=0,h=this.getCellHeaderElement(j);h;){b.addClass(h,"navColumn");i.appendChild(h);h=this.getCellHeaderElement(++j)}g.appendChild(i);
f.appendChild(g)};e.prototype.renderRow=function(f,g){b.style(g,"verticalAlign","baseline");b.addClass(g,"treeTableRow");var i=this.getCheckboxColumn(f,g);i&&g.appendChild(i);i=0;for(var j=this.getCellElement(i,f,g);j;){g.appendChild(j);b.addClass(j,"secondaryColumn");j=this.getCellElement(++i,f,g)}};e.prototype.getCellHeaderElement=function(){};e.prototype.getCellElement=function(){};return e}();return c});
define("orion/searchExplorer",["require","dojo","dijit","orion/explorer","orion/util","orion/fileClient","orion/commands"],function(d,b,a,c,e,f,g){function i(l,p,t,r,s){this.registry=l;this.fileClient=p;this._resultLocation=t;this.searchStr=r.toLowerCase();this._treeRoot={isRoot:true,children:[]};this._listRoot={isRoot:true,children:[]};this.indexedFileItems=this.currentDetail=null;this.modelLocHash=[];this._lineDelimiter="\n";this.explorer=s}function j(l,p){this._init(l);this.explorer=p}function h(l,
p,t,r,s){this.parentNode=r;this.registry=l;this._commandService=p;this.fileClient=new f.FileClient(this.registry);this.checkbox=false;this.renderer=new j({checkbox:false},this);this.model=new i(l,this.fileClient,t,s,this)}i.prototype=new c.ExplorerModel;i.prototype.setCurrent=function(l,p){this.currentFileIndex=l;this.currentDetailIndex=p;this.storeStatus()};i.prototype.storeStatus=function(){window.sessionStorage[this.searchStr+"_search_result_useFlatList"]=JSON.stringify(this.useFlatList);window.sessionStorage[this.searchStr+
"_search_result_currentFileIndex"]=JSON.stringify(this.currentFileIndex);window.sessionStorage[this.searchStr+"_search_result_currentDetailIndex"]=JSON.stringify(this.currentDetailIndex)};i.prototype.restoreStatus=function(){this.useFlatList=false;var l=window.sessionStorage[this.searchStr+"_search_result_useFlatList"];if(typeof l==="string")if(l.length>0)this.useFlatList=JSON.parse(l);this.currentFileIndex=0;l=window.sessionStorage[this.searchStr+"_search_result_currentFileIndex"];if(typeof l===
"string")if(l.length>0)this.currentFileIndex=JSON.parse(l);if(this.currentFileIndex<0||this.currentFileIndex>=this.indexedFileItems.length)this.currentFileIndex=0;this.currentDetailIndex=0;l=window.sessionStorage[this.searchStr+"_search_result_currentDetailIndex"];if(typeof l==="string")if(l.length>0)this.currentDetailIndex=JSON.parse(l)};i.prototype.getRealRoot=function(){return this.useFlatList?this._listRoot:this._treeRoot};i.prototype.getRoot=function(l){l(this.getRealRoot())};i.prototype.markUpSharedParent=
function(l,p){if(this.sharedParentHash[l.Location]){var t=this.sharedParentHash[l.Location];if(typeof t==="string")if(t!==p)this.sharedParentHash[l.Location]=2}else this.sharedParentHash[l.Location]=p};i.prototype.preparecompressHash=function(){this.sharedParentHash=[];for(var l=0;l<this._resultLocation.length;l++){var p=this._resultLocation[l].metaData.Parents;if(p.length!==0)for(var t=this._resultLocation[l].location,r=0;r<p.length;r++){var s=p[r];this.markUpSharedParent(s,t);t=s.Location}}};i.prototype.compressParents=
function(l,p,t){if(l.length!==0)if(!(p>l.length-1)){var r=l[p].Name,s=l[p].Location,v=p+1,z=false;if(v<l.length)for(p=p+1;p<l.length;p++){v=p;if(this.sharedParentHash[l[p].Location]===2)break;else{r=l[p].Name+"/"+r;if(p===l.length-1)z=true}}t.push({Location:s,Name:r});z||this.compressParents(l,v,t)}};i.prototype.compressTree=function(){for(var l=0;l<this._resultLocation.length;l++)if(this._resultLocation[l].metaData){var p=this._resultLocation[l].metaData.Parents;if(p.length!==0){this.preparecompressHash();
var t=[];this.compressParents(p,0,t);this._resultLocation[l].metaData.compressedParents=t}}};i.prototype._findExistingParent=function(l,p){var t=this.modelLocHash[l[p].Location];if(t)return{parent:t,index:p};if(p===l.length-1)return null;return this._findExistingParent(l,p+1)};i.prototype.fullPathName=function(l,p){if(l&&l.parent)if(!l.parent.isRoot){p.name=l.parent.name+(p.name===""?"":"/")+p.name;l.parent&&this.fullPathName(l.parent,p)}};i.prototype.buildResultModelTree=function(l,p){p&&this.compressTree();
for(var t=0;t<this._resultLocation.length;t++)if(this._resultLocation[t].metaData){var r;r=p?this._resultLocation[t].metaData.compressedParents:this._resultLocation[t].metaData.Parents;var s=this._findExistingParent(r,0),v;if(s){v=s.parent;s=s.index}else{v=this._treeRoot;s=r.length}if(s>0)for(s=s-1;s>-1;s--){var z={parent:v,children:[],type:"dir",name:r[s].Name,location:r[s].Location};v.children.push(z);e.processSearchResultParent(v);v=this.modelLocHash[r[s].Location]=z}r={name:""};s={parent:v,type:"file",
name:this._resultLocation[t].name,linkLocation:this._resultLocation[t].linkLocation,location:this._resultLocation[t].location};this.fullPathName(s,r);s.fullPathName=r.name;this.modelLocHash[s.location]=s;v.children.push(s);e.processSearchResultParent(v)}this.prepareFileItems();this.restoreStatus();l()};i.prototype.loadOneFileMetaData=function(l,p){var t=this._resultLocation[l];this.fileClient.read(t.location,true).then(b.hitch(this,function(r){t.metaData=r;l===this._resultLocation.length-1?this.buildResultModelTree(p,
true):this.loadOneFileMetaData(l+1,p)}),b.hitch(this,function(r){console.error("Error loading file metadata: "+r.message);l===this._resultLocation.length-1?this.buildResultModelTree(p,true):this.loadOneFileMetaData(l+1,p)}))};i.prototype.prepareFileItems=function(){this.indexedFileItems=[];this.walkTreeNode(this._treeRoot);for(var l=0;l<this.indexedFileItems.length;l++)this._listRoot.children.push(this.indexedFileItems[l])};i.prototype.getFileItemIndex=function(l){for(var p=0;p<this.indexedFileItems.length;p++)if(l===
this.indexedFileItems[p])return p;return-1};i.prototype.getFileDetailItemIndex=function(l,p){if(l<0)return-1;l=this.indexedFileItems[l];if(l.children&&l.children.length>0)for(var t=0;t<l.children.length;t++)if(p===l.children[t])return t;return-1};i.prototype.walkTreeNode=function(l){if(l.children)for(var p=0;p<l.children.length;p++)this.walkTreeNode(l.children[p]);else l.type==="file"&&this.indexedFileItems.push(l)};i.prototype.getId=function(l){if(l===this.getRealRoot())l=this.rootId;else{l=l.location;
l=l.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")}return l};i.prototype.searchOneline=function(l,p){var t;t=0;for(var r=false,s=[];;){t=l.indexOf(p,t);if(t<0)break;else{s.push({startIndex:t});r=true;t=t+p.length}}if(r)return s;return null};i.prototype.searchWithinFile=function(l,p,t){p=p.split(this._lineDelimiter);if(l){l.children=[];for(var r=0;r<p.length;r++){var s=p[r];if(s&&s.length>0)if(this.searchOneline(s.toLowerCase(),t)){var v=r+1;l.children.push({parent:l,type:"detail",name:v+" : "+s,linkLocation:l.linkLocation+
"?line="+v,location:l.location+"-"+v})}}l.name=l.name+" ("+l.children.length+" matches)"}};i.prototype._fileExpanded=function(l,p){l=this.indexedFileItems[l];if(l.children&&l.children.length>0){if(p<0)p=l.children.length-1;else if(p>=l.children.length)p=0;return{childrenNumber:l.children.length,childDiv:b.byId(this.getId(l.children[p]))}}return{childrenNumber:0,childDiv:null}};i.prototype.getChildren=function(l,p){if(l.children)p(l.children);else if(l.type==="detail")p([]);else l.type==="file"&&l.location?
this.fileClient.read(l.location).then(b.hitch(this,function(t){this.searchWithinFile(l,t,this.searchStr);t=this.getId(l);if(b.byId(t))(t=b.byId(t+"NameColumn"))&&b.place(document.createTextNode(l.name),t,"only");p(l.children);if(this.highlightSelectionLater)if(l===this.indexedFileItems[this.currentFileIndex]){if(this.currentDetailIndex<0)this.currentDetailIndex=l.children.length-1;else if(this.currentDetailIndex>=l.children.length)this.currentDetailIndex=0;t=this._fileExpanded(this.currentFileIndex,
this.currentDetailIndex);b.toggleClass(t.childDiv,"currentSearchMatch",true);this.explorer.visible(t.childDiv)||t.childDiv.scrollIntoView(!this.lastNavDirection);this.highlightSelectionLater=false}}),b.hitch(this,function(t){console.error("Error loading file content: "+t.message);p([])})):p([])};i.prototype.constructor=i;j.prototype=new c.SelectionRenderer;j.prototype.getCellHeaderElement=function(l){if(l===0)return b.create("th",{innerHTML:"<h2>Search Results</h2>"});else if(this.explorer.model.useFlatList&&
l===1)return b.create("th",{innerHTML:"<h2>Location</h2>"})};j.prototype.getCellElement=function(l,p,t){switch(l){case 0:var r;if(p.type==="dir"){l=document.createElement("td");r=b.create("span",null,l,"only");this.getExpandImage(t,r);t=b.create("span",{id:t.id+"NameColumn"},r,"last")}else{l=document.createElement("td");var s=p.linkLocation;r=b.create("span",null,l,"only");if(p.type==="file")this.getExpandImage(t,r,"core-sprite-file");else{var v=this;b.connect(t,"onclick",t,function(){var y=v.explorer.model.getFileItemIndex(p.parent);
if(y>-1){var k=v.explorer.model.getFileDetailItemIndex(y,p);if(k>-1)if(!(v.explorer.model.currentFileIndex===y&&v.explorer.model.currentDetailIndex===k)){var n=v.explorer.model._fileExpanded(v.explorer.model.currentFileIndex,v.explorer.model.currentDetailIndex);n.childDiv&&b.toggleClass(n.childDiv,"currentSearchMatch",false);v.explorer.model.setCurrent(y,k);n=v.explorer.model._fileExpanded(v.explorer.model.currentFileIndex,v.explorer.model.currentDetailIndex);b.toggleClass(n.childDiv,"currentSearchMatch",
true)}}});var z=b.create("span",null,r,"last");b.addClass(z,"imageSprite");b.addClass(z,"core-sprite-none");z=b.create("span",null,r,"last");b.addClass(z,"imageSprite");b.addClass(z,"core-sprite-rightarrow")}t=b.create("a",{className:"navlink",id:t.id+"NameColumn",href:s},r,"last")}b.place(document.createTextNode(p.name),t,"only");return l;case 1:if(this.explorer.model.useFlatList&&p.type==="file"){l=document.createElement("td");r=b.create("span",null,l,"only");b.place(document.createTextNode(p.fullPathName),
r,"only");return l}}};j.prototype.constructor=j;h.prototype=new c.Explorer;h.prototype.onchange=function(){};h.prototype.initCommands=function(){var l=this,p=new g.Command({name:"Next result",imageClass:"core-sprite-move_down",id:"orion.search.nextResult",groupId:"orion.searchGroup",callback:function(){l.gotoNext(true,true)}}),t=new g.Command({name:"Previous result",imageClass:"core-sprite-move_up",id:"orion.search.prevResult",groupId:"orion.searchGroup",callback:function(){l.gotoNext(false,true)}}),
r=new g.Command({name:"Expand all results",imageClass:"core-sprite-expandAll",id:"orion.search.expandAll",groupId:"orion.searchGroup",callback:function(){l.expandAll()}}),s=new g.Command({name:"Collapse all results",imageClass:"core-sprite-collapseAll",id:"orion.search.collapseAll",groupId:"orion.searchGroup",callback:function(){l.collapseAll()}});this._commandService.addCommand(p,"dom");this._commandService.addCommand(t,"dom");this._commandService.addCommand(r,"dom");this._commandService.addCommand(s,
"dom");this._commandService.registerCommandContribution("orion.search.nextResult",1,"pageActionsRight");this._commandService.registerCommandContribution("orion.search.prevResult",2,"pageActionsRight");this._commandService.registerCommandContribution("orion.search.expandAll",3,"pageActionsRight");this._commandService.registerCommandContribution("orion.search.collapseAll",4,"pageActionsRight");b.empty("pageActionsRight");this._commandService.renderCommands("pageActionsRight","dom",l,l,"image");(p=a.byId("globalSearchOptMenu"))&&
p.destroy();p=new a.Menu({style:"display: none;",id:"globalSearchOptMenu"});p.addChild(new a.CheckedMenuItem({label:"Show as List",checked:l.model.useFlatList,onChange:function(v){l.switchTo(v)}}));p=new a.form.DropDownButton({label:"Options",dropDown:p});b.addClass(p.domNode,"commandImage");b.place(p.domNode,"pageActionsRight","last")};h.prototype.startUp=function(){var l=this;this.model.loadOneFileMetaData(0,function(){l.initCommands();l.createTree(l.parentNode,l.model);l.gotoCurrent()})};h.prototype.switchTo=
function(l){this.model.useFlatList=l;this.model.storeStatus();this.createTree(this.parentNode,this.model);this.gotoCurrent()};h.prototype.expandAll=function(){var l=this.model.getRealRoot();if(l.isRoot)for(var p=0;p<l.children.length;p++)this.expandRecursively(l.children[p]);else this.expandRecursively(l);this.gotoCurrent()};h.prototype.collapseAll=function(){var l=this.model.getRealRoot();if(l.isRoot)for(var p=0;p<l.children.length;p++)this.myTree.collapse(l.children[p]);else this.myTree.collapse(l)};
h.prototype.expandRecursively=function(l){if(l.type!=="detail"){this.myTree.expand(l);l=l.children;if(!(l===undefined||l===null))for(var p=l.length,t=0;t<p;t++)this.expandRecursively(l[t])}};h.prototype.findUIParentChain=function(l,p){p.push(l);var t=this.model.getId(l);if(b.byId(t))return p;this.findUIParentChain(l.parent,p)};h.prototype._decideNext=function(l,p){if(!p)return{newFileIndex:this.model.currentFileIndex,newDetailIndex:this.model.currentDetailIndex};p=this.model.indexedFileItems[this.model.currentFileIndex];
if(p.children&&p.children.length>0){l=l?this.model.currentDetailIndex+1:this.model.currentDetailIndex-1;if(l<0){p=this.model.currentFileIndex-1;l=-1}else if(l>p.children.length-1){p=this.model.currentFileIndex+1;l=0}else p=this.model.currentFileIndex;if(p<0)p=this.model.indexedFileItems.length-1;else if(p>=this.model.indexedFileItems.length)p=0;return{newFileIndex:p,newDetailIndex:l}}return null};h.prototype.visible=function(l){if(l.offsetWidth===0||l.offsetHeight===0)return false;var p=b.byId("orion.innerSearchResults").getClientRects()[0];
l=l.getClientRects();for(var t=0,r=l.length;t<r;t++){var s=l[t];if(s.top>=p.top&&s.top<=p.bottom&&s.bottom>=p.top&&s.bottom<=p.bottom)return true}return false};h.prototype.gotoCurrent=function(){this.gotoNext(true,false)};h.prototype.gotoNext=function(l,p){var t=this.model._fileExpanded(this.model.currentFileIndex,this.model.currentDetailIndex);t.childDiv&&b.toggleClass(t.childDiv,"currentSearchMatch",false);p=this._decideNext(l,p);this.model.highlightSelectionLater=true;this.model.lastNavDirection=
l;if(p){t=this.model._fileExpanded(p.newFileIndex,p.newDetailIndex);this.model.setCurrent(p.newFileIndex,p.newDetailIndex);if(t.childrenNumber>0){this.model.highlightSelectionLater=false;if(p.newDetailIndex<0)this.model.setCurrent(p.newFileIndex,t.childrenNumber-1);else p.newDetailIndex>=t.childrenNumber&&this.model.setCurrent(p.newFileIndex,0)}if(t.childDiv){b.toggleClass(t.childDiv,"currentSearchMatch",true);this.visible(t.childDiv)||t.childDiv.scrollIntoView(!l);return}}p=[];this.findUIParentChain(this.model.indexedFileItems[this.model.currentFileIndex],
p);for(t=p.length-1;t>-1;t--)this.myTree.expand(p[t]);if(!this.model.highlightSelectionLater){p=this.model._fileExpanded(this.model.currentFileIndex,this.model.currentDetailIndex);b.toggleClass(p.childDiv,"currentSearchMatch",true);this.visible(p.childDiv)||p.childDiv.scrollIntoView(!l)}};h.prototype.constructor=h;return{SearchResultExplorer:h}});
define("dojo/cookie",["dojo","dojo/regexp"],function(d){d.cookie=function(b,a,c){var e=document.cookie;if(arguments.length==1){var f=e.match(new RegExp("(?:^|; )"+d.regexp.escapeString(b)+"=([^;]*)"));return f?decodeURIComponent(f[1]):undefined}else{c=c||{};e=c.expires;if(typeof e=="number"){var g=new Date;g.setTime(g.getTime()+e*24*60*60*1E3);e=c.expires=g}if(e&&e.toUTCString)c.expires=e.toUTCString();a=encodeURIComponent(a);e=b+"="+a;for(f in c){e+="; "+f;g=c[f];if(g!==true)e+="="+g}document.cookie=
e}};d.cookie.isSupported=function(){if(!("cookieEnabled"in navigator)){this("__djCookieTest__","CookiesAllowed");navigator.cookieEnabled=this("__djCookieTest__")=="CookiesAllowed";navigator.cookieEnabled&&this("__djCookieTest__","",{expires:-1})}return navigator.cookieEnabled};return d.cookie});
define("dijit/layout/BorderContainer",["dojo","dijit","dijit/layout/_LayoutWidget","dojo/cookie","dijit/_Templated"],function(d,b){d.declare("dijit.layout.BorderContainer",b.layout._LayoutWidget,{design:"headline",gutters:true,liveSplitters:true,persist:false,baseClass:"dijitBorderContainer",_splitterClass:"dijit.layout._Splitter",postMixInProperties:function(){this.gutters||(this.baseClass+="NoGutter");this.inherited(arguments)},startup:function(){if(!this._started){d.forEach(this.getChildren(),
this._setupChild,this);this.inherited(arguments)}},_setupChild:function(a){var c=a.region;if(c){this.inherited(arguments);d.addClass(a.domNode,this.baseClass+"Pane");var e=this.isLeftToRight();if(c=="leading")c=e?"left":"right";if(c=="trailing")c=e?"right":"left";if(c!="center"&&(a.splitter||this.gutters)&&!a._splitterWidget){var f=d.getObject(a.splitter?this._splitterClass:"dijit.layout._Gutter");e=new f({id:a.id+"_splitter",container:this,child:a,region:c,live:this.liveSplitters});e.isSplitter=
true;a._splitterWidget=e;d.place(e.domNode,a.domNode,"after");e.startup()}a.region=c}},layout:function(){this._layoutChildren()},addChild:function(){this.inherited(arguments);this._started&&this.layout()},removeChild:function(a){var c=a.region,e=a._splitterWidget;if(e){e.destroy();delete a._splitterWidget}this.inherited(arguments);this._started&&this._layoutChildren();d.removeClass(a.domNode,this.baseClass+"Pane");d.style(a.domNode,{top:"auto",bottom:"auto",left:"auto",right:"auto",position:"static"});
d.style(a.domNode,c=="top"||c=="bottom"?"width":"height","auto")},getChildren:function(){return d.filter(this.inherited(arguments),function(a){return!a.isSplitter})},getSplitter:function(a){return d.filter(this.getChildren(),function(c){return c.region==a})[0]._splitterWidget},resize:function(){if(!this.cs||!this.pe){var a=this.domNode;this.cs=d.getComputedStyle(a);this.pe=d._getPadExtents(a,this.cs);this.pe.r=d._toPixelValue(a,this.cs.paddingRight);this.pe.b=d._toPixelValue(a,this.cs.paddingBottom);
d.style(a,"padding","0px")}this.inherited(arguments)},_layoutChildren:function(a,c){if(this._borderBox&&this._borderBox.h){var e=d.map(this.getChildren(),function(g,i){return{pane:g,weight:[g.region=="center"?Infinity:0,g.layoutPriority,(this.design=="sidebar"?1:-1)*(/top|bottom/.test(g.region)?1:-1),i]}},this);e.sort(function(g,i){g=g.weight;i=i.weight;for(var j=0;j<g.length;j++)if(g[j]!=i[j])return g[j]-i[j];return 0});var f=[];d.forEach(e,function(g){g=g.pane;f.push(g);g._splitterWidget&&f.push(g._splitterWidget)});
b.layout.layoutChildren(this.domNode,{l:this.pe.l,t:this.pe.t,w:this._borderBox.w-this.pe.w,h:this._borderBox.h-this.pe.h},f,a,c)}},destroyRecursive:function(){d.forEach(this.getChildren(),function(a){var c=a._splitterWidget;c&&c.destroy();delete a._splitterWidget});this.inherited(arguments)}});d.extend(b._Widget,{region:"",layoutPriority:0,splitter:false,minSize:0,maxSize:Infinity});d.declare("dijit.layout._Splitter",[b._Widget,b._Templated],{live:true,templateString:'<div class="dijitSplitter" dojoAttachEvent="onkeypress:_onKeyPress,onmousedown:_startDrag,onmouseenter:_onMouse,onmouseleave:_onMouse" tabIndex="0" role="separator"><div class="dijitSplitterThumb"></div></div>',
postMixInProperties:function(){this.inherited(arguments);this.horizontal=/top|bottom/.test(this.region);this._factor=/top|left/.test(this.region)?1:-1;this._cookieName=this.container.id+"_"+this.region},buildRendering:function(){this.inherited(arguments);d.addClass(this.domNode,"dijitSplitter"+(this.horizontal?"H":"V"));if(this.container.persist){var a=d.cookie(this._cookieName);if(a)this.child.domNode.style[this.horizontal?"height":"width"]=a}},_computeMaxSize:function(){var a=this.horizontal?"h":
"w",c=d.marginBox(this.child.domNode)[a],e=d.filter(this.container.getChildren(),function(f){return f.region=="center"})[0];a=d.marginBox(e.domNode)[a];return Math.min(this.child.maxSize,c+a)},_startDrag:function(a){if(!this.cover){this.cover=d.doc.createElement("div");d.addClass(this.cover,"dijitSplitterCover");d.place(this.cover,this.child.domNode,"after")}d.addClass(this.cover,"dijitSplitterCoverActive");this.fake&&d.destroy(this.fake);if(!(this._resize=this.live)){(this.fake=this.domNode.cloneNode(true)).removeAttribute("id");
d.addClass(this.domNode,"dijitSplitterShadow");d.place(this.fake,this.domNode,"after")}d.addClass(this.domNode,"dijitSplitterActive dijitSplitter"+(this.horizontal?"H":"V")+"Active");if(this.fake)d.removeClass(this.fake,"dijitSplitterHover dijitSplitter"+(this.horizontal?"H":"V")+"Hover");var c=this._factor,e=this.horizontal,f=e?"pageY":"pageX",g=a[f],i=this.domNode.style;e=e?"h":"w";var j=d.marginBox(this.child.domNode)[e],h=this._computeMaxSize(),l=this.child.minSize||20;e=this.region;var p=e==
"top"||e=="bottom"?"top":"left",t=parseInt(i[p],10),r=this._resize,s=d.hitch(this.container,"_layoutChildren",this.child.id);e=d.doc;this._handlers=(this._handlers||[]).concat([d.connect(e,"onmousemove",this._drag=function(v,z){v=v[f]-g;var y=c*v+j,k=Math.max(Math.min(y,h),l);if(r||z)s(k);i[p]=v+t+c*(k-y)+"px"}),d.connect(e,"ondragstart",d.stopEvent),d.connect(d.body(),"onselectstart",d.stopEvent),d.connect(e,"onmouseup",this,"_stopDrag")]);d.stopEvent(a)},_onMouse:function(a){a=a.type=="mouseover"||
a.type=="mouseenter";d.toggleClass(this.domNode,"dijitSplitterHover",a);d.toggleClass(this.domNode,"dijitSplitter"+(this.horizontal?"H":"V")+"Hover",a)},_stopDrag:function(a){try{this.cover&&d.removeClass(this.cover,"dijitSplitterCoverActive");this.fake&&d.destroy(this.fake);d.removeClass(this.domNode,"dijitSplitterActive dijitSplitter"+(this.horizontal?"H":"V")+"Active dijitSplitterShadow");this._drag(a);this._drag(a,true)}finally{this._cleanupHandlers();delete this._drag}if(this.container.persist)d.cookie(this._cookieName,
this.child.domNode.style[this.horizontal?"height":"width"],{expires:365})},_cleanupHandlers:function(){d.forEach(this._handlers,d.disconnect);delete this._handlers},_onKeyPress:function(a){this._resize=true;var c=this.horizontal,e=1,f=d.keys;switch(a.charOrCode){case c?f.UP_ARROW:f.LEFT_ARROW:e*=-1;case c?f.DOWN_ARROW:f.RIGHT_ARROW:break;default:return}c=d._getMarginSize(this.child.domNode)[c?"h":"w"]+this._factor*e;this.container._layoutChildren(this.child.id,Math.max(Math.min(c,this._computeMaxSize()),
this.child.minSize));d.stopEvent(a)},destroy:function(){this._cleanupHandlers();delete this.child;delete this.container;delete this.cover;delete this.fake;this.inherited(arguments)}});d.declare("dijit.layout._Gutter",[b._Widget,b._Templated],{templateString:'<div class="dijitGutter" role="presentation"></div>',postMixInProperties:function(){this.inherited(arguments);this.horizontal=/top|bottom/.test(this.region)},buildRendering:function(){this.inherited(arguments);d.addClass(this.domNode,"dijitGutter"+
(this.horizontal?"H":"V"))}});return b.layout.BorderContainer});
define("orion/searchClient",["require","dojo","dijit","orion/auth","orion/util","orion/searchExplorer","dijit/form/Button","dijit/layout/BorderContainer","dijit/layout/ContentPane"],function(d,b,a,c,e,f){function g(i){this.registry=i.serviceRegistry;this._commandService=i.commandService}g.prototype={search:function(i,j,h,l,p,t,r){b.xhrGet({url:j,handleAs:"json",headers:{Accept:"application/json","Orion-Version":"1"},sync:false,timeout:15E3,error:function(s,v){var z=this;c.handleAuthenticationError(v.xhr,
function(){b.xhrGet(z)})},load:b.hitch(this,function(s){this.showSearchResult(i,j,h,l,p,t,r,s)})})},handleError:function(i,j){console.error(i);var h=document.createTextNode(i);b.place(h,j,"only");return i},saveSearch:function(i,j){this.registry.getService("orion.core.favorite").then(function(h){h.addFavoriteSearch(i,j)})},createSearchQuery:function(i,j,h){if(h){j=/\*$/.test(h)?"":"*";return i+"Name:"+this._luceneEscape(h,true)+j}return i+this._luceneEscape(j)},_luceneEscape:function(i,j){var h="";
j='+-&|!(){}[]^"~:\\'+(!j?"*?":"");for(var l=0;l<i.length;l++){var p=i.charAt(l);if(j.indexOf(p)>=0)h+="\\";h+=p}return h},formatHighlight:function(i){i=i.split(/(##match|match##)/);for(var j=b.create("div"),h,l=0;l<i.length;l++){var p=i[l];if(p==="##match")h=b.create("b");else if(p==="match##"){b.place(h,j,"last");h=null}else b.place(document.createTextNode(p),h||j,"last")}return j},showSearchResult:function(i,j,h,l,p,t,r,s){r?this.showSearchResultInList(i,j,h,l,p,t,s):this.showSearchResultInTree(i,
j,h,l,p,t,s)},showSearchResultInTree:function(i,j,h,l,p,t,r){window.location.href.split("#");t=false;var s=[];b.empty(i);l=r.responseHeader.params.q;l=l.substring(l.indexOf("}")+1);if(r.response.numFound>0){for(var v=0;v<r.response.docs.length;v++){var z=r.response.docs[v];if(!z.Directory&&z.Location!==h){t||(t=true);var y;y=l&&z.LineNumber?e.hashFromPosition(z.Location,null,null,z.LineNumber,z.Offset,l.length):z.Location;s.push({linkLocation:d.toUrl("edit/edit.html")+"#"+y,location:y,name:z.Name})}}typeof p===
"function"&&p(i)}if(t)(new f.SearchResultExplorer(this.registry,this._commandService,s,i,j.split("q=")[1])).startUp();else{i=b.place("<div>No matches found for </div>",i,"only");i=b.create("b",null,i,"last");b.place(document.createTextNode(l),i,"only")}},showSearchResultInList:function(i,j,h,l,p,t,r){window.location.href.split("#");var s=false;b.empty(i);j=r.responseHeader.params.q;j=j.substring(j.indexOf("}")+1);if(r.response.numFound>0){for(var v=document.createElement("table"),z=0;z<r.response.docs.length;z++){var y=
r.response.docs[z];if(!y.Directory&&y.Location!==h){var k;if(!s){s=true;if(l){k=v.insertRow(0).insertCell(0);k.innerHTML="<h2>Search Results</h2>"}}k=v.insertRow(-1).insertCell(0);k.colspan=2;var n=document.createElement("a");b.place(document.createTextNode(y.Name),n);y.LineNumber&&b.place(document.createTextNode(" (Line "+y.LineNumber+")"),n);var o;o=j&&y.LineNumber?e.hashFromPosition(y.Location,null,null,y.LineNumber,y.Offset,j.length):y.Location;n.setAttribute("href",d.toUrl("edit/edit.html")+
"#"+o);k.appendChild(n);if(!t&&r.highlighting&&r.highlighting[y.Id]&&r.highlighting[y.Id].Text){y=r.highlighting[y.Id].Text[0];k=v.insertRow(-1).insertCell(0);k.colspan=2;b.place(this.formatHighlight(y),k,"only")}}}b.place(v,i,"last");typeof p==="function"&&p(i)}if(!s){i=b.place("<div>No matches found for </div>",i,"only");i=b.create("b",null,i,"last");b.place(document.createTextNode(j),i,"only")}}};g.prototype.constructor=g;return{Searcher:g}});
define("orion/outliner",["dojo","orion/util","orion/commands"],function(d,b,a){function c(f){this._init(f)}function e(f){this._serviceRegistry=f.serviceRegistry;this._preferences=f.preferences;this._serviceRegistration=this._serviceRegistry.registerService("orion.edit.outline",this);this._outlinePref=this._preferences.getPreferences("/edit/outline")}c.prototype={_init:function(f){var g=f.parent;if(typeof g==="string")g=d.byId(g);if(!g)throw"no parent";if(!f.outlineService)throw"no outline service";
this._parent=g;this._serviceRegistry=f.serviceRegistry;this._outlineService=f.outlineService;this._commandService=f.commandService;this._selectionService=f.selectionService;var i=this;d.when(this._outlineService,function(j){j.addEventListener("outline",function(h,l,p){i.providerId=p;i._renderMenu(i.outlineProviders);i._renderOutline.apply(i,Array.prototype.slice.call(arguments))})});this._commandService.addCommand(new a.Command({name:"Outline",id:"eclipse.edit.outline.switch",visibleWhen:function(){return true},
choiceCallback:d.hitch(this,this._menuCallback)}),"dom")},outlineChanged:function(f,g,i){var j=this;f.getOutline(i,g).then(function(h){j._renderOutline(h,g)})},setSelectedProvider:function(f){this.providerId=f.getProperty("id")},setOutlineProviders:function(f){this.outlineProviders=f;this._renderMenu(this.outlineProviders)},_renderOutline:function(f,g){if(f=f instanceof Array?f:[f]){if(this.outlineNode)d.empty(this.outlineNode);else this.outlineNode=d.create("ul",{className:"outline"});for(var i=
0;i<f.length;i++)this._renderElement(this.outlineNode,f[i],g);d.place(this.outlineNode,this._parent,"last")}},_menuCallback:function(){for(var f=[],g=0;g<this.outlineProviders.length;g++){var i=this.outlineProviders[g],j=i.getProperty("name")||i.name+i.serviceId||"undefined",h=i.getProperty("id")===this.providerId?"&bull; ":"";f.push({name:h+j,callback:d.hitch(this,this.setSelectedProvider,i)})}return f},_renderMenu:function(f){if(this.menuNode)d.empty(this.menuNode);else this.menuNode=d.create("div",
{id:"switchOutlineMenu"},this._parent,"last");if(f.length>1){this._commandService.registerCommandContribution("eclipse.edit.outline.switch",1,this.menuNode.id);this._commandService.renderCommands(this.menuNode,"dom",null,this,"image",null,null,true)}},_renderElement:function(f,g,i){if(g){f=d.create("li",null,f,"last");g.className&&d.addClass(f,g.className);if(g.href)this._createLink(g.label,g.href,f);else if(g.line||g.column||g.start){var j=b.hashFromPosition(i,g.start||null,g.end||null,g.line||null,
g.column||null,null,g.text||null);this._createLink(g.label,j,f)}else g.label&&d.place(document.createTextNode(g.label),f,"only");if(g=g.children){f=d.create("ul",null,f,"last");for(j=0;j<g.length;j++)this._renderElement(f,g[j],i)}}},_createLink:function(f,g,i){i=d.create("a",null,i,"last");if(this._selectionService)d.style(i,"cursor","pointer");else i.href=g;d.addClass(i,"navlinkonpage");d.place(document.createTextNode(f),i);if(this._selectionService){var j=this._selectionService;d.connect(i,"onclick",
i,function(h){b.openInNewWindow(h)?b.followLink(g,h):j.setSelections(g)})}return i}};c.prototype.constructor=c;e.prototype={setOutlineProviders:function(f,g,i){this.providers=f;var j=this;d.when(this._outlinePref,function(h){for(var l,p=0;p<f.length;p++){l=f[p];if(h.get("outlineProvider")===f[p].getProperty("id"))break}if(l){j.setProvider(l);j.emitOutline(g,i)}})},setProvider:function(f){this.outlineProvider=f;var g=f.getProperty("id");g&&this._outlinePref.then(function(i){i.put("outlineProvider",
g)})},emitOutline:function(f,g){var i=this;d.when(this._serviceRegistry.getService(this.outlineProvider),function(j){j.getOutline(f,g).then(function(h){i._serviceRegistration.dispatchEvent("outline",h,g,i.outlineProvider.getProperty("id"))})})}};e.prototype.constructor=e;return{Outliner:c,OutlineService:e}});
define("orion/problems",[],function(){function d(b){this._serviceRegistry=b;this._serviceRegistration=b.registerService("orion.core.marker",this)}d.prototype={_setProblems:function(b){this.problems=b;this._serviceRegistration.dispatchEvent("problemsChanged",b)}};d.prototype.constructor=d;return{ProblemService:d}});orion=orion||{};orion.editor=orion.editor||{};
orion.editor.ContentAssist=function(){function d(b,a){this.editor=b;this.textView=b.getTextView();this.contentAssistPanel=document.getElementById(a);this.active=false;this.prefix="";this.providers=[];this.filteredProviders=[];this.listeners={};this.proposals=[];this.contentAssistListener={onModelChanging:function(c){this.ignoreNextChange=this.isIgnorable(c)},onModelChanged:function(c){this.ignoreNextChange?this.cancel():this.showContentAssist(true,c);this.ignoreNextChange=false},onScroll:function(){this.cancel()}};
this.init()}d.prototype={init:function(){this.textView.setKeyBinding(navigator.platform.indexOf("Mac")!==-1?new orion.textview.KeyBinding(" ",false,false,false,true):new orion.textview.KeyBinding(" ",true),"Content Assist");this.textView.setAction("Content Assist",function(){this.showContentAssist(true);return true}.bind(this))},addEventListener:function(b,a){this.listeners[b]||(this.listeners[b]=[]);this.listeners[b].push(a)},removeEventListener:function(b,a){if(b=this.listeners[b]){a=b.indexOf(a);
a!==-1&&b.splice(a,1)}},dispatchEvent:function(b,a){a={type:b,data:a};if(b=this.listeners[b])for(var c=0;c<b.length;c++)b[c](a)},cancel:function(){this.showContentAssist(false)},isActive:function(){return this.active},isIgnorable:function(b){var a=b.removedCharCount>0&&b.addedCharCount===0,c=this.textView;c=b.start+1<=c.getModel().getCharCount()&&/^\s*$/.test(c.getText(b.start,b.start+1));return b.removedLineCount>0||a&&c},lineUp:function(){if(this.contentAssistPanel){var b=this.getSelectedNode();
b===this.contentAssistPanel.firstChild?this.setSelected(this.contentAssistPanel.lastChild):this.setSelected(b.previousSibling);return true}},lineDown:function(){if(this.contentAssistPanel){var b=this.getSelectedNode();b===this.contentAssistPanel.lastChild?this.setSelected(this.contentAssistPanel.firstChild):this.setSelected(b.nextSibling);return true}},enter:function(){return this.contentAssistPanel?this.accept():false},accept:function(){var b=this.getSelectedProposal();if(b===null)return false;this.ignoreNextChange=
true;this.cancel();this.dispatchEvent("accept",{proposal:b,start:this.textView.getCaretOffset()-this.prefix.length,end:this.textView.getCaretOffset()});return true},setSelected:function(b){for(var a=this.contentAssistPanel.childNodes,c=0;c<a.length;c++){var e=a[c];if(e.className==="selected")e.className="";if(e===b){e.className="selected";e.focus();if(e.offsetTop<this.contentAssistPanel.scrollTop)e.scrollIntoView(true);else e.offsetTop+e.offsetHeight>this.contentAssistPanel.scrollTop+this.contentAssistPanel.clientHeight&&
e.scrollIntoView(false)}}},getSelectedNode:function(){var b=this.getSelectedIndex();return b===-1?null:this.contentAssistPanel.childNodes[b]},getSelectedIndex:function(){for(var b=this.contentAssistPanel.childNodes,a=0;a<b.length;a++)if(b[a].className==="selected")return a;return-1},getSelectedProposal:function(){var b=this.getSelectedIndex();return b===-1?null:this.proposals[b]},click:function(b){this.setSelected(b.target);this.accept();this.editor.getTextView().focus()},showContentAssist:function(b,
a){if(this.contentAssistPanel){this.dispatchEvent(b?"show":"hide",null);this.filterProviders(this.editor.getTitle());if(b){var c=a?a.start+a.addedCharCount:this.textView.getCaretOffset();b=c;for(var e;b>0&&(97<=(e=this.textView.getText(b-1,b).charCodeAt(0))&&e<=122||65<=e&&e<=90||e===95||48<=e&&e<=57);)b--;this.prefix=this.textView.getText(b,c);e=this.textView.getText();b=this.textView.getSelection();b.offset=c;this.getKeywords(this.prefix,e,b).then(function(f){this.proposals=[];for(var g=0;g<f.length;g++){var i=
f[g];if(!(i===null||i===undefined))if(this.matchesPrefix(i)||this.matchesPrefix(i.proposal))this.proposals.push(i)}if(this.proposals.length===0)this.cancel();else{f=this.textView.getLocationAtOffset(c);f.y+=this.textView.getLineHeight();this.contentAssistPanel.innerHTML="";for(g=0;g<this.proposals.length;g++)this.createDiv(this.getDisplayString(this.proposals[g]),g===0,this.contentAssistPanel);this.textView.convert(f,"document","page");this.contentAssistPanel.style.position="absolute";this.contentAssistPanel.style.left=
f.x+"px";this.contentAssistPanel.style.top=f.y+"px";this.contentAssistPanel.style.display="block";this.contentAssistPanel.scrollTop=0;g=document.documentElement.clientWidth;if(f.y+this.contentAssistPanel.offsetHeight>document.documentElement.clientHeight)this.contentAssistPanel.style.top=f.y-this.contentAssistPanel.offsetHeight-this.textView.getLineHeight()+"px";if(f.x+this.contentAssistPanel.offsetWidth>g)this.contentAssistPanel.style.left=g-this.contentAssistPanel.offsetWidth+"px";if(!this.listenerAdded){this.textView.addEventListener("ModelChanging",
this,this.contentAssistListener.onModelChanging);this.textView.addEventListener("ModelChanged",this,this.contentAssistListener.onModelChanged);this.textView.addEventListener("Scroll",this,this.contentAssistListener.onScroll)}this.listenerAdded=true;this.contentAssistPanel.onclick=this.click.bind(this);this.active=true}}.bind(this))}else{if(this.listenerAdded){this.textView.removeEventListener("ModelChanging",this,this.contentAssistListener.onModelChanging);this.textView.removeEventListener("ModelChanged",
this,this.contentAssistListener.onModelChanged);this.textView.removeEventListener("Scroll",this,this.contentAssistListener.onScroll);this.listenerAdded=false}this.active=false;this.contentAssistPanel.style.display="none";this.contentAssistPanel.onclick=null}}},createDiv:function(b,a,c){var e=document.createElement("div");if(a)e.className="selected";e.innerHTML=b;c.appendChild(e)},getDisplayString:function(b){return typeof b==="string"?b:b.proposal},matchesPrefix:function(b){return typeof b==="string"&&
b.substr(0,this.prefix.length)===this.prefix},getKeywords:function(b,a,c){function e(t){if(t)g=g.concat(t);++i===h.length&&j.done(g)}function f(){++i===h.length&&j.done(g)}for(var g=[],i=0,j=new this.Promise,h=this.filteredProviders,l=0;l<h.length;l++){var p=h[l].provider.getKeywords(b,a,c);p&&p.then?p.then(e,f):e(p)}return j},Promise:function(){function b(){}b.prototype.then=function(a){this.callback=a;if(this.result){var c=this;setTimeout(function(){c.callback(c.result)},0)}};b.prototype.done=function(a){this.result=
a;this.callback&&this.callback(this.result)};return b}(),addProvider:function(b,a,c){if(!this.providers)this.providers=[];this.providers.push({name:a,pattern:c,provider:b})},filterProviders:function(b){this.filteredProviders=[];for(var a=0;a<this.providers.length;a++){var c=this.providers[a];(new RegExp(c.pattern)).test(b)&&this.filteredProviders.push(c)}}};return d}();
typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/editor/contentAssist",["orion/textview/keyBinding"],function(){return orion.editor});orion=orion||{};orion.textview=orion.textview||{};
orion.textview.UndoStack=function(){function d(c,e){this.view=c;this.size=e!==undefined?e:100;this.reset();e=c.getModel();if(e.getBaseModel)e=e.getBaseModel();this.model=e;var f=this;this._modelListener={onChanging:function(g){f._onModelChanging(g)}};e.addListener(this._modelListener);c.addEventListener("Destroy",this,this._onDestroy)}var b=function(){function c(e,f,g){this.offset=e;this.text=f;this.previousText=g}c.prototype={undo:function(e,f){this._doUndoRedo(this.offset,this.previousText,this.text,
e,f)},redo:function(e,f){this._doUndoRedo(this.offset,this.text,this.previousText,e,f)},_doUndoRedo:function(e,f,g,i,j){var h=i.getModel();if(h.mapOffset&&i.annotationModel){var l=h.mapOffset(e,true);if(l<0)for(var p=i.annotationModel.getAnnotations(e,e+1);p.hasNext();){var t=p.next();if(t.type==="orion.annotation.folding"){t.expand();l=h.mapOffset(e,true);break}}if(l<0)return;e=l}i.setText(f,e,e+g.length);j&&i.setSelection(e,e+f.length)}};return c}(),a=function(){function c(e,f){this.selection=e;
this.caret=f;this.changes=[]}c.prototype={add:function(e){this.changes.push(e)},undo:function(e,f){for(var g=this.changes.length-1;g>=0;g--)this.changes[g].undo(e,false);if(f){f=this.selection.start;g=this.selection.end;e.setSelection(this.caret?f:g,this.caret?g:f)}},redo:function(e,f){for(var g=0;g<this.changes.length;g++)this.changes[g].redo(e,false);if(f){f=this.selection.start;g=this.selection.end;e.setSelection(this.caret?f:g,this.caret?g:f)}}};return c}();d.prototype={add:function(c){if(this.compoundChange)this.compoundChange.add(c);
else{this.stack.splice(this.index,this.stack.length-this.index,c);this.index++;if(this.stack.length>this.size){this.stack.shift();this.index--;this.cleanIndex--}}},markClean:function(){this.endCompoundChange();this._commitUndo();this.cleanIndex=this.index},isClean:function(){return this.cleanIndex===this.getSize().undo},canUndo:function(){return this.getSize().undo>0},canRedo:function(){return this.getSize().redo>0},endCompoundChange:function(){this.compoundChange=undefined},getSize:function(){var c=
this.index,e=this.stack.length;this._undoStart!==undefined&&c++;return{undo:c,redo:e-c}},undo:function(){this._commitUndo();if(this.index<=0)return false;var c=this.stack[--this.index];this._ignoreUndo=true;c.undo(this.view,true);this._ignoreUndo=false;return true},redo:function(){this._commitUndo();if(this.index>=this.stack.length)return false;var c=this.stack[this.index++];this._ignoreUndo=true;c.redo(this.view,true);this._ignoreUndo=false;return true},reset:function(){this.index=this.cleanIndex=
0;this.stack=[];this._undoStart=undefined;this._undoText="";this._ignoreUndo=false;this._compoundChange=undefined},startCompoundChange:function(){this._commitUndo();var c=new a(this.view.getSelection(),this.view.getCaretOffset());this.add(c);this.compoundChange=c},_commitUndo:function(){if(this._undoStart!==undefined){this._undoStart<0?this.add(new b(-this._undoStart,"",this._undoText,"")):this.add(new b(this._undoStart,this._undoText,""));this._undoStart=undefined;this._undoText=""}},_onDestroy:function(){this.model.removeListener(this._modelListener);
this.view.removeEventListener("Destroy",this,this._onDestroy)},_onModelChanging:function(c){var e=c.text,f=c.start,g=c.removedCharCount;c=c.addedCharCount;if(!this._ignoreUndo){if(this._undoStart!==undefined&&!(c===1&&g===0&&f===this._undoStart+this._undoText.length||c===0&&g===1&&(f+1===-this._undoStart||f===-this._undoStart)))this._commitUndo();if(!this.compoundChange)if(c===1&&g===0){if(this._undoStart===undefined)this._undoStart=f;this._undoText+=e;return}else if(c===0&&g===1){e=this._undoText.length>
0&&-this._undoStart===f;this._undoStart=-f;if(e)this._undoText+=this.model.getText(f,f+g);else this._undoText=this.model.getText(f,f+g)+this._undoText;return}this.add(new b(f,e,this.model.getText(f,f+g)))}}};return d}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/textview/undoStack",[],function(){return orion.textview});
define("orion/editorCommands",["dojo","orion/commands","orion/globalCommands","orion/textview/keyBinding","orion/textview/undoStack"],function(d,b,a,c,e){var f={};f.EditorCommandFactory=function(){function g(i,j,h,l,p,t){this.serviceRegistry=i;this.commandService=j;this.fileClient=h;this.inputManager=l;this.toolbarId=p;this.isReadOnly=t}g.prototype={generateEditorCommands:function(i){function j(p){var t=new c.KeyBinding;c.KeyBinding.apply(t,p);return t}if(!this.isReadOnly){i.getTextView().setKeyBinding(new c.KeyBinding("s",
true),"Save");i.getTextView().setAction("Save",d.hitch(this,function(){var p=i.getText(),t={ETag:this.inputManager.getFileMetadata().ETag};this.fileClient.write(this.inputManager.getInput(),p,t).then(d.hitch(this,function(r){this.inputManager.getFileMetadata().ETag=r.ETag;i.onInputChange(this.inputManager.getInput(),null,p,true);this.inputManager.afterSave&&this.inputManager.afterSave()}),d.hitch(this,function(r){if(r.status===412)confirm("Resource is out of sync with the server. Do you want to save it anyway?")&&
this.fileClient.write(this.inputManager.getInput(),p).then(d.hitch(this,function(s){this.inputManager.getFileMetadata().ETag=s.ETag;i.onInputChange(this.inputManager.getInput(),null,p,true);this.inputManager.afterSave&&this.inputManager.afterSave()}));else r.log=true}));return true}));this.commandService.addCommand(new b.Command({name:"Save",tooltip:"Save this file",id:"orion.save",callback:function(p){p.getTextView().invokeAction("Save")}}),"dom");this.commandService.addCommandGroup("orion.editorActions.unlabeled",
200,null,null,this.toolbarId);this.commandService.registerCommandContribution("orion.save",1,this.toolbarId,"orion.editorActions.unlabeled",new b.CommandKeyBinding("s",true));this.commandService.addCommandGroup("orion.editorActions.contributed.noImages",100,"More",null,this.toolbarId);this.commandService.addCommandGroup("orion.editorActions.contributed.images",101,null,null,this.toolbarId);for(var h=this.serviceRegistry.getServiceReferences("orion.edit.command"),l=0;l<h.length;l++)this.serviceRegistry.getService(h[l]).then(d.hitch(this,
function(p){for(var t={},r=h[l].getPropertyNames(),s=0;s<r.length;s++)t[r[s]]=h[l].getProperty(r[s]);r=new b.Command({name:t.name,image:t.img,id:t.name,callback:d.hitch(i,function(v){v=v||this;var z=v.getSelection(),y=v.getModel(),k=y.getText();p.run(y.getText(z.start,z.end),k,z).then(function(n){if(n.text){v.setText(n.text);if(n.selection){v.setSelection(n.selection.start,n.selection.end);v.getTextView().focus()}}else if(typeof n==="string"){v.setText(n,z.start,z.end);v.setSelection(z.start,z.end);
v.getTextView().focus()}});return true})});this.commandService.addCommand(r,"dom");t.img?this.commandService.registerCommandContribution(r.id,l,this.toolbarId,"orion.editorActions.contributed.images"):this.commandService.registerCommandContribution(r.id,l,this.toolbarId,"orion.editorActions.contributed.noImages");a.generateDomCommandsInBanner(this.commandService,i);if(t.key){s=i.getTextView();s.setKeyBinding(j(t.key),r.id);s.setAction(r.id,r.callback)}}))}}};return g}();f.UndoCommandFactory=function(){function g(i,
j,h){this.serviceRegistry=i;this.commandService=j;this.toolbarId=h}g.prototype={createUndoStack:function(i){var j=new e.UndoStack(i.getTextView(),200);i.getTextView().setKeyBinding(new c.KeyBinding("z",true),"Undo");i.getTextView().setAction("Undo",function(){j.undo();return true});this.commandService.addCommand(new b.Command({name:"Undo",id:"orion.undo",callback:function(l){l.getTextView().invokeAction("Undo")}}),"dom");var h=navigator.platform.indexOf("Mac")!==-1?new c.KeyBinding("z",true,true):
new c.KeyBinding("y",true);i.getTextView().setKeyBinding(h,"Redo");i.getTextView().setAction("Redo",function(){j.redo();return true});this.commandService.addCommand(new b.Command({name:"Redo",id:"orion.redo",callback:function(l){l.getTextView().invokeAction("Redo")}}),"dom");this.commandService.registerCommandContribution("orion.undo",400,this.toolbarId,"orion.editorActions.unlabeled",new b.CommandKeyBinding("z",true),true);this.commandService.registerCommandContribution("orion.redo",401,this.toolbarId,
"orion.editorActions.unlabeled",h,true);return j}};return g}();return f});orion=orion||{};orion.textview=orion.textview||{};
orion.textview.Tooltip=function(){function d(b){this._view=b;this._create(b._parent.ownerDocument);b.addEventListener("Destroy",this,this.destroy)}d.getTooltip=function(b){if(!b._tooltip)b._tooltip=new d(b);return b._tooltip};d.prototype={_create:function(b){if(!this._domNode){this._document=b;var a=this._domNode=b.createElement("DIV");a.className="viewTooltip";var c=this._viewParent=b.createElement("DIV");a.appendChild(c);c=this._htmlParent=b.createElement("DIV");a.appendChild(c);b.body.appendChild(a);
this.hide()}},destroy:function(){if(this._domNode){if(this._contentsView){this._contentsView.destroy();this._emptyModel=this._contentsView=null}var b=this._domNode.parentNode;b&&b.removeChild(this._domNode);this._domNode=null}},hide:function(){this._contentsView&&this._contentsView.setModel(this._emptyModel);if(this._viewParent){this._viewParent.style.left="-10000px";this._viewParent.style.position="fixed";this._viewParent.style.visibility="hidden"}if(this._htmlParent){this._htmlParent.style.left=
"-10000px";this._htmlParent.style.position="fixed";this._htmlParent.style.visibility="hidden";this._htmlParent.innerHTML=""}if(this._domNode)this._domNode.style.visibility="hidden";if(this._showTimeout){clearTimeout(this._showTimeout);this._showTimeout=null}if(this._hideTimeout){clearTimeout(this._hideTimeout);this._hideTimeout=null}if(this._fadeTimeout){clearInterval(this._fadeTimeout);this._fadeTimeout=null}},isVisible:function(){return this._domNode&&this._domNode.style.visibility==="visible"},
setTarget:function(b){if(this.target!==b){this._target=b;this.hide();if(b){var a=this;a._showTimeout=setTimeout(function(){a.show(true)},1E3)}}},show:function(b){if(this._target){var a=this._target.getTooltipInfo();if(a){var c=this._domNode;c.style.left=c.style.right=c.style.width=c.style.height="auto";var e=a.contents,f;if(e instanceof Array)e=this._getAnnotationContents(e);if(typeof e==="string")(f=this._htmlParent).innerHTML=e;else if(e instanceof Node)(f=this._htmlParent).appendChild(e);else if(e instanceof
orion.textview.ProjectionTextModel){if(!this._contentsView){this._emptyModel=new orion.textview.TextModel("");f=this._contentsView=new orion.textview.TextView({model:this._emptyModel,parent:this._viewParent,tabSize:4,stylesheet:["/orion/textview/tooltip.css","/orion/textview/rulers.css","/examples/textview/textstyler.css","/css/default-theme.css"]});f._clientDiv.contentEditable=false;var g=this._view;f.addEventListener("LineStyle",g,g.onLineStyle)}f=this._contentsView;f.setModel(e);e=f.computeSize();
f=this._viewParent;f.style.width=e.width+20+"px";f.style.height=e.height+"px"}else return;f.style.left="auto";f.style.position="static";f.style.visibility="visible";e=parseInt(this._getNodeStyle(c,"padding-left","0"),10);e+=parseInt(this._getNodeStyle(c,"border-left-width","0"),10);if(a.anchor==="right"){f=parseInt(this._getNodeStyle(c,"padding-right","0"),10);f+=parseInt(this._getNodeStyle(c,"border-right-width","0"),10);c.style.right=c.ownerDocument.body.getBoundingClientRect().right-a.x+e+f+"px"}else c.style.left=
a.x-e+"px";e=parseInt(this._getNodeStyle(c,"padding-top","0"),10);e+=parseInt(this._getNodeStyle(c,"border-top-width","0"),10);c.style.top=a.y-e+"px";c.style.maxWidth=a.maxWidth+"px";c.style.maxHeight=a.maxHeight+"px";c.style.opacity="1";c.style.visibility="visible";if(b){var i=this;i._hideTimeout=setTimeout(function(){var j=parseFloat(i._getNodeStyle(c,"opacity","1"));i._fadeTimeout=setInterval(function(){if(c.style.visibility==="visible"&&j>0){j-=0.1;c.style.opacity=j}else i.hide()},50)},5E3)}}}},
_getAnnotationContents:function(b){function a(j,h){j=e.getLineStart(e.getLineAtOffset(j));h=e.getLineEnd(e.getLineAtOffset(h),true);return e.getText(j,h)}if(b.length===0)return null;var c=this._view.getModel(),e=c.getBaseModel?c.getBaseModel():c,f;if(b.length===1){c=b[0];if(c.title){f=c.title.replace(/</g,"&lt;").replace(/>/g,"&gt;");return c.html+"&nbsp;"+f}else{b=new orion.textview.ProjectionTextModel(e);f=e.getLineStart(e.getLineAtOffset(c.start));b.addProjection({start:c.end,end:b.getCharCount()});
b.addProjection({start:0,end:f});return b}}else{for(var g="<em>Multiple annotations:</em><br>",i=0;i<b.length;i++){c=b[i];(f=c.title)||(f=a(c.start,c.end));f=f.replace(/</g,"&lt;").replace(/>/g,"&gt;");g+=c.html+"&nbsp;"+f+"<br>"}return g}},_getNodeStyle:function(b,a,c){var e;if(b){e=b.style[a];if(!e)if(b.currentStyle){e=0;for(a=a;(e=a.indexOf("-",e))!==-1;)a=a.substring(0,e)+a.substring(e+1,e+2).toUpperCase()+a.substring(e+2);e=b.currentStyle[a]}else e=(b=b.ownerDocument.defaultView.getComputedStyle(b,
null))?b.getPropertyValue(a):null}return e||c}};return d}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/textview/tooltip",[],function(){return orion.textview});orion=orion||{};orion.textview=orion.textview||{};
orion.textview.Ruler=function(){function d(b,a,c,e){this._location=a||"left";this._overview=c||"page";this._rulerStyle=e;this._types=[];this._view=null;var f=this;this._annotationModelListener={onChanged:function(g){f._onAnnotationModelChanged(g)}};this.setAnnotationModel(b)}d.prototype={addAnnotationType:function(b){this._types.push(b)},getAnnotations:function(b,a){var c=this._annotationModel;if(!c)return[];var e=this._view.getModel(),f=e.getLineStart(b),g=e.getLineEnd(a-1),i=e;if(e.getBaseModel){i=
e.getBaseModel();f=e.mapOffset(f);g=e.mapOffset(g)}c=c.getAnnotations(f,g);for(f=[];c.hasNext();){g=c.next();if(this.isAnnotationTypeVisible(g.type))for(var j=i.getLineAtOffset(g.start),h=i.getLineAtOffset(g.end-1),l=j;l<=h;l++){var p=l;if(e!==i){p=i.getLineStart(l);p=e.mapOffset(p,true);if(p===-1)continue;p=e.getLineAtOffset(p)}if(b<=p&&p<a){var t=this._mergeAnnotation(f[p],g,l-j,h-j+1);if(t)f[p]=t}}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var r in f)if(f[r]._multiple)f[r].html+=
this._multiAnnotationOverlay.html;return f},getAnnotationModel:function(){return this._annotationModel},getLocation:function(){return this._location},getOverview:function(){return this._overview},getRulerStyle:function(){return this._rulerStyle},getWidestAnnotation:function(){return null},isAnnotationTypeVisible:function(b){for(var a=0;a<this._types.length;a++)if(this._types[a]===b)return true;return false},removeAnnotationType:function(b){for(var a=0;a<this._types.length;a++)if(this._types[a]===
b){this._types.splice(a,1);break}},setAnnotationModel:function(b){this._annotationModel&&this._annotationModel.removeListener(this._annotationModelListener);(this._annotationModel=b)&&this._annotationModel.addListener(this._annotationModelListener)},setMultiAnnotation:function(b){this._multiAnnotation=b},setMultiAnnotationOverlay:function(b){this._multiAnnotationOverlay=b},setView:function(b){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this,this._onTextModelChanged);
this._view=b;this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this,this._onTextModelChanged)},onClick:function(){},onDblClick:function(){},onMouseMove:function(b,a){var c=orion.textview.Tooltip.getTooltip(this._view);if(c)if(!(c.isVisible()&&this._tooltipLineIndex===b)){this._tooltipLineIndex=b;var e=this;c.setTarget({y:a.clientY,getTooltipInfo:function(){return e._getTooltipInfo(e._tooltipLineIndex,this.y)}})}},onMouseOver:this._onMouseMove,onMouseOut:function(){var b=
orion.textview.Tooltip.getTooltip(this._view);b&&b.setTarget(null)},_getTooltipInfo:function(b,a){if(b!==undefined){var c=this._view,e=c.getModel(),f=this._annotationModel,g=[];if(f){var i=e.getLineStart(b),j=e.getLineEnd(b);if(e.getBaseModel){i=e.mapOffset(i);j=e.mapOffset(j)}for(f=f.getAnnotations(i,j);f.hasNext();){i=f.next();this.isAnnotationTypeVisible(i.type)&&g.push(i)}}g=this._getTooltipContents(b,g);if(!g)return null;g={contents:g,anchor:this.getLocation()};f=c.getClientArea();f.y=this.getOverview()===
"document"?c.convert({y:a},"view","document").y:c.getLocationAtOffset(e.getLineStart(b)).y;c.convert(f,"document","page");g.x=f.x;g.y=f.y;if(g.anchor==="right")g.x+=f.width;g.maxWidth=f.width;g.maxHeight=f.height-(f.y-c._parent.getBoundingClientRect().top);return g}},_getTooltipContents:function(b,a){return a},_onAnnotationModelChanged:function(b){function a(i){for(var j=0;j<i.length;j++)if(f.isAnnotationTypeVisible(i[j].type)){var h=i[j].start,l=i[j].end;if(e.getBaseModel){h=e.mapOffset(h,true);
l=e.mapOffset(l,true)}h!==-1&&l!==-1&&c.redrawLines(e.getLineAtOffset(h),e.getLineAtOffset(Math.max(h,l-1))+1,f)}}var c=this._view;if(c){var e=c.getModel(),f=this,g=e.getLineCount();if(b.textModelChangedEvent){b=b.textModelChangedEvent.start;if(e.getBaseModel)b=e.mapOffset(b,true);b=e.getLineAtOffset(b);c.redrawLines(b,g,f)}else{a(b.added);a(b.removed);a(b.changed)}}},_mergeAnnotation:function(b,a,c){b||(b={});if(c===0)if(b.html&&a.html){if(a.html!==b.html)if(!b._multiple&&this._multiAnnotation)b.html=
this._multiAnnotation.html;b._multiple=true}else b.html=a.html;b.style=this._mergeStyle(b.style,a.style);return b},_mergeStyle:function(b,a){if(a){b||(b={});if(b.styleClass&&a.styleClass&&b.styleClass!==a.styleClass)b.styleClass+=" "+a.styleClass;else b.styleClass=a.styleClass;var c;if(a.style){if(!b.style)b.style={};for(c in a.style)b.style[c]||(b.style[c]=a.style[c])}if(a.attributes){if(!b.attributes)b.attributes={};for(c in a.attributes)b.attributes[c]||(b.attributes[c]=a.attributes[c])}}return b}};
return d}();
orion.textview.LineNumberRuler=function(){function d(b,a,c,e,f){orion.textview.Ruler.call(this,b,a,"page",c);this._oddStyle=e||{style:{backgroundColor:"white"}};this._evenStyle=f||{style:{backgroundColor:"white"}};this._numOfDigits=0}d.prototype=new orion.textview.Ruler;d.prototype.getAnnotations=function(b,a){var c=orion.textview.Ruler.prototype.getAnnotations.call(this,b,a),e=this._view.getModel();for(b=b;b<a;b++){var f=b&1?this._oddStyle:this._evenStyle,g=b;if(e.getBaseModel){g=e.getLineStart(g);g=
e.getBaseModel().getLineAtOffset(e.mapOffset(g))}c[b]||(c[b]={});c[b].html=g+1+"";if(!c[b].style)c[b].style=f}return c};d.prototype.getWidestAnnotation=function(){var b=this._view.getModel().getLineCount();return this.getAnnotations(b-1,b)[b-1]};d.prototype._onTextModelChanged=function(b){b=b.start;var a=this._view.getModel(),c=((a.getBaseModel?a.getBaseModel().getLineCount():a.getLineCount())+"").length;if(this._numOfDigits!==c){this._numOfDigits=c;this._view.redrawLines(a.getLineAtOffset(b),a.getLineCount(),
this)}};return d}();orion.textview.AnnotationRuler=function(){function d(b,a,c){orion.textview.Ruler.call(this,b,a,"page",c)}d.prototype=new orion.textview.Ruler;return d}();
orion.textview.OverviewRuler=function(){function d(b,a,c){orion.textview.Ruler.call(this,b,a,"document",c)}d.prototype=new orion.textview.Ruler;d.prototype.getRulerStyle=function(){var b={style:{lineHeight:"1px",fontSize:"1px"}};return b=this._mergeStyle(b,this._rulerStyle)};d.prototype.onClick=function(b){b!==undefined&&this._view.setTopIndex(b)};d.prototype._getTooltipContents=function(b,a){if(a.length===0){a=this._view.getModel();b=b;if(a.getBaseModel){b=a.getLineStart(b);b=a.getBaseModel().getLineAtOffset(a.mapOffset(b))}return"Line: "+
(b+1)}return orion.textview.Ruler.prototype._getTooltipContents.call(this,b,a)};d.prototype._mergeAnnotation=function(b,a,c,e){if(c===0){b=b;if(!b){b={html:"&nbsp;",style:{style:{height:3*e+"px"}}};b.style=this._mergeStyle(b.style,a.overviewStyle)}return b}};return d}();
orion.textview.FoldingRuler=function(){function d(b,a,c){orion.textview.AnnotationRuler.call(this,b,a,c)}d.prototype=new orion.textview.AnnotationRuler;d.prototype.onClick=function(b){if(b!==undefined){var a=this._annotationModel;if(a){var c=this._view.getModel(),e=c.getLineStart(b);b=c.getLineEnd(b,true);if(c.getBaseModel){e=c.mapOffset(e);b=c.mapOffset(b)}var f;for(a=a.getAnnotations(e,b);!f&&a.hasNext();){c=a.next();if(this.isAnnotationTypeVisible(c.type))f=c}if(f){(a=orion.textview.Tooltip.getTooltip(this._view))&&
a.setTarget(null);f.expanded?f.collapse():f.expand();this._annotationModel.modifyAnnotation(f)}}}};d.prototype._getTooltipContents=function(b,a){if(a.length===1)if(a[0].expanded)return null;return orion.textview.AnnotationRuler.prototype._getTooltipContents.call(this,b,a)};d.prototype._onAnnotationModelChanged=function(b){function a(h){for(g=0;g<h.length;g++)if(f.isAnnotationTypeVisible(h[g].type)){var l=h[g].start;if(e.getBaseModel)l=e.mapOffset(l,true);if(l!==-1)j=Math.min(j,e.getLineAtOffset(l))}}
if(b.textModelChangedEvent)orion.textview.AnnotationRuler.prototype._onAnnotationModelChanged.call(this,b);else{var c=this._view;if(c){var e=c.getModel(),f=this,g,i=e.getLineCount(),j=i;a(b.added);a(b.removed);a(b.changed);b=c.getRulers();for(g=0;g<b.length;g++)c.redrawLines(j,i,b[g])}}};return d}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/textview/rulers",["orion/textview/tooltip"],function(){return orion.textview});orion=orion||{};
orion.textview=orion.textview||{};
orion.textview.FoldingAnnotation=function(){function d(b,a,c,e,f,g,i,j){this.type=a;this.start=c;this.end=e;this._projectionModel=b;this._expandedHTML=this.html=f;this._expandedStyle=this.style=g;this._collapsedHTML=i;this._collapsedStyle=j;this.expanded=true}d.prototype={collapse:function(){if(this.expanded){this.expanded=false;this.html=this._collapsedHTML;this.style=this._collapsedStyle;var b=this._projectionModel,a=b.getBaseModel();this._projection={start:a.getLineStart(a.getLineAtOffset(this.start)+1),
end:a.getLineEnd(a.getLineAtOffset(this.end),true)};b.addProjection(this._projection)}},expand:function(){if(!this.expanded){this.expanded=true;this.html=this._expandedHTML;this.style=this._expandedStyle;this._projectionModel.removeProjection(this._projection)}}};return d}();
orion.textview.AnnotationModel=function(){function d(b){this._annotations=[];this._listeners=[];var a=this;this._modelListener={onChanged:function(c){a._onChanged(c)}};this.setTextModel(b)}d.prototype={addListener:function(b){this._listeners.push(b)},removeListener:function(b){for(var a=0;a<this._listeners.length;a++)if(this._listeners[a]===b){this._listeners.splice(a,1);return}},addAnnotation:function(b){if(b){var a=this._annotations,c=this._binarySearch(a,b.start);a.splice(c,0,b);this.onChanged({added:[b],
removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(b,a){var c=this._annotations,e=this._binarySearch(c,b,true);return{next:function(){if(e<c.length){var f=c[e++];if(f.start<a)return f}return null},hasNext:function(){return e<c.length&&c[e].start<a}}},modifyAnnotation:function(b){if(b){for(var a=this._annotations,c=this._binarySearch(a,b.start),e={added:[],removed:[],changed:[]};c<a.length&&a[c].start===b.start;){if(a[c]===b){e.changed.push(b);break}c++}e.changed.length>
0&&this.onChanged(e)}},onChanged:function(b){for(var a=0;a<this._listeners.length;a++){var c=this._listeners[a];c&&c.onChanged&&c.onChanged(b)}},removeAnnotations:function(b){var a=this._annotations,c,e;if(b){c=[];for(e=a.length-1;e>=0;e--){var f=a[e];f.type===b&&a.splice(e,1);c.splice(0,0,f)}}else c=a;this.onChanged({removed:c,added:[],changed:[]})},removeAnnotation:function(b){var a=this._annotations,c=this._binarySearch(a,b.start);if(0<=c&&c<a.length)if(a[c]===b){a.splice(c,1);this.onChanged({removed:[b],
added:[],changed:[]})}},replaceAnnotations:function(b,a){var c=this._annotations,e,f,g;a||(a=[]);b||(b=[]);for(e=0;e<b.length;e++){g=b[e];f=this._binarySearch(c,g.start);0<=f&&f<c.length&&c[f]===g&&c.splice(f,1)}for(e=0;e<a.length;e++){g=a[e];f=this._binarySearch(c,g.start);c.splice(f,0,g)}this.onChanged({removed:b,added:a,changed:[]})},setTextModel:function(b){this._model&&this._model.removeListener(this._modelListener);(this._model=b)&&this._model.addListener(this._modelListener)},_binarySearch:function(b,
a,c){for(var e=b.length,f=-1,g;e-f>1;){g=Math.floor((e+f)/2);if(a<=b[g].start)e=g;else if(c&&a<b[g].end){e=g;break}else f=g}return e},_onChanged:function(b){var a=b.start,c=b.addedCharCount,e=b.removedCharCount,f=this._annotations,g=a+e,i=this._binarySearch(f,a,true);if(0<=i&&i<f.length){b={added:[],changed:[],textModelChangedEvent:b};c=c-e;for(g=e=this._binarySearch(f,g,true);g<f.length;g++){var j=f[g];if(j.start>a)j.start+=c;if(j.end>a)j.end+=c;b.changed.push(j)}b.removed=f.splice(i,e-i);this.onChanged(b)}}};
return d}();
orion.textview.AnnotationStyler=function(){function d(b,a){this._view=b;this._annotationModel=a;b.addEventListener("LineStyle",this,this._onLineStyle);var c=this;this._annotationModelListener={onChanged:function(e){c._onAnnotationModelChanged(e)}};a.addListener(this._annotationModelListener)}d.prototype={destroy:function(){var b=this._view;if(b){b.removeEventListener("Destroy",this,this._onDestroy);b.removeEventListener("LineStyle",this,this._onLineStyle);this.view=null}(b=this._annotationModel)&&b.removeListener(this._annotationModelListener)},
_mergeStyle:function(b,a){if(a){b||(b={});if(b.styleClass&&a.styleClass&&b.styleClass!==a.styleClass)b.styleClass+=" "+a.styleClass;else b.styleClass=a.styleClass;var c;if(a.style){if(!b.style)b.style={};for(c in a.style)b.style[c]||(b.style[c]=a.style[c])}if(a.attributes){if(!b.attributes)b.attributes={};for(c in a.attributes)b.attributes[c]||(b.attributes[c]=a.attributes[c])}}return b},_mergeStyleRanges:function(b,a){for(var c=0;c<b.length;c++){var e=b[c];if(a.end<=e.start)break;if(!(a.start>=e.end)){var f=
this._mergeStyle({},e.style);f=this._mergeStyle(f,a.style);if(a.start<=e.start&&a.end>=e.end)b[c]={start:e.start,end:e.end,style:f};else if(a.start>e.start&&a.end<e.end){b.splice(c,1,{start:e.start,end:a.start,style:e.style},{start:a.start,end:a.end,style:f},{start:a.end,end:e.end,style:e.style});c+=2}else if(a.start>e.start){b.splice(c,1,{start:e.start,end:a.start,style:e.style},{start:a.start,end:e.end,style:f});c+=1}else if(a.end<e.end){b.splice(c,1,{start:e.start,end:a.end,style:f},{start:a.end,
end:e.end,style:e.style});c+=1}}}},_onAnnotationModelChanged:function(b){function a(f){for(var g=0;g<f.length;g++)if(f[g].rangeStyle){var i=f[g].start,j=f[g].end;if(e.getBaseModel){i=e.mapOffset(i,true);j=e.mapOffset(j,true)}i!==-1&&j!==-1&&c.redrawRange(i,j)}}if(!b.textModelChangedEvent){var c=this._view;if(c){var e=c.getModel();a(b.added);a(b.removed);a(b.changed)}}},_onDestroy:function(){this.destroy()},_onLineStyle:function(b){var a=this._annotationModel,c=this._view.getModel(),e=a.getTextModel(),
f=b.lineStart,g=b.lineStart+b.lineText.length;if(e!==c){f=c.mapOffset(f);g=c.mapOffset(g)}for(a=a.getAnnotations(f,g);a.hasNext();){f=a.next();if(f.rangeStyle){g=f.start;var i=f.end;if(e!==c){g=c.mapOffset(g,true);i=c.mapOffset(i,true)}this._mergeStyleRanges(b.ranges,{start:g,end:i,style:f.rangeStyle})}if(f.lineStyle){b.style=this._mergeStyle({},b.style);b.style=this._mergeStyle(b.style,f.lineStyle)}}}};return d}();
typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/textview/annotations",[],function(){return orion.textview});orion=orion||{};orion.editor=orion.editor||{};
orion.editor.UndoFactory=function(){function d(){}d.prototype={createUndoStack:function(b){b=b.getTextView();var a=new orion.textview.UndoStack(b,200);b.setKeyBinding(new orion.textview.KeyBinding("z",true),"Undo");b.setAction("Undo",function(){a.undo();return true});var c=navigator.platform.indexOf("Mac")!==-1;b.setKeyBinding(c?new orion.textview.KeyBinding("z",true,true):new orion.textview.KeyBinding("y",true),"Redo");b.setAction("Redo",function(){a.redo();return true});return a}};return d}();
orion.editor.LineNumberRulerFactory=function(){function d(){}d.prototype={createLineNumberRuler:function(b){return new orion.textview.LineNumberRuler(b,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};return d}();orion.editor.FoldingRulerFactory=function(){function d(){}d.prototype={createFoldingRuler:function(b){return new orion.textview.FoldingRuler(b,"left",{styleClass:"ruler folding"})}};return d}();
orion.editor.AnnotationFactory=function(){function d(){}d.prototype={createAnnotationModel:function(b){return new orion.textview.AnnotationModel(b)},createAnnotationStyler:function(b,a){return new orion.textview.AnnotationStyler(b,a)},createAnnotationRulers:function(b){var a=new orion.textview.AnnotationRuler(b,"left",{styleClass:"ruler annotations"});b=new orion.textview.OverviewRuler(b,"right",{styleClass:"ruler overview"});return{annotationRuler:a,overviewRuler:b}}};return d}();
orion.editor.TextActions=function(){function d(b,a,c){this.editor=b;this.textView=b.getTextView();this.undoStack=a;this._incrementalFindActive=false;this._incrementalFindSuccess=true;this._incrementalFindIgnoreSelection=false;this._incrementalFindPrefix="";(this._searcher=c)&&this._searcher.getAdaptor().setEditor(this.editor);this.init()}d.prototype={init:function(){this._incrementalFindListener={onVerify:function(b){function a(i){return i.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")}var c=this.editor,
e=c.getModel(),f=c.mapOffset(b.start),g=c.mapOffset(b.end);f=e.getText(f,g);e=this._incrementalFindPrefix;if((e=e.match(new RegExp("^"+a(f),"i")))&&e.length>0){e=this._incrementalFindPrefix+=b.text;this.editor.reportStatus("Incremental find: "+e);f=e.toLowerCase()===e;g=c.getSelection().start;if(f=c.doFind(e,g,f)){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;c.moveSelection(f.index,f.index+f.length);this._incrementalFindIgnoreSelection=false}else{c.reportStatus("Incremental find: "+
e+" (not found)",true);this._incrementalFindSuccess=false}b.text=null}}.bind(this),onSelection:function(){this._incrementalFindIgnoreSelection||this.toggleIncrementalFind()}.bind(this)};this.textView.setKeyBinding(new orion.textview.KeyBinding("f",true),"Find...");this.textView.setAction("Find...",function(){if(this._searcher){var b=this.editor,a=b.getSelection(),c="";if(a.end>a.start)c=b.getModel().getText(a.start,a.end);this._searcher.buildToolBar(c);return true}return false}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding("k",
true),"Find Next Occurrence");this.textView.setAction("Find Next Occurrence",function(){if(this._searcher){this._searcher.findNext(true);return true}return false}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding("k",true,true),"Find Previous Occurrence");this.textView.setAction("Find Previous Occurrence",function(){if(this._searcher){this._searcher.findNext(false);return true}return false}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding("j",true),"Incremental Find");
this.textView.setAction("Incremental Find",function(){if(this._searcher&&this._searcher.visible())return true;var b=this.editor;if(this._incrementalFindActive){var a=this._incrementalFindPrefix;if(a.length!==0){var c;if(this._searcher)c=this._searcher.findNext(true,a);else{c=0;if(this._incrementalFindSuccess)c=b.getSelection().start+1;var e=a.toLowerCase()===a;c=b.doFind(a,c,e)}if(c){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;b.moveSelection(c.index,c.index+c.length);this._incrementalFindIgnoreSelection=
false;b.reportStatus("Incremental find: "+a)}else{b.reportStatus("Incremental find: "+a+" (not found)",true);this._incrementalFindSuccess=false}}}else{b.setCaretOffset(b.getCaretOffset());this.toggleIncrementalFind()}return true}.bind(this));this.textView.setAction("deletePrevious",function(){if(this._incrementalFindActive){var b=this.editor,a=this._incrementalFindPrefix;a=this._incrementalFindPrefix=a.substring(0,a.length-1);if(a.length===0){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=
true;b.setCaretOffset(b.getSelection().start);this._incrementalFindIgnoreSelection=false;this.toggleIncrementalFind();return true}b.reportStatus("Incremental find: "+a);var c=b.getCaretOffset();c=b.getModel().getText().lastIndexOf(a,c-a.length-1);if(c!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;b.moveSelection(c,c+a.length);this._incrementalFindIgnoreSelection=false}else b.reportStatus("Incremental find: "+a+" (not found)",true);return true}return false}.bind(this));
this.textView.setAction("tab",function(){var b=this.editor,a=b.getModel(),c=b.getSelection(),e=a.getLineAtOffset(c.start),f=a.getLineAtOffset(c.end>c.start?c.end-1:c.end);if(e!==f){var g=[];g.push("");for(var i=e;i<=f;i++)g.push(a.getLine(i,true));i=a.getLineStart(e);a=a.getLineEnd(f,true);b.setText(g.join("\t"),i,a);b.setSelection(i===c.start?c.start:c.start+1,c.end+(f-e+1));return true}return false}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding(9,false,true),"Unindent Lines");
this.textView.setAction("Unindent Lines",function(){for(var b=this.editor,a=b.getModel(),c=b.getSelection(),e=a.getLineAtOffset(c.start),f=a.getLineAtOffset(c.end>c.start?c.end-1:c.end),g=[],i=0,j=e;j<=f;j++){var h=a.getLine(j,true);if(a.getLineStart(j)!==a.getLineEnd(j)){if(h.indexOf("\t")!==0)return false;h=h.substring(1);i++}g.push(h)}e=a.getLineStart(e);j=a.getLineEnd(f,true);a=a.getLineStart(f);b.setText(g.join(""),e,j);b.setSelection(e===c.start?c.start:c.start-1,c.end-i+(c.end===a+1?1:0));
return true}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding(38,false,false,true),"Move Lines Up");this.textView.setAction("Move Lines Up",function(){var b=this.editor,a=b.getModel(),c=b.getSelection(),e=a.getLineAtOffset(c.start);if(e===0)return true;var f=a.getLineAtOffset(c.end>c.start?c.end-1:c.end),g=a.getLineCount();c=a.getLineStart(e-1);var i=a.getLineStart(e),j=a.getLineEnd(f,true),h=a.getText(i,j),l=0;if(f===g-1){f=a.getLineEnd(e-1);e=a.getLineEnd(e-1,true);h+=a.getText(f,
e);i=f;l=e-f}this.startUndo();b.setText("",i,j);b.setText(h,c,c);b.setSelection(c,c+h.length-l);this.endUndo();return true}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding(40,false,false,true),"Move Lines Down");this.textView.setAction("Move Lines Down",function(){var b=this.editor,a=b.getModel(),c=b.getSelection(),e=a.getLineAtOffset(c.start),f=a.getLineAtOffset(c.end>c.start?c.end-1:c.end),g=a.getLineCount();if(f===g-1)return true;e=a.getLineStart(e);c=a.getLineEnd(f,true);
var i=a.getLineEnd(f+1,true)-(c-e),j=0;if(f!==g-2)a=a.getText(e,c);else{f=a.getLineEnd(f);a=a.getText(f,c)+a.getText(e,f);j+=c-f}this.startUndo();b.setText("",e,c);b.setText(a,i,i);b.setSelection(i+j,i+j+a.length);this.endUndo();return true}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding(38,true,false,true),"Copy Lines Up");this.textView.setAction("Copy Lines Up",function(){var b=this.editor,a=b.getModel(),c=b.getSelection(),e=a.getLineAtOffset(c.start);c=a.getLineAtOffset(c.end>
c.start?c.end-1:c.end);e=a.getLineStart(e);var f=a.getLineEnd(c,true),g=a.getLineCount(),i="";f=a.getText(e,f);if(c===g-1)f+=i=a.getLineDelimiter();b.setText(f,e,e);b.setSelection(e,e+f.length-i.length);return true}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding(40,true,false,true),"Copy Lines Down");this.textView.setAction("Copy Lines Down",function(){var b=this.editor,a=b.getModel(),c=b.getSelection(),e=a.getLineAtOffset(c.start);c=a.getLineAtOffset(c.end>c.start?c.end-1:
c.end);var f=a.getLineStart(e);e=a.getLineEnd(c,true);var g=a.getLineCount(),i="";f=a.getText(f,e);if(c===g-1)f=(i=a.getLineDelimiter())+f;b.setText(f,e,e);b.setSelection(e+i.length,e+f.length);return true}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding("d",true,false,false),"Delete Selected Lines");this.textView.setAction("Delete Selected Lines",function(){var b=this.editor,a=b.getSelection(),c=b.getModel(),e=c.getLineAtOffset(a.start);a=c.getLineAtOffset(a.end>a.start?a.end-
1:a.end);e=c.getLineStart(e);c=c.getLineEnd(a,true);b.setText("",e,c);return true}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding("l",true),"Goto Line...");this.textView.setAction("Goto Line...",function(){var b=this.editor,a=b.getModel().getLineAtOffset(b.getCaretOffset());if(a=prompt("Go to line:",a+1)){a=parseInt(a,10);b.onGotoLine(a-1,0)}return true}.bind(this))},toggleIncrementalFind:function(){if(this._incrementalFindActive=!this._incrementalFindActive){this.editor.reportStatus("Incremental find: "+
this._incrementalFindPrefix);this.textView.addEventListener("Verify",this,this._incrementalFindListener.onVerify);this.textView.addEventListener("Selection",this,this._incrementalFindListener.onSelection)}else{this._incrementalFindPrefix="";this.editor.reportStatus("");this.textView.removeEventListener("Verify",this,this._incrementalFindListener.onVerify);this.textView.removeEventListener("Selection",this,this._incrementalFindListener.onSelection);this.textView.setCaretOffset(this.textView.getCaretOffset())}},
startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},cancel:function(){this.toggleIncrementalFind()},isActive:function(){return this._incrementalFindActive},isStatusActive:function(){return this._incrementalFindActive},lineUp:function(){if(this._incrementalFindActive){var b=this._incrementalFindPrefix;if(b.length===0)return false;var a=this.editor,c=a.getModel(),e;e=this._incrementalFindSuccess?a.getCaretOffset()-
b.length-1:c.getCharCount()-1;c=c.getText().lastIndexOf(b,e);if(c!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;a.moveSelection(c,c+b.length);this._incrementalFindIgnoreSelection=false}else{a.reportStatus("Incremental find: "+b+" (not found)",true);this._incrementalFindSuccess=false}return true}return false},lineDown:function(){if(this._incrementalFindActive){var b=this._incrementalFindPrefix;if(b.length===0)return false;var a=this.editor,c=a.getModel(),e=0;if(this._incrementalFindSuccess)e=
a.getSelection().start+1;c=c.getText().indexOf(b,e);if(c!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;a.moveSelection(c,c+b.length);this._incrementalFindIgnoreSelection=false;this.editor.reportStatus("Incremental find: "+b)}else{a.reportStatus("Incremental find: "+b+" (not found)",true);this._incrementalFindSuccess=false}return true}return false},enter:function(){return false}};return d}();
orion.editor.SourceCodeActions=function(){function d(b,a,c,e){this.editor=b;this.textView=b.getTextView();this.undoStack=a;this.contentAssist=c;this.linkedMode=e;this.contentAssist&&this.contentAssist.addEventListener("accept",this.contentAssistProposalAccepted.bind(this));this.init()}d.prototype={startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},init:function(){function b(a,c,e){var f=a.getLineAtOffset(c),
g=a.getLineAtOffset(e),i,j,h,l,p,t;for(i=f;i>=0;i--){j=a.getLine(i);h=i===f?c-a.getLineStart(f):j.length;l=j.lastIndexOf("/*",h);j=j.lastIndexOf("*/",h);if(j>l)break;else if(l!==-1){p=a.getLineStart(i)+l;break}}for(i=g;i<a.getLineCount();i++){j=a.getLine(i);h=i===g?e-a.getLineStart(g):0;l=j.indexOf("/*",h);j=j.indexOf("*/",h);if(l!==-1&&l<j)break;else if(j!==-1){t=a.getLineStart(i)+j;break}}return{commentStart:p,commentEnd:t}}this.textView.setKeyBinding(new orion.textview.KeyBinding(191,true),"Toggle Line Comment");
this.textView.setAction("Toggle Line Comment",function(){for(var a=this.editor,c=a.getModel(),e=a.getSelection(),f=c.getLineAtOffset(e.start),g=c.getLineAtOffset(e.end>e.start?e.end-1:e.end),i=true,j=[],h,l,p=f;p<=g;p++){h=c.getLine(p,true);j.push(h);if(!i||(l=h.indexOf("//"))===-1)i=false;else if(l!==0){var t;for(t=0;t<l;t++){i=h.charCodeAt(t);if(!(i===32||i===9))break}i=t===l}}p=c.getLineStart(f);t=c.getLineEnd(g,true);if(i){for(i=0;i<j.length;i++){h=j[i];l=h.indexOf("//");j[i]=h.substring(0,l)+
h.substring(l+2)}j=j.join("");h=c.getLineStart(g);c=p===e.start?e.start:e.start-2;e=e.end-2*(g-f+1)+(e.end===h+1?2:0)}else{j.splice(0,0,"");j=j.join("//");c=p===e.start?e.start:e.start+2;e=e.end+2*(g-f+1)}a.setText(j,p,t);a.setSelection(c,e);return true}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding(191,true,true),"Add Block Comment");this.textView.setAction("Add Block Comment",function(){var a=this.editor,c=a.getModel(),e=a.getSelection(),f=new RegExp("/\\*|\\*/","g");c.getLineAtOffset(e.start);
c.getLineAtOffset(e.end);var g=b(c,e.start,e.end);if(g.commentStart!==undefined&&g.commentEnd!==undefined)return true;c=c.getText(e.start,e.end);if(c.length===0)return true;g=c.length;c=c.replace(f,"");f=c.length;a.setText("/*"+c+"*/",e.start,e.end);a.setSelection(e.start+2,e.end+2+(f-g));return true}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding(220,true,true),"Remove Block Comment");this.textView.setAction("Remove Block Comment",function(){var a=this.editor,c=a.getModel(),
e=a.getSelection();c.getLineAtOffset(e.start);c.getLineAtOffset(e.end);var f=c.getText(e.start,e.end),g,i,j;for(j=0;j<f.length;j++)if(f.substring(j,j+2)==="/*"){g=e.start+j;break}for(;j<f.length;j++)if(f.substring(j,j+2)==="*/"){i=e.start+j;break}if(g!==undefined&&i!==undefined){a.setText(c.getText(g+2,i),g,i+2);a.setSelection(g,i)}else{f=b(c,e.start,e.end);if(f.commentStart===undefined||f.commentEnd===undefined)return true;c=c.getText(f.commentStart+2,f.commentEnd);a.setText(c,f.commentStart,f.commentEnd+
2);a.setSelection(e.start-2,e.end-2)}return true}.bind(this))},contentAssistProposalAccepted:function(b){var a=b.data.proposal,c;if(typeof a==="string")c=a;else if(typeof a.proposal==="string")c=a.proposal;this.textView.setText(c,b.data.start,b.data.end);if(a.positions&&this.linkedMode){b=[];for(c=0;c<a.positions.length;++c)b[c]={positions:[{offset:a.positions[c].offset,length:a.positions[c].length}]};this.linkedMode.enterLinkedMode({groups:b,escapePosition:a.escapePosition})}return true},cancel:function(){return false},
isActive:function(){return true},isStatusActive:function(){return false},lineUp:function(){return false},lineDown:function(){return false},enter:function(){var b=this.editor,a=b.getSelection();if(a.start===a.end){var c=b.getModel(),e=c.getLineAtOffset(a.start),f=c.getLine(e,true),g=c.getLineStart(e);e=0;g=a.start-g;for(var i;e<g&&((i=f.charCodeAt(e))===32||i===9);)e++;if(e>0){var j=f.substring(0,e);for(e=g;e<f.length&&((i=f.charCodeAt(e++))===32||i===9);)a.end++;b.setText(c.getLineDelimiter()+j,a.start,
a.end);return true}}return false}};return d}();
orion.editor.LinkedMode=function(){function d(b){this.editor=b;this.textView=b.getTextView();this.linkedModeActive=false;this.linkedModePositions=[];this.linkedModeEscapePosition=this.linkedModeCurrentPositionIndex=0;this.linkedModeListener={onVerify:function(a){for(var c=false,e=0,f=0;f<this.linkedModePositions.length;++f){var g=this.linkedModePositions[f];if(c)g.offset+=e;else if(a.start>=g.offset&&a.end<=g.offset+g.length){c=g.length;g.length=a.start-g.offset+a.text.length+(g.offset+g.length-a.end);
e=g.length-c;c=true}}if(c)this.linkedModeEscapePosition+=e;else this.cancel()}.bind(this)}}d.prototype={enterLinkedMode:function(b){if(!this.linkedModeActive){this.linkedModeActive=true;this.linkedModePositions=[];for(var a=0;a<b.groups.length;++a){var c=b.groups[a];this.linkedModePositions[a]={offset:c.positions[0].offset,length:c.positions[0].length}}this.linkedModeEscapePosition=b.escapePosition;this.linkedModeCurrentPositionIndex=0;this.selectTextForLinkedModePosition(this.linkedModePositions[this.linkedModeCurrentPositionIndex]);
this.textView.addEventListener("Verify",this,this.linkedModeListener.onVerify);this.textView.setKeyBinding(new orion.textview.KeyBinding(9),"nextLinkedModePosition");this.textView.setAction("nextLinkedModePosition",function(){this.linkedModeCurrentPositionIndex=++this.linkedModeCurrentPositionIndex%this.linkedModePositions.length;this.selectTextForLinkedModePosition(this.linkedModePositions[this.linkedModeCurrentPositionIndex]);return true}.bind(this));this.textView.setKeyBinding(new orion.textview.KeyBinding(9,
false,true),"previousLinkedModePosition");this.textView.setAction("previousLinkedModePosition",function(){this.linkedModeCurrentPositionIndex=this.linkedModeCurrentPositionIndex>0?this.linkedModeCurrentPositionIndex-1:this.linkedModePositions.length-1;this.selectTextForLinkedModePosition(this.linkedModePositions[this.linkedModeCurrentPositionIndex]);return true}.bind(this));this.editor.reportStatus("Linked Mode entered")}},isActive:function(){return this.linkedModeActive},isStatusActive:function(){return this.linkedModeActive},
enter:function(){this.cancel();return true},cancel:function(){if(this.linkedModeActive){this.linkedModeActive=false;this.textView.removeEventListener("Verify",this,this.linkedModeListener.onVerify);this.textView.setKeyBinding(new orion.textview.KeyBinding(9),"tab");this.textView.setKeyBinding(new orion.textview.KeyBinding(9,false,true),null);this.textView.setCaretOffset(this.linkedModeEscapePosition,false);this.editor.reportStatus("Linked Mode exited")}},selectTextForLinkedModePosition:function(b){this.textView.setSelection(b.offset,
b.offset+b.length)}};return d}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/editor/editorFeatures",["orion/textview/undoStack","orion/textview/keyBinding","orion/textview/rulers","orion/textview/annotations"],function(){return orion.editor});orion=orion||{};orion.editor=orion.editor||{};
orion.editor.Editor=function(){function d(b){this._textViewFactory=b.textViewFactory;this._undoStackFactory=b.undoStackFactory;this._annotationFactory=b.annotationFactory;this._foldingRulerFactory=b.foldingRulerFactory;this._lineNumberRulerFactory=b.lineNumberRulerFactory;this._contentAssistFactory=b.contentAssistFactory;this._keyBindingFactory=b.keyBindingFactory;this._statusReporter=b.statusReporter;this._domNode=b.domNode;this._syntaxHighlightProviders=b.syntaxHighlightProviders;this._foldingRuler=
this._overviewRuler=this._annotationRuler=null;this._dirty=false;this._title=this._contentAssist=null;this._keyModes=[]}d.prototype={errorType:"orion.annotation.error",warningType:"orion.annotation.warning",taskType:"orion.annotation.task",foldingType:"orion.annotation.folding",getTextView:function(){return this._textView},reportStatus:function(b,a,c){this._statusReporter?this._statusReporter(b,a,c):window.alert(a?"ERROR: "+b:b)},getModel:function(){var b=this._textView.getModel();if(b.getBaseModel)b=
b.getBaseModel();return b},mapOffset:function(b,a){var c=this._textView.getModel();if(c.getBaseModel)b=c.mapOffset(b,a);return b},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},getSelection:function(){var b=this._textView,a=b.getSelection();b=b.getModel();if(b.getBaseModel){a.start=b.mapOffset(a.start);a.end=b.mapOffset(a.end)}return a},getText:function(b,a){var c=this._textView.getModel();if(c.getBaseModel)c=c.getBaseModel();return c.getText(b,a)},_expandOffset:function(b){var a=
this._textView.getModel(),c=this._annotationModel;if(c&&a.getBaseModel)for(b=c.getAnnotations(b,b+1);b.hasNext();){a=b.next();if(a.type==="orion.annotation.folding")if(a.expand){a.expand();c.modifyAnnotation(a)}}},setCaretOffset:function(b){var a=this._textView,c=a.getModel();if(c.getBaseModel){this._expandOffset(b);b=c.mapOffset(b,true)}a.setCaretOffset(b)},setText:function(b,a,c){var e=this._textView,f=e.getModel();if(f.getBaseModel){if(a!==undefined){this._expandOffset(a);a=f.mapOffset(a,true)}if(c!==
undefined){this._expandOffset(c);c=f.mapOffset(c,true)}}e.setText(b,a,c)},setFoldingEnabled:function(b){this._foldingEnabled=b;this._updateFoldingRuler()},_updateFoldingRuler:function(){var b=this._textView;if(this._foldingEnabled){if(!this._foldingRuler&&this._foldingRulerFactory&&b.getModel().getBaseModel&&this._foldingEnabled){b.annotationModel=this._annotationModel;this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel);this._foldingRuler.addAnnotationType(this.foldingType);
b.addRuler(this._foldingRuler)}}else if(this._foldingRuler){b.removeRuler(this._foldingRuler);this._foldingRuler=null}},setSelection:function(b,a,c){var e=this._textView,f=e.getModel();if(f.getBaseModel){this._expandOffset(b);this._expandOffset(a);b=f.mapOffset(b,true);a=f.mapOffset(a,true)}e.setSelection(b,a,c)},moveSelection:function(b,a,c){a=a||b;var e=this._textView;this.setSelection(b,a,false);a=e.getTopPixel();var f=e.getBottomPixel();b=this.getModel().getLineAtOffset(b);b=e.getLinePixel(b);
if(b<a||b>f){f=Math.max(0,b-Math.floor((b<a?3:1)*(f-a)/4));(new orion.editor.util.Animation({node:e,duration:300,curve:[a,f],onAnimate:function(g){e.setTopPixel(Math.floor(g))},onEnd:function(){e.showSelection();e.focus();c&&c()}})).play()}else{e.showSelection();e.focus();c&&c()}},isDirty:function(){return this._dirty},checkDirty:function(){var b=!this._undoStack.isClean();this._dirty!==b&&this.onDirtyChange(b)},getAnnotationModel:function(){return this._annotationModel},doFind:function(b,a,c,e){var f=
this.getText();if(c){b=b.toLowerCase();f=f.toLowerCase()}if(e){f=f.split("").reverse().join("");b=b.split("").reverse().join("");a=f.length-a-1;a=f.indexOf(b,a);if(a!==-1)return{index:f.length-b.length-a,length:b.length}}else{a=f.indexOf(b,a);if(a!==-1)return{index:a,length:b.length}}return null},doFindRegExp:function(b,a,c,e){if(!b)return null;a=a||"";a+=(a.indexOf("g")===-1?"g":"")+(a.indexOf("m")===-1?"m":"");b=new RegExp(b,a);a=this.getText();var f=null,g=null;if(e)for(;;)if((f=b.exec(a))&&f.index<=
c)g={index:f.index,length:f[0].length};else return g;else return(f=b.exec(a.substring(c)))&&{index:f.index+c,length:f[0].length}},parseRegExp:function(b){if(b=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(b))return{pattern:b[1],flags:b[2]};return null},highlightAnnotations:function(){if(this._annotationStyler){this._annotationStyler.destroy();this._annotationStyler=null}if(this._annotationFactory)this._annotationStyler=this._annotationFactory.createAnnotationStyler(this.getTextView(),this._annotationModel)},
installTextView:function(){function b(){var f=this.getModel(),g=this.getCaretOffset(),i=f.getLineAtOffset(g);f=f.getLineStart(i);g=g-f;for(f=0;f<this._keyModes.length;f++){var j=this._keyModes[f];if(j.isActive()&&j.isStatusActive&&j.isStatusActive())return}this.reportStatus("Line "+(i+1)+" : Col "+(g+1))}this._textView=this._textViewFactory();if(this._undoStackFactory)this._undoStack=this._undoStackFactory.createUndoStack(this);if(this._contentAssistFactory){this._contentAssist=this._contentAssistFactory(this);
this._keyModes.push(this._contentAssist)}var a=this,c=this._textView;this._keyBindingFactory&&this._keyBindingFactory(this,this._keyModes,this._undoStack,this._contentAssist);c.setKeyBinding(new orion.textview.KeyBinding(27),"Cancel Current Mode");c.setAction("Cancel Current Mode",function(){for(var f=0;f<this._keyModes.length;f++)if(this._keyModes[f].isActive())return this._keyModes[f].cancel();return false}.bind(this));c.setAction("lineUp",function(){for(var f=0;f<this._keyModes.length;f++)if(this._keyModes[f].isActive())return this._keyModes[f].lineUp();
return false}.bind(this));c.setAction("lineDown",function(){for(var f=0;f<this._keyModes.length;f++)if(this._keyModes[f].isActive())return this._keyModes[f].lineDown();return false}.bind(this));c.setAction("enter",function(){for(var f=0;f<this._keyModes.length;f++)if(this._keyModes[f].isActive())return this._keyModes[f].enter();return false}.bind(this));c.addEventListener("ModelChanged",this,this.checkDirty);c.addEventListener("Selection",this,b);if(this._annotationFactory){var e=c.getModel();if(e.getBaseModel)e=
e.getBaseModel();this._annotationModel=this._annotationFactory.createAnnotationModel(e);e=this._annotationFactory.createAnnotationRulers(this._annotationModel);this._annotationRuler=e.annotationRuler;this._annotationRuler.onClick=function(f){if(f!==undefined)if(f!==-1){var g=c.getModel(),i=this.getAnnotationModel(),j=a.mapOffset(g.getLineStart(f));f=a.mapOffset(g.getLineEnd(f));if(i=i.getAnnotations(j,f).next()){f=a.getModel();a.onGotoLine(f.getLineAtOffset(j),i.start-j,i.end-j)}}};this._overviewRuler=
e.overviewRuler;this._overviewRuler.onClick=function(f){if(f!==undefined){f=c.getModel().getLineStart(f);a.moveSelection(a.mapOffset(f))}};this._annotationRuler.setMultiAnnotationOverlay({html:"<div class='annotationHTML overlay'></div>"});this._annotationRuler.addAnnotationType(this.errorType);this._annotationRuler.addAnnotationType(this.warningType);this._annotationRuler.addAnnotationType(this.taskType);this._overviewRuler.addAnnotationType(this.errorType);this._overviewRuler.addAnnotationType(this.warningType);
this._overviewRuler.addAnnotationType(this.taskType);c.addRuler(this._annotationRuler);c.addRuler(this._overviewRuler)}if(this._lineNumberRulerFactory){this._lineNumberRuler=this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel);c.addRuler(this._lineNumberRuler)}this._updateFoldingRuler()},showProblems:function(b){var a=this._annotationModel;if(a){for(var c=[],e=[],f=a.getTextModel(),g=a.getAnnotations(0,f.getCharCount()),i;g.hasNext();){i=g.next();if(i.type===this.errorType||i.type===
this.warningType)c.push(i)}if(b)for(g=0;g<b.length;g++)if(i=b[g]){var j=i.description.replace(/'/g,"&#39;").replace(/"/g,"&#34;"),h=f.getLineStart(i.line-1),l=i.severity;i={type:this[l+"Type"],start:h+i.start-1,end:h+i.end,title:j,html:"<div class='annotationHTML "+l+"'></div>",style:{styleClass:"annotation "+l},overviewStyle:{styleClass:"annotationOverview "+l},rangeStyle:{styleClass:"annotationRange "+l}};e.push(i)}a.replaceAnnotations(c,e)}},showSelection:function(b,a,c,e,f){if(typeof b==="number"){if(typeof a!==
"number")a=b;this.moveSelection(b,a)}else if(typeof c==="number"){b=this.getModel().getLineStart(c-1);if(typeof e==="number")b+=e;if(typeof f!=="number")f=0;this.moveSelection(b,b+f)}},onInputChange:function(b,a,c,e){this._title=b;if(e&&this._textView){this._undoStack.markClean();this.checkDirty()}else if(this._textView){if(a)this._textView.setText(a);else if(c!==null&&c!==undefined){this._textView.setText(c);this._textView.getModel().setLineDelimiter("auto")}this._undoStack.reset();this.checkDirty();
this._textView.focus()}},onGotoLine:function(b,a,c){if(this._textView){var e=this.getModel(),f=e.getLineStart(b),g=0;if(c===undefined)c=0;if(typeof a==="string"){b=e.getLine(b).indexOf(a);if(b!==-1){g=b;c=g+a.length}}else{g=a;a=e.getLineEnd(b)-f;g=Math.min(g,a);c=Math.min(c,a)}this.moveSelection(f+g,f+c)}},onDirtyChange:function(b){this._dirty=b},getTitle:function(){return this._title}};return d}();
orion.editor.util={connect:function(d,b,a,c){var e=d[b];d[b]=function(){var f=a;if(a===null||typeof a==="undefined")f=d;var g=typeof c==="string"?a[c]:c;typeof e==="function"&&e.apply(d,arguments);g.apply(f,arguments)}},Animation:function(){function d(b){this.options=b}d.prototype.play=function(){function b(){l=l===-1?(new Date).getTime():l;var p=((new Date).getTime()-l)/a;if(p<1){p=c(p);j=g+p*i;e(j)}else{clearInterval(h);f()}}var a=typeof this.options.duration==="number"?this.options.duration:350,
c=this.options.easing||this.defaultEasing,e=this.options.onAnimate||function(){},f=this.options.onEnd||function(){},g=this.options.curve[0],i=this.options.curve[1]-g,j,h,l=-1;h=setInterval(b,typeof this.options.rate==="number"?this.options.rate:20)};d.prototype.defaultEasing=function(b){return Math.sin(b*(Math.PI/2))};return d}(),bind:function(d){var b=this,a=Array.prototype.slice.call(arguments,1);if(a.length)return function(){return arguments.length?b.apply(d,a.concat(Array.prototype.slice.call(arguments))):
b.apply(d,a)};return function(){return arguments.length?b.apply(d,arguments):b.call(d)}}};if(!Function.prototype.bind)Function.prototype.bind=orion.editor.util.bind;typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/editor/editor",["orion/textview/keyBinding"],function(){return orion.editor});
define("orion/syntaxchecker",["dojo"],function(d){var b=b||{};b.SyntaxChecker=function(){function a(c,e){this.registry=c;this.editor=e;d.connect(this.editor,"onInputChange",this,this.checkSyntax)}a.prototype={checkSyntax:function(c,e,f){if(!e){var g=this.registry.getServiceReferences("orion.edit.validator");e=[];for(var i=0;i<g.length;i++){var j=g[i],h=j.getProperty("pattern");h&&(new RegExp(h)).test(c)&&e.push(j)}g=function(l){return l.checkSyntax(c,f)};j=function(l){return l.problems||l.errors};
h=[];for(i=0;i<e.length;i++)h.push(this.registry.getService(e[i]).then(g).then(j));(new d.DeferredList(h)).then(d.hitch(this,function(l){var p=[];for(i=0;i<l.length;i++){var t=l[i]&&l[i][1];if(t){this._fixup(t);p=p.concat(t)}}this.registry.getService("orion.core.marker").then(function(r){r._setProblems(p)})}))}},_fixup:function(c){for(var e=this.editor.getModel(),f=0;f<c.length;f++){var g=c[f];g.description=g.description||g.reason;g.severity=g.severity||"error";g.start=typeof g.start==="number"?g.start:
g.character;g.end=typeof g.end==="number"?g.end:g.start+1;var i=e.getLine(g.line-1,false).length;g.start=Math.max(1,g.start);g.start=Math.min(g.start,i);g.end=Math.min(g.end,i);g.end=Math.max(g.start,g.end)}}};return a}();return b});orion=orion||{};orion.editor=orion.editor||{};
orion.editor.AbstractStyler=function(){function d(){}d.prototype={initialize:function(b){this.textView=b;b.addEventListener("Selection",this,this._onSelection);b.addEventListener("ModelChanged",this,this._onModelChanged);b.addEventListener("Destroy",this,this._onDestroy);b.addEventListener("LineStyle",this,this._onLineStyle);b.redrawLines()},destroy:function(){if(this.textView){this.textView.removeEventListener("Selection",this,this._onSelection);this.textView.removeEventListener("ModelChanged",this,
this._onModelChanged);this.textView.removeEventListener("Destroy",this,this._onDestroy);this.textView.removeEventListener("LineStyle",this,this._onLineStyle);this.textView=null}},_onSelection:function(){},_onModelChanged:function(){},_onDestroy:function(){},_onLineStyle:function(){}};return d}();
orion.editor.AbstractStyler.extend=function(d,b){if(typeof d!=="function")throw new Error("Function expected");d.prototype=new orion.editor.AbstractStyler;d.constructor=d;for(var a in b)if(b.hasOwnProperty(a))d.prototype[a]=b[a]};
orion.editor.RegexUtil={unsupported:[{regex:/\(\?[ims\-]:/,func:function(){return"option on/off for subexp"}},{regex:/\(\?<([=!])/,func:function(d){return d[1]==="="?"lookbehind":"negative lookbehind"}},{regex:/\(\?>/,func:function(){return"atomic group"}}],toRegExp:function(d){function b(g,i){throw new Error('Unsupported regex feature "'+g+'": "'+i[0]+'" at index: '+i.index+" in "+i.input);}function a(g){for(var i="",j=false,h=g.length,l=0;l<h;){var p=g[l];if(!j&&p==="#")for(;l<h&&p!=="\r"&&p!==
"\n";)p=g[++l];else if(!j&&/\s/.test(p))for(;l<h&&/\s/.test(p);)p=g[++l];else{if(p==="\\"){i+=p;if(!/\s/.test(g[l+1])){i+=g[l+1];l+=1}}else{if(p==="[")j=true;else if(p==="]")j=false;i+=p}l+=1}}return i}var c="",e;d=orion.editor.RegexUtil.processGlobalFlag("x",d,function(g){return a(g)});d=orion.editor.RegexUtil.processGlobalFlag("i",d,function(g){c+="i";return g});for(e=0;e<this.unsupported.length;e++){var f;if(f=this.unsupported[e].regex.exec(d))b(this.unsupported[e].func(f),f)}return new RegExp(d,
c)},processGlobalFlag:function(d,b,a){function c(f,g){var i=0,j=f.length,h=-1;for(g=g;g<j&&h===-1;g++)switch(f[g]){case "\\":g++;break;case "(":i++;break;case ")":i--;if(i===0)h=g;break}return h}var e="(?"+d+")";d="(?"+d+":";if(b.substring(0,e.length)===e)return a(b.substring(e.length));else if(b.substring(0,d.length)===d){e=c(b,0);if(e<b.length-1)throw new Error("Only a "+d+") group that encloses the entire regex is supported in: "+b);return a(b.substring(d.length,e))}return b},hasBackReference:function(d){return/\\\d+/.test(d.source)},
getSubstitutedRegex:function(d,b,a){a=typeof a==="undefined"?true:false;d=d.source.split(/(\\\d+)/g);for(var c=[],e=0;e<d.length;e++){var f=d[e],g=/\\(\d+)/.exec(f);if(g){f=b[g[1]]||"";c.push(a?orion.editor.RegexUtil.escapeRegex(f):f)}else c.push(f)}return new RegExp(c.join(""))},escapeRegex:function(d){return d.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")},groupify:function(d,b){var a=d.source,c=a.length,e=[],f=0,g=[],i=1,j=1,h=[];d={};for(var l={},p=0;p<c;p++){var t=e[e.length-1],r=a[p];switch(r){case "(":if(t===
4){e.pop();h.push(")");g[g.length-1].end=p}var s=p+2<c?a[p+1]+""+a[p+2]:null;if(s==="?:"||s==="?="||s==="?!"){var v;if(s==="?:")v=1;else{v=3;f++}e.push(v);g.push({start:p,end:-1,type:v});h.push(r);h.push(s);p+=s.length}else{e.push(2);g.push({start:p,end:-1,type:2,oldNum:i,num:j});h.push(r);if(f===0)l[j]=null;d[i]=j;i++;j++}break;case ")":t=e.pop();t===3&&f--;g[g.length-1].end=p;h.push(r);break;case "*":case "+":case "?":case "}":var z=r,y=a[p-1];s=p-1;if(r==="}"){for(v=p-1;a[v]!=="{"&&v>=0;v--);y=
a[v-1];s=v-1;z=a.substring(v,p+1)}v=g[g.length-1];if(y===")"&&(v.type===2||v.type===4)){h.splice(v.start,0,"(");h.push(z);h.push(")");r={start:v.start,end:h.length-1,type:4,num:v.num};for(y=0;y<g.length;y++){t=g[y];if(t.type===2||t.type===4)if(t.start>=v.start&&t.end<=s){t.start+=1;t.end+=1;t.num+=1;if(t.type===2)d[t.oldNum]=t.num}}g.push(r);j++;break}default:if(r!=="|"&&t!==2&&t!==4)if(f===0){e.push(4);g.push({start:p,end:-1,type:4,num:j});h.push("(");l[j]=null;j++}h.push(r);if(r==="\\"){h.push(a[p+
1]);p+=1}break}}for(;e.length;){e.pop();h.push(")")}a=new RegExp(h.join(""));c={};b=b||d;for(var k in b)if(b.hasOwnProperty(k))c[k]="\\"+b[k];a=this.getSubstitutedRegex(a,c,false);return[a,d,l]},complexCaptures:function(d){if(!d)return false;for(var b in d)if(d.hasOwnProperty(b))if(b!=="0")return true;return false}};
orion.editor.TextMateStyler=function(){function d(b,a,c){this.initialize(b);this.grammar=this.copy(a);this.externalGrammars=c?this.copy(c):[];this._styles={};this._tree=null;this._allGrammars={};this.preprocess(this.grammar)}orion.editor.AbstractStyler.extend(d,{copy:function(b){return JSON.parse(JSON.stringify(b))},preprocess:function(b){for(b=[b];b.length!==0;){var a=b.pop();if(!(a._resolvedRule&&a._typedRule)){a._resolvedRule=this._resolve(a);a._typedRule=this._createTypedRule(a);this.addStyles(a.name);
this.addStyles(a.contentName);this.addStylesForCaptures(a.captures);this.addStylesForCaptures(a.beginCaptures);this.addStylesForCaptures(a.endCaptures);a._resolvedRule!==a&&b.push(a._resolvedRule);if(a.patterns)for(var c=0;c<a.patterns.length;c++)b.push(a.patterns[c])}}},addStyles:function(b){if(b&&!this._styles[b]){this._styles[b]=[];for(var a=b.split("."),c=0;c<a.length;c++)this._styles[b].push(a.slice(0,c+1).join("-"))}},addStylesForCaptures:function(b){for(var a in b)b.hasOwnProperty(a)&&this.addStyles(b[a].name)},
ContainerRule:function(){function b(a){this.rule=a;this.subrules=a.patterns}b.prototype.valueOf=function(){return"aa"};return b}(),BeginEndRule:function(){function b(a){this.rule=a;this.beginRegex=orion.editor.RegexUtil.toRegExp(a.begin);this.endRegex=orion.editor.RegexUtil.toRegExp(a.end);this.subrules=a.patterns||[];this.endRegexHasBackRef=orion.editor.RegexUtil.hasBackReference(this.endRegex);var c=orion.editor.RegexUtil.complexCaptures(a.captures);a=orion.editor.RegexUtil.complexCaptures(a.beginCaptures)||
orion.editor.RegexUtil.complexCaptures(a.endCaptures);if(this.isComplex=c||a){c=orion.editor.RegexUtil.groupify(this.beginRegex);this.beginRegex=c[0];this.beginOld2New=c[1];this.beginConsuming=c[2];c=orion.editor.RegexUtil.groupify(this.endRegex,this.beginOld2New);this.endRegex=c[0];this.endOld2New=c[1];this.endConsuming=c[2]}}b.prototype.valueOf=function(){return this.beginRegex};return b}(),MatchRule:function(){function b(a){this.rule=a;this.matchRegex=orion.editor.RegexUtil.toRegExp(a.match);if(this.isComplex=
orion.editor.RegexUtil.complexCaptures(a.captures)){a=orion.editor.RegexUtil.groupify(this.matchRegex);this.matchRegex=a[0];this.matchOld2New=a[1];this.matchConsuming=a[2]}}b.prototype.valueOf=function(){return this.matchRegex};return b}(),_createTypedRule:function(b){return b.match?new this.MatchRule(b):b.begin?new this.BeginEndRule(b):new this.ContainerRule(b)},_resolve:function(b){var a=b;if(b.include){if(b.begin||b.end||b.match)throw new Error('Unexpected regex pattern in "include" rule '+b.include);
b=b.include;if(b[0]==="#"){a=this.grammar.repository&&this.grammar.repository[b.substring(1)];if(!a)throw new Error("Couldn't find included rule "+b+" in grammar repository");}else if(b==="$self")a=this.grammar;else if(b==="$base")throw new Error('Include "$base" is not supported');else{a=this._allGrammars[b];if(!a)for(var c=0;c<this.externalGrammars.length;c++){var e=this.externalGrammars[c];if(e.scopeName===b){this.preprocess(e);a=this._allGrammars[b]=e;break}}}}return a},ContainerNode:function(){function b(a,
c){this.parent=a;this.rule=c;this.children=[];this.end=this.start=null}b.prototype.addChild=function(a){this.children.push(a)};b.prototype.valueOf=function(){var a=this.rule;return"ContainerNode { "+(a.include||"")+" "+(a.name||"")+(a.comment||"")+"}"};return b}(),BeginEndNode:function(){function b(a,c,e){this.parent=a;this.rule=c;this.children=[];this.setStart(e);this.endMatch=this.end=null;this.endRegexSubstituted=c.endRegexHasBackRef?orion.editor.RegexUtil.getSubstitutedRegex(c.endRegex,e):null}
b.prototype.addChild=function(a){this.children.push(a)};b.prototype.getIndexInParent=function(){return this.parent?this.parent.children.indexOf(this):-1};b.prototype.setStart=function(a){this.start=a.index;this.beginMatch=a};b.prototype.setEnd=function(a){if(a&&typeof a==="object"){this.endMatch=a;this.end=a.index+a[0].length}else{this.endMatch=null;this.end=a}};b.prototype.shiftStart=function(a){this.start+=a;this.beginMatch.index+=a};b.prototype.shiftEnd=function(a){this.end+=a;if(this.endMatch)this.endMatch.index+=
a};b.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range="+this.start+".."+this.end+"}"};return b}(),push:function(b,a){if(a)for(var c=a.length;c>0;)b.push(a[--c])},exec:function(b,a,c){if(a=b.exec(a))a.index+=c;b.lastIndex=0;return a},afterMatch:function(b){return b.index+b[0].length},getEndMatch:function(b,a,c){if(b instanceof this.BeginEndNode){var e=b.rule;b=b.endRegexSubstituted||e.endRegex;if(!b)return null;return this.exec(b,a,c)}return null},initialParse:function(){this.textView.getModel().getCharCount();
this._tree=new this.ContainerNode(null,this.grammar._typedRule);this.parse(this._tree,false,0)},_onModelChanged:function(b){var a=b.addedCharCount,c=b.removedCharCount;b=b.start;if(this._tree){var e=this.textView.getModel(),f=e.getCharCount();e=e.getLineEnd(e.getLineAtOffset(b)-1);var g=this.getFirstDamaged(e,e);e=e===-1?0:e;a=g?this.parse(g,true,e,b,a,c):f;this.textView.redrawRange(e,a)}else this.initialParse()},getFirstDamaged:function(b,a){if(b<0)return this._tree;for(var c=[this._tree],e=null;c.length;){var f=
c.pop();if(!f.parent||this.isDamaged(f,b,a)){if(f instanceof this.BeginEndNode)e=f;for(var g=0;g<f.children.length;g++)c.push(f.children[g])}}return e||this._tree},isDamaged:function(b,a,c){return b.start<=c&&b.end>a},parse:function(b,a,c,e,f,g){var i=this.textView.getModel(),j=i.getLineStart(i.getLineCount()-1),h=i.getCharCount(),l=this.getInitialExpected(b,c),p=-1;if(a){b.repaired=true;b.endNeedsUpdate=true;p=b.children[b.children.length-1];var t=f-g;p=p?i.getLineEnd(i.getLineAtOffset(p.end+t)):
-1;e=i.getLineEnd(i.getLineAtOffset(e+g));p=Math.max(p,e)}p=p===-1?h:p;e=l;var r=b;t=false;for(var s=c,v=-1;r&&(!a||s<p);){var z=this.getNextMatch(i,r,s);z||(s=s>=j?h:i.getLineStart(i.getLineAtOffset(s)+1));var y=z&&z.match,k=z&&z.rule,n=z&&z.isEnd;if(z&&z.isSub){s=this.afterMatch(y);if(k instanceof this.BeginEndRule){t=true;if(a&&k===e.rule&&r===e.parent){r=e;r.setStart(y);r.repaired=true;r.endNeedsUpdate=true;r=r;e=this.getNextExpected(e,"begin")}else{if(a){this.prune(r,e);a=false}y=new this.BeginEndNode(r,
k,y);r.addChild(y);r=y}}}else if(n||s===h){if(r instanceof this.BeginEndNode)if(y){t=true;v=Math.max(v,r.end);r.setEnd(y);s=this.afterMatch(y);if(a&&r===e&&r.parent===e.parent){r.repaired=true;delete r.endNeedsUpdate;e=this.getNextExpected(e,"end")}else if(a){this.prune(r,e);a=false}}else{r.setEnd(h);delete r.endNeedsUpdate}r=r.parent}if(a&&s>=p&&!t){this.prune(b,l);a=false}}this.removeUnrepairedChildren(b,a,c);this.cleanup(a,b,c,p,h,f,g);return a?Math.max(v,s):s},removeUnrepairedChildren:function(b,
a,c){if(a){a=b.children;for(var e=-1,f=0;f<a.length;f++){var g=a[f];if(!g.repaired&&this.isDamaged(g,c,Number.MAX_VALUE)){e=f;break}}if(e!==-1)b.children.length=e}},cleanup:function(b,a,c,e,f,g,i){if(b){b=g-i;f=this.getIntersecting(e-b+1,f);a=this.getIntersecting(c,e);for(c=0;c<f.length;c++){e=f[c];if(!e.repaired&&e instanceof this.BeginEndNode){e.shiftEnd(b);e.shiftStart(b)}}for(c=0;c<a.length;c++){e=a[c];e.repaired&&e.endNeedsUpdate&&e.shiftEnd(b);delete e.endNeedsUpdate;delete e.repaired}}else{a=
this.getIntersecting(c,e);for(c=0;c<a.length;c++)delete a[c].repaired}},getNextMatch:function(b,a,c,e){var f=b.getLineAtOffset(c);f=b.getLineEnd(f);var g=b.getText(c,f),i=[],j=[];b=[];f=[];for(this.push(i,a.rule.subrules);i.length;){var h=i.length?i.pop():null;h=h&&h._resolvedRule._typedRule;if(h instanceof this.ContainerRule&&j.indexOf(h)===-1){j.push(h);this.push(i,h.subrules)}else if(!(h&&e&&!h.matchRegex)){var l=h&&this.exec(h.matchRegex||h.beginRegex,g,c);if(l){b.push(l);f.push(h)}}}i=Number.MAX_VALUE;
j=-1;for(h=0;h<b.length;h++){l=b[h];if(l.index<i){i=l.index;j=h}}if(!e)if(c=this.getEndMatch(a,g,c)){e=a.rule.applyEndPatternLast;if(j===-1||c.index<i||!e&&c.index===i)return{isEnd:true,rule:a.rule,match:c}}return j===-1?null:{isSub:true,rule:f[j],match:b[j]}},getInitialExpected:function(b,a){var c,e;if(b===this._tree)for(c=0;c<b.children.length;c++){e=b.children[c];if(e.start>=a)return e}else if(b instanceof this.BeginEndNode)if(b.endMatch){var f=b.endMatch.index;for(c=0;c<b.children.length;c++){e=
b.children[c];if(e.start>=a)break}if(e&&e.start<f)return e}return b},getNextExpected:function(b,a){if(a==="begin")return(a=b.children[0])?a:b;else if(a==="end")if(a=b.parent)return(b=a.children[a.children.indexOf(b)+1])?b:a;return null},prune:function(b,a){if(a.parent===b)b.children.length=a.getIndexInParent();else if(b instanceof this.BeginEndNode){b.endMatch=null;b.end=null}if(b.parent)b.parent.children.length=b.getIndexInParent()+1},_onLineStyle:function(b){function a(i,j){return i.start-j.start}
this._tree||this.initialParse();var c=b.lineStart,e=this.textView.getModel(),f=e.getLineEnd(b.lineIndex),g=e.getLineEnd(e.getLineAtOffset(c)-1);g=this.getFirstDamaged(g,g);c=this.getLineScope(e,g,c,f);b.ranges=this.toStyleRanges(c);b.ranges.sort(a)},getLineScope:function(b,a,c,e){for(var f=c,g=this.getInitialExpected(a,c),i=[],j=[];a&&f<e;){var h=this.getNextMatch(b,a,f);if(!h)break;var l=h&&h.match,p=h&&h.rule,t=h&&h.isSub;h=h&&h.isEnd;l.index!==f&&j.push({start:f,end:l.index,node:a});if(t){f=this.afterMatch(l);
if(p instanceof this.BeginEndRule){this.addBeginScope(i,l,p);a=g;g=this.getNextExpected(g,"begin")}else this.addMatchScope(i,l,p)}else if(h){f=this.afterMatch(l);this.addEndScope(i,l,p);g=this.getNextExpected(g,"end");a=a.parent}}f<e&&j.push({start:f,end:e,node:a});b=this.getInheritedLineScope(j,c,e);return i.concat(b)},getInheritedLineScope:function(b){for(var a=[],c=0;c<b.length;c++)for(var e=b[c],f=e.node;f;){var g=f.rule.rule,i=g.name;if(g=g.contentName||i){this.addScopeRange(a,e.start,e.end,
g);break}f=f.parent}return a},addBeginScope:function(b,a,c){var e=c.rule;this.addCapturesScope(b,a,e.beginCaptures||e.captures,c.isComplex,c.beginOld2New,c.beginConsuming)},addEndScope:function(b,a,c){var e=c.rule;this.addCapturesScope(b,a,e.endCaptures||e.captures,c.isComplex,c.endOld2New,c.endConsuming)},addMatchScope:function(b,a,c){var e=c.rule,f=e.name;(e=e.captures)?this.addCapturesScope(b,a,e,c.isComplex,c.matchOld2New,c.matchConsuming):this.addScope(b,a,f)},addScope:function(b,a,c){c&&b.push({start:a.index,
end:this.afterMatch(a),scope:c})},addScopeRange:function(b,a,c,e){e&&b.push({start:a,end:c,scope:e})},addCapturesScope:function(b,a,c,e,f,g){if(c)if(e){e={1:0};for(var i=0,j=1;a[j]!==undefined;j++){if(g[j]!==undefined)i+=a[j].length;if(a[j+1]!==undefined)e[j+1]=i}g=a.index;for(i=1;c[i];i++){j=c[i].name;var h=f[i],l=g+e[h];typeof a[h]!=="undefined"&&this.addScopeRange(b,l,l+a[h].length,j)}}else this.addScope(b,a,c[0]&&c[0].name)},getIntersecting:function(b,a){for(var c=[],e=this._tree?[this._tree]:
[];e.length;){var f=e.pop(),g=false;if(f instanceof this.ContainerNode)g=true;else if(this.isDamaged(f,b,a)){g=true;c.push(f)}if(g){g=f.children.length;for(var i=0;i<g;i++)e.push(f.children[i])}}return c.reverse()},_onSelection:function(){},_onDestroy:function(){this._tree=this._styles=this.grammar=null},toStyleRanges:function(b){for(var a=[],c=0;c<b.length;c++){var e=b[c],f=this._styles[e.scope];if(!f)throw new Error("styles not found for "+e.scope);f=f.join(" ");a.push({start:e.start,end:e.end,
style:{styleClass:f}})}return a}});return d}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/editor/textMateStyler",[],function(){return orion.editor});
define("orion/breadcrumbs",["require","dojo"],function(d,b){function a(c){this._init(c)}a.prototype={_init:function(c){var e=c.container;if(typeof e==="string")e=b.byId(e);if(!e)throw"no parent container";this._container=e;b.removeClass(e,"currentLocation");this._id=c.id||"eclipse.breadcrumbs";this._resource=c.resource||null;this._firstSegmentName=c.firstSegmentName;this._makeHref=c.makeHref;this.path="";this.render()},getNavigatorRootSegment:function(){if(this._firstSegmentName){var c=document.createElement("a");
b.place(document.createTextNode(this._firstSegmentName),c,"only");c.href=d.toUrl("navigate/table.html")+"#";return c}return null},render:function(){var c=this._container,e=b.byId(this._id);if(e)b.empty(e);else{e=document.createElement("span");e.id=this._id;c.appendChild(e)}var f;if(f=this.getNavigatorRootSegment()){b.addClass(f,"breadcrumb");e.appendChild(f);if(this._resource&&this._resource.Parents){f=document.createElement("span");b.place(document.createTextNode(" / "),f,"only");this.path+="/";
b.addClass(f,"breadcrumb");e.appendChild(f)}else{f.href="";b.removeClass(f,"breadcrumb");b.addClass(f,"currentLocation")}}if(this._resource&&this._resource.Parents){c=this._resource.Parents;for(var g=c.length;--g>=0;){f=document.createElement("a");b.addClass(f,"breadcrumb");b.place(document.createTextNode(c[g].Name),f,"only");this.path+=c[g].Name;if(this._makeHref)this._makeHref(f,c[g].ChildrenLocation);else f.href=d.toUrl("navigate/table.html")+"#"+c[g].ChildrenLocation;e.appendChild(f);f=document.createElement("span");
b.place(document.createTextNode(" / "),f,"only");this.path+="/";b.addClass(f,"breadcrumb");e.appendChild(f)}if(this._resource){f=document.createElement("a");b.place(document.createTextNode(this._resource.Name),f,"only");b.addClass(f,"breadcrumb");b.addClass(f,"currentLocation");this.path+=this._resource.Name;e.appendChild(f)}}if(e.childNodes.length===0){f=document.createElement("a");b.place(document.createTextNode(document.title),f,"only");b.addClass(f,"breadcrumb");b.addClass(f,"currentLocation");
e.appendChild(f)}}};a.prototype.constructor=a;return{BreadCrumbs:a}});var examples=examples||{};examples.textview=examples.textview||{};
examples.textview.TextStyler=function(){function d(o,m,q){this.commentStart="/*";this.commentEnd="*/";var w=[];switch(m){case "java":w=a;break;case "js":w=b;break;case "css":w=c;break}this.whitespacesVisible=false;this.detectTasks=this.foldingEnabled=this.highlightCaretLine=this.detectHyperlinks=true;this._scanner=new z(w,this.whitespacesVisible);if(m==="css")this._scanner.isCSS=true;this._firstScanner=new n;this._commentScanner=new k(this.whitespacesVisible);this._whitespaceScanner=new y;this.view=
o;this.annotationModel=q;this._matchingBracket=this._currentBracket=undefined;o.addEventListener("Selection",this,this._onSelection);m=o.getModel();if(m.getBaseModel){var u=this;this._baseModelListener={onChanged:function(x){u._onModelChanged(x)}};m.getBaseModel().addListener(this._baseModelListener)}else o.addEventListener("ModelChanged",this,this._onModelChanged);o.addEventListener("Destroy",this,this._onDestroy);o.addEventListener("LineStyle",this,this._onLineStyle);this._computeComments();this._computeFolding();
o.redrawLines()}var b=["break","case","class","catch","continue","const","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","implements","import","in","instanceof","interface","let","new","null","package","private","protected","public","return","static","super","switch","this","throw","true","try","typeof","undefined","var","void","while","with","yield"],a=["abstract","boolean","break","byte","case","catch","char","class","continue","default",
"do","double","else","extends","false","final","finally","float","for","if","implements","import","instanceof","int","interface","long","native","new","null","package","private","protected","public","return","short","static","super","switch","synchronized","this","throw","throws","transient","true","try","void","volatile","while"],c=["color","text-align","text-indent","text-decoration","font","font-style","font-family","font-weight","font-size","font-variant","line-height","background","background-color",
"background-image","background-position","background-repeat","background-attachment","list-style","list-style-image","list-style-position","list-style-type","outline","outline-color","outline-style","outline-width","border","border-left","border-top","border-bottom","border-right","border-color","border-width","border-style","border-bottom-color","border-bottom-style","border-bottom-width","border-left-color","border-left-style","border-left-width","border-top-color","border-top-style","border-top-width",
"border-right-color","border-right-style","border-right-width","padding","padding-left","padding-top","padding-bottom","padding-right","margin","margin-left","margin-top","margin-bottom","margin-right","width","height","left","top","right","bottom","min-width","max-width","min-height","max-height","display","visibility","clip","cursor","overflow","overflow-x","overflow-y","position","z-index","vertical-align","horizontal-align","float","clear"],e={styleClass:"token_singleline_comment"},f={styleClass:"token_multiline_comment"},
g={styleClass:"token_doc_comment"},i={styleClass:"token_doc_html_markup"},j={styleClass:"token_task_tag"},h={styleClass:"token_doc_tag"},l={styleClass:"token_string"},p={styleClass:"token_keyword"},t={styleClass:"token_space"},r={styleClass:"token_tab"},s={styleClass:(document.selection&&window.ActiveXObject&&/MSIE/.test(navigator.userAgent)?document.documentMode:undefined)<9?"token_bracket":"token_bracket_outline"},v={styleClass:"line_caret"},z=function(){function o(m,q){this.keywords=m;this.whitespacesVisible=
q;this.setText("")}o.prototype={getOffset:function(){return this.offset},getStartOffset:function(){return this.startOffset},getData:function(){return this.text.substring(this.startOffset,this.offset)},getDataLength:function(){return this.offset-this.startOffset},_default:function(m){var q=this.keywords;switch(m){case 32:case 9:if(this.whitespacesVisible)return m===32?9:8;do m=this._read();while(m===32||m===9);this._unread(m);return 7;case 123:case 125:case 40:case 41:case 91:case 93:case 60:case 62:return m;
default:var w=this.isCSS;if(97<=m&&m<=122||65<=m&&m<=90||m===95||48<=m&&m<=57||45===m&&w){var u=this.offset-1;do m=this._read();while(97<=m&&m<=122||65<=m&&m<=90||m===95||48<=m&&m<=57||45===m&&w);this._unread(m);if(q.length>0){m=this.text.substring(u,this.offset);for(w=0;w<q.length;w++)if(this.keywords[w]===m)return 2}}return 1}},_read:function(){if(this.offset<this.text.length)return this.text.charCodeAt(this.offset++);return-1},_unread:function(m){m!==-1&&this.offset--},nextToken:function(){for(this.startOffset=
this.offset;;){var m=this._read();switch(m){case -1:return null;case 47:m=this._read();if(m===47)for(;;){m=this._read();if(m===-1||m===10||m===13){this._unread(m);return 4}}if(m===42){m=this._read();var q=5;if(m===42)q=6;for(;;){for(;m===42;){m=this._read();if(m===47)return q}if(m===-1){this._unread(m);return q}m=this._read()}}this._unread(m);return 1;case 39:for(;;){m=this._read();switch(m){case 39:return 3;case 13:case 10:case -1:this._unread(m);return 3;case 92:this._read();break}}break;case 34:for(;;){m=
this._read();switch(m){case 34:return 3;case 13:case 10:case -1:this._unread(m);return 3;case 92:this._read();break}}break;default:return this._default(m)}}},setText:function(m){this.text=m;this.startOffset=this.offset=0}};return o}(),y=function(){function o(){z.call(this,null,true)}o.prototype=new z(null);o.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var m=this._read();switch(m){case -1:return null;case 32:return 9;case 9:return 8;default:do m=this._read();while(!(m===32||
m===9||m===-1));this._unread(m);return 1}}};return o}(),k=function(){function o(m){z.call(this,null,m)}o.prototype=new z(null);o.prototype.setType=function(m){this._type=m};o.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var m=this._read();switch(m){case -1:return null;case 32:case 9:if(this.whitespacesVisible)return m===32?9:8;do m=this._read();while(m===32||m===9);this._unread(m);return 7;case 60:if(this._type===6){do m=this._read();while(!(m===62||m===-1));if(m===62)return 10}return 1;
case 64:if(this._type===6){do m=this._read();while(97<=m&&m<=122||65<=m&&m<=90||m===95||48<=m&&m<=57);this._unread(m);return 11}return 1;case 84:if((m=this._read())===79)if((m=this._read())===68)if((m=this._read())===79){m=this._read();if(!(97<=m&&m<=122||65<=m&&m<=90||m===95||48<=m&&m<=57)){this._unread(m);return 12}}this._unread(m);default:do m=this._read();while(!(m===32||m===9||m===-1||m===60||m===64||m===84));this._unread(m);return 1}}};return o}(),n=function(){function o(){z.call(this,null,
false)}o.prototype=new z(null);o.prototype._default=function(m){for(;;){m=this._read();switch(m){case 47:case 34:case 39:case -1:this._unread(m);return 1}}};return o}();d.prototype={destroy:function(){var o=this.view;if(o){var m=o.getModel();m.getBaseModel?m.getBaseModel().removeListener(this._baseModelListener):o.removeEventListener("ModelChanged",this,this._onModelChanged);o.removeEventListener("Selection",this,this._onSelection);o.removeEventListener("Destroy",this,this._onDestroy);o.removeEventListener("LineStyle",
this,this._onLineStyle);this.view=null}},setHighlightCaretLine:function(o){this.highlightCaretLine=o},setWhitespacesVisible:function(o){this.whitespacesVisible=o;this._scanner.whitespacesVisible=o;this._commentScanner.whitespacesVisible=o},setDetectHyperlinks:function(o){this.detectHyperlinks=o},setFoldingEnabled:function(o){this.foldingEnabled=o},setDetectTasks:function(o){this.detectTasks=o},_binarySearch:function(o,m,q,w,u){var x;if(w===undefined)w=-1;if(u===undefined)u=o.length;for(;u-w>1;){x=
Math.floor((u+w)/2);if(m<=o[x].start)u=x;else if(q&&m<o[x].end){u=x;break}else w=x}return u},_computeComments:function(){var o=this.view.getModel();if(o.getBaseModel)o=o.getBaseModel();this.comments=this._findComments(o.getText())},_computeFolding:function(){if(this.foldingEnabled){var o=this.view.getModel();if(o.getBaseModel){var m=this.annotationModel;if(m){m.removeAnnotations("orion.annotation.folding");for(var q=[],w=o.getBaseModel(),u=this.comments,x=0;x<u.length;x++){var B=u[x];(B=this._createFoldingAnnotation(o,
w,B.start,B.end))&&q.push(B)}m.replaceAnnotations(null,q)}}}},_createFoldingAnnotation:function(o,m,q,w){var u=m.getLineAtOffset(q);m=m.getLineAtOffset(w);if(u===m)return null;return new orion.textview.FoldingAnnotation(o,"orion.annotation.folding",q,w,"<div class='annotationHTML expanded'></div>",{styleClass:"annotation expanded"},"<div class='annotationHTML collapsed'></div>",{styleClass:"annotation collapsed"})},_computeTasks:function(o,m,q){if(this.detectTasks){var w=this.annotationModel;if(w){var u=
this.view.getModel(),x=u;if(u.getBaseModel)x=u.getBaseModel();var B=w.getAnnotations(m,q);for(u=[];B.hasNext();)u.push(B.next());B=[];var C=this._commentScanner;C.setText(x.getText(m,q));for(var D;D=C.nextToken();){var F=C.getStartOffset()+m;if(D===12){D=x.getLineEnd(x.getLineAtOffset(F));if(o!==4)D=Math.min(D,q-this.commentEnd.length);B.push({start:F,end:D,type:"orion.annotation.task",title:x.getText(F,D),style:{styleClass:"annotation task"},html:"<div class='annotationHTML task'></div>",overviewStyle:{styleClass:"annotationOverview task"}})}}w.replaceAnnotations(u,
B)}}},_getLineStyle:function(o){if(this.highlightCaretLine){var m=this.view,q=m.getModel();m=m.getSelection();if(m.start===m.end&&q.getLineAtOffset(m.start)===o)return v}return null},_getStyles:function(o,m,q){if(o.getBaseModel)q=o.mapOffset(q);for(var w=q+m.length,u=[],x=q,B=this.comments,C=this._binarySearch(B,q,true);C<B.length;C++){if(B[C].start>=w)break;var D=B[C].start,F=B[C].end;x<D&&this._parse(m.substring(x-q,D-q),x,u);var J=B[C].type===6?g:f;if(this.whitespacesVisible||this.detectHyperlinks){x=
Math.max(x,D);D=Math.min(w,F);this._parseComment(m.substring(x-q,D-q),x,u,J,B[C].type)}else u.push({start:D,end:F,style:J});x=F}x<w&&this._parse(m.substring(x-q,w-q),x,u);if(o.getBaseModel)for(m=0;m<u.length;m++){q=u[m].end-u[m].start;u[m].start=o.mapOffset(u[m].start,true);u[m].end=u[m].start+q}return u},_parse:function(o,m,q){var w=this._scanner;for(w.setText(o);o=w.nextToken();){var u=w.getStartOffset()+m,x=null;if(u===this._matchingBracket)x=s;else switch(o){case 2:x=p;break;case 3:if(this.whitespacesVisible){this._parseString(w.getData(),
u,q,l);continue}else x=l;break;case 6:this._parseComment(w.getData(),u,q,g,o);continue;case 4:this._parseComment(w.getData(),u,q,e,o);continue;case 5:this._parseComment(w.getData(),u,q,f,o);continue;case 8:if(this.whitespacesVisible)x=r;break;case 9:if(this.whitespacesVisible)x=t;break}q.push({start:u,end:w.getOffset()+m,style:x})}},_parseComment:function(o,m,q,w,u){var x=this._commentScanner;x.setText(o);for(x.setType(u);o=x.nextToken();){u=x.getStartOffset()+m;var B=w;switch(o){case 8:if(this.whitespacesVisible)B=
r;break;case 9:if(this.whitespacesVisible)B=t;break;case 10:B=i;break;case 11:B=h;break;case 12:B=j;break;default:if(this.detectHyperlinks)B=this._detectHyperlinks(x.getData(),u,q,B)}B&&q.push({start:u,end:x.getOffset()+m,style:B})}},_parseString:function(o,m,q,w){var u=this._whitespaceScanner;for(u.setText(o);o=u.nextToken();){var x=u.getStartOffset()+m,B=w;switch(o){case 8:if(this.whitespacesVisible)B=r;break;case 9:if(this.whitespacesVisible)B=t;break}B&&q.push({start:x,end:u.getOffset()+m,style:B})}},
_detectHyperlinks:function(o,m,q,w){var u=null,x;if((x=o.indexOf("://"))>0){u=o;for(var B=x;B>0;){x=u.charCodeAt(B-1);if(!(97<=x&&x<=122||65<=x&&x<=90||45===x||48<=x&&x<=57))break;B--}if(B>0){x="\"\"''(){}[]<>".indexOf(u.substring(B-1,B));if(x!==-1&&(x&1)===0&&(x=u.lastIndexOf("\"\"''(){}[]<>".substring(x+1,x+2)))!==-1){var C=x;x=this._clone(w);x.tagName="A";x.attributes={href:u.substring(B,C)};q.push({start:m,end:m+B,style:w});q.push({start:m+B,end:m+C,style:x});q.push({start:m+C,end:m+o.length,
style:w});return null}}}else if(o.toLowerCase().indexOf("bug#")===0)u="https://bugs.eclipse.org/bugs/show_bug.cgi?id="+parseInt(o.substring(4),10);if(u){x=this._clone(w);x.tagName="A";x.attributes={href:u};return x}return w},_clone:function(o){if(!o)return o;var m={};for(var q in o)if(o.hasOwnProperty(q))m[q]=o[q];return m},_findComments:function(o,m){m=m||0;var q=this._firstScanner;q.setText(o);for(var w=[];o=q.nextToken();){if(o===5||o===6){var u={start:q.getStartOffset()+m,end:q.getOffset()+m,
type:o};w.push(u);this._computeTasks(o,q.getStartOffset()+m,q.getOffset()+m)}o===4&&this._computeTasks(o,q.getStartOffset()+m,q.getOffset()+m)}return w},_findMatchingBracket:function(o,m){if(o.getBaseModel)o=o.getBaseModel();var q="{}()[]<>",w=o.getText(m,m+1),u=q.indexOf(w,0);if(u===-1)return-1;var x;x=u&1?q.substring(u-1,u):q.substring(u+1,u+2);var B=o.getLineAtOffset(m);q=o.getLine(B);var C=o.getLineStart(B),D=o.getLineEnd(B);q=this._findBrackets(w,x,q,C,C,D);for(D=0;D<q.length;D++){C=q[D]>=0?
1:-1;if(q[D]*C===m){m=1;if(u&1){for(D--;D>=0;D--){C=q[D]>=0?1:-1;m+=C;if(m===0)return q[D]*C}for(B-=1;B>=0;){q=o.getLine(B);C=o.getLineStart(B);D=o.getLineEnd(B);q=this._findBrackets(w,x,q,C,C,D);for(u=q.length-1;u>=0;u--){C=q[u]>=0?1:-1;m+=C;if(m===0)return q[u]*C}B--}}else{for(D++;D<q.length;D++){C=q[D]>=0?1:-1;m+=C;if(m===0)return q[D]*C}B+=1;for(u=o.getLineCount();B<u;){q=o.getLine(B);C=o.getLineStart(B);D=o.getLineEnd(B);q=this._findBrackets(w,x,q,C,C,D);for(D=0;D<q.length;D++){C=q[D]>=0?1:-1;
m+=C;if(m===0)return q[D]*C}B++}}break}}return-1},_findBrackets:function(o,m,q,w,u,x){var B=[];o=o.charCodeAt(0);m=m.charCodeAt(0);for(var C=u,D=this._scanner,F,J=this.comments,K=this._binarySearch(J,u,true);K<J.length;K++){if(J[K].start>=x)break;F=J[K].start;var L=J[K].end;if(C<F)for(D.setText(q.substring(C-u,F-u));F=D.nextToken();)if(F===o)B.push(D.getStartOffset()+C-u+w);else F===m&&B.push(-(D.getStartOffset()+C-u+w));C=L}if(C<x)for(D.setText(q.substring(C-u,x-u));F=D.nextToken();)if(F===o)B.push(D.getStartOffset()+
C-u+w);else F===m&&B.push(-(D.getStartOffset()+C-u+w));return B},_onDestroy:function(){this.destroy()},_onLineStyle:function(o){if(o.textView===this.view)o.style=this._getLineStyle(o.lineIndex);o.ranges=this._getStyles(o.textView.getModel(),o.lineText,o.lineStart)},_onSelection:function(o){var m=o.oldValue,q=o.newValue;o=this.view;var w=o.getModel(),u;u=this._matchingBracket;if(u!==undefined){if(w.getBaseModel)u=w.mapOffset(u,true);u=w.getLineAtOffset(u);o.redrawLines(u,u+1);this._matchingBracket=
this._currentBracket=undefined}if(this.highlightCaretLine){var x=w.getLineAtOffset(m.start);u=w.getLineAtOffset(q.start);var B=q.start===q.end;m=m.start===m.end;if(!(x===u&&m&&B)){m&&o.redrawLines(x,x+1);if((x!==u||!m)&&B)o.redrawLines(u,u+1)}}if(!(q.start!==q.end||q.start===0)){q=o.getCaretOffset()-1;if(!(q<0)){m=q;if(w.getBaseModel)m=w.mapOffset(q);u=this._findMatchingBracket(w,m);if(u!==-1){this._currentBracket=m;this._matchingBracket=u;if(w.getBaseModel)u=w.mapOffset(u,true);u=w.getLineAtOffset(u);
o.redrawLines(u,u+1)}}}},_onModelChanged:function(o){var m=o.start,q=o.removedCharCount,w=o.addedCharCount-q;if(this._matchingBracket&&m<this._matchingBracket)this._matchingBracket+=w;if(this._currentBracket&&m<this._currentBracket)this._currentBracket+=w;var u=this.view;o=u.getModel();var x=o.getBaseModel?o.getBaseModel():o;q=m+q;var B=x.getCharCount(),C=this.comments.length,D=x.getLineStart(x.getLineAtOffset(m)),F=this._binarySearch(this.comments,D,true),J=this._binarySearch(this.comments,q,false,
F-1,C);if(F<C&&this.comments[F].start<=D&&D<this.comments[F].end){D=this.comments[F].start;if(D>m)D+=w}else D=D;var K;if(J<C){K=this.comments[J].end;if(K>m)K+=w;J+=1}else{J=C;K=B}var L;B=this._findComments(x.getText(D,K),D);for(C=F;C<this.comments.length;C++){L=this.comments[C];if(L.start>m)L.start+=w;if(L.start>m)L.end+=w}var R=J-F!==B.length;if(!R)for(C=0;C<B.length;C++){L=this.comments[F+C];var T=B[C];if(L.start!==T.start||L.end!==T.end||L.type!==T.type){R=true;break}}C=[F,J-F].concat(B);Array.prototype.splice.apply(this.comments,
C);if(R){C=D;L=K;if(o!==x){C=o.mapOffset(C,true);L=o.mapOffset(L,true)}u.redrawRange(C,L)}if(this.foldingEnabled&&x!==o&&this.annotationModel){u=this.annotationModel;F=u.getAnnotations(D,K);D=[];for(K=[];F.hasNext();){L=F.next();if(L.type==="orion.annotation.folding"){K.push(L);for(C=0;C<B.length;C++)if(L.start===B[C].start&&L.end===B[C].end)break;if(C===B.length){D.push(L);L.expand()}else{C=L.start;J=L.end;if(C>m)C-=w;if(J>m)J-=w;if(C<=m&&m<J&&C<=q&&q<J){C=x.getLineAtOffset(L.start);J=x.getLineAtOffset(L.end);
if(C!==J){if(!L.expanded){L.expand();u.modifyAnnotation(L)}}else u.removeAnnotation(L)}}}}m=[];for(C=0;C<B.length;C++){L=B[C];for(w=0;w<K.length;w++)if(K[w].start===L.start&&K[w].end===L.end)break;if(w===K.length)(L=this._createFoldingAnnotation(o,x,L.start,L.end))&&m.push(L)}u.replaceAnnotations(D,m)}}};return d}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("examples/textview/textStyler",[],function(){return examples.textview});orion=orion||{};
orion.textview=orion.textview||{};
orion.textview.TextModel=function(){function d(a,c){this._listeners=[];this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(a);this.setLineDelimiter(c)}var b=window.navigator.platform.indexOf("Win")!==-1;d.prototype={addListener:function(a){this._listeners.push(a)},removeListener:function(a){for(var c=0;c<this._listeners.length;c++)if(this._listeners[c]===a){this._listeners.splice(c,1);return}},getCharCount:function(){for(var a=0,c=0;c<this._text.length;c++)a+=this._text[c].length;
return a},getLine:function(a,c){var e=this.getLineCount();if(!(0<=a&&a<e))return null;var f=this._lineOffsets[a];if(a+1<e){a=this.getText(f,this._lineOffsets[a+1]);if(c)return a;c=a.length;for(var g;(g=a.charCodeAt(c-1))===10||g===13;)c--;return a.substring(0,c)}else return this.getText(f)},getLineAtOffset:function(a){var c=this.getCharCount();if(!(0<=a&&a<=c))return-1;var e=this.getLineCount();if(a===c)return e-1;var f,g,i=this._lastLineIndex;if(0<=i&&i<e){f=this._lineOffsets[i];g=i+1<e?this._lineOffsets[i+
1]:c;if(f<=a&&a<g)return i}for(var j=e,h=-1;j-h>1;){i=Math.floor((j+h)/2);f=this._lineOffsets[i];g=i+1<e?this._lineOffsets[i+1]:c;if(a<=f)j=i;else if(a<g){j=i;break}else h=i}return this._lastLineIndex=j},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(a,c){var e=this.getLineCount();if(!(0<=a&&a<e))return-1;if(a+1<e){e=this._lineOffsets[a+1];if(c)return e;a=this.getText(Math.max(this._lineOffsets[a],e-2),e);c=a.length;
for(var f;(f=a.charCodeAt(c-1))===10||f===13;)c--;return e-(a.length-c)}else return this.getCharCount()},getLineStart:function(a){if(!(0<=a&&a<this.getLineCount()))return-1;return this._lineOffsets[a]},getText:function(a,c){if(a===undefined)a=0;if(c===undefined)c=this.getCharCount();if(a===c)return"";for(var e=0,f=0,g;f<this._text.length;){g=this._text[f].length;if(a<=e+g)break;e+=g;f++}for(var i=e,j=f;f<this._text.length;){g=this._text[f].length;if(c<=e+g)break;e+=g;f++}e=e;f=f;if(j===f)return this._text[j].substring(a-
i,c-e);a=this._text[j].substring(a-i);c=this._text[f].substring(0,c-e);return a+this._text.slice(j+1,f).join("")+c},onChanging:function(a){for(var c=0;c<this._listeners.length;c++){var e=this._listeners[c];e&&e.onChanging&&e.onChanging(a)}},onChanged:function(a){for(var c=0;c<this._listeners.length;c++){var e=this._listeners[c];e&&e.onChanged&&e.onChanged(a)}},setLineDelimiter:function(a){if(a==="auto"){a=undefined;if(this.getLineCount()>1)a=this.getText(this.getLineEnd(0),this.getLineEnd(0,true))}this._lineDelimiter=
a?a:b?"\r\n":"\n"},setText:function(a,c,e){if(a===undefined)a="";if(c===undefined)c=0;if(e===undefined)e=this.getCharCount();for(var f=this.getLineAtOffset(c),g=this.getLineAtOffset(e),i=c,j=e-c,h=g-f,l=a.length,p=0,t=this.getLineCount(),r=0,s=0,v=0,z=[];;){if(r!==-1&&r<=v)r=a.indexOf("\r",v);if(s!==-1&&s<=v)s=a.indexOf("\n",v);if(s===-1&&r===-1)break;v=r!==-1&&s!==-1?r+1===s?s+1:(r<s?r:s)+1:r!==-1?r+1:s+1;z.push(c+v);p++}this.onChanging({text:a,start:i,removedCharCount:j,addedCharCount:l,removedLineCount:h,
addedLineCount:p});if(z.length===0){r=this.getLineStart(f);g=g+1<t?this.getLineStart(g+1):this.getCharCount();if(c!==r){a=this.getText(r,c)+a;c=r}if(e!==g){a+=this.getText(e,g);e=g}}g=l-j;for(r=f+h+1;r<t;r++)this._lineOffsets[r]+=g;f=[f+1,h].concat(z);Array.prototype.splice.apply(this._lineOffsets,f);for(g=z=0;g<this._text.length;){r=this._text[g].length;if(c<=z+r)break;z+=r;g++}t=z;for(f=g;g<this._text.length;){r=this._text[g].length;if(e<=z+r)break;z+=r;g++}z=z;g=g;r=this._text[g];c=this._text[f].substring(0,
c-t);e=r.substring(e-z);f=[f,g-f+1];c&&f.push(c);a&&f.push(a);e&&f.push(e);Array.prototype.splice.apply(this._text,f);if(this._text.length===0)this._text=[""];this.onChanged({start:i,removedCharCount:j,addedCharCount:l,removedLineCount:h,addedLineCount:p})}};return d}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/textview/textModel",[],function(){return orion.textview});orion=orion||{};orion.textview=orion.textview||{};
orion.textview.TextView=function(){function d(k,n,o,m){typeof k.addEventListener==="function"?k.addEventListener(n,o,m===true):k.attachEvent("on"+n,o)}function b(k,n,o,m){typeof k.removeEventListener==="function"?k.removeEventListener(n,o,m===true):k.detachEvent("on"+n,o)}function a(k){this._init(k)}var c=document.selection&&window.ActiveXObject&&/MSIE/.test(navigator.userAgent)?document.documentMode:undefined,e=parseFloat(navigator.userAgent.split("Firefox/")[1]||navigator.userAgent.split("Minefield/")[1])||
undefined,f=navigator.userAgent.indexOf("Opera")!==-1,g=navigator.userAgent.indexOf("Chrome")!==-1,i=navigator.userAgent.indexOf("Safari")!==-1,j=navigator.userAgent.indexOf("WebKit")!==-1,h=navigator.userAgent.indexOf("iPad")!==-1,l=navigator.platform.indexOf("Mac")!==-1,p=navigator.platform.indexOf("Win")!==-1,t=navigator.platform.indexOf("Linux")!==-1,r=typeof window.document.documentElement.addEventListener==="function",s=(!c||c>=9)&&typeof window.document.createRange().getBoundingClientRect===
"function",v=p?"\r\n":"\n",z=function(){function k(n,o,m){this.start=n;this.end=o;this.caret=m}k.prototype={clone:function(){return new k(this.start,this.end,this.caret)},collapse:function(){if(this.caret)this.end=this.start;else this.start=this.end},extend:function(n){if(this.caret)this.start=n;else this.end=n;if(this.start>this.end){n=this.start;this.start=this.end;this.end=n;this.caret=!this.caret}},setCaret:function(n){this.end=this.start=n;this.caret=false},getCaret:function(){return this.caret?
this.start:this.end},toString:function(){return"start="+this.start+" end="+this.end+(this.caret?" caret is at start":" caret is at end")},isEmpty:function(){return this.start===this.end},equals:function(n){return this.caret===n.caret&&this.start===n.start&&this.end===n.end}};return k}(),y=function(){function k(){this._types={}}k.prototype={addEventListener:function(n,o,m,q){var w=this._types[n];w||(w=this._types[n]={level:0,listeners:[]});w.listeners.push({context:o,func:m,data:q})},sendEvent:function(n,
o){if(n=this._types[n]){var m=n.listeners;try{n.level++;if(m)for(var q=0,w=m.length;q<w;q++){var u=m[q];u&&u.context&&u.func&&u.func.call(u.context,o,u.data)}}finally{n.level--;if(n.compact&&n.level===0){for(o=m.length-1;o>=0;o--)m[o]||m.splice(o,1);n.compact=false}}}},removeEventListener:function(n,o,m,q){if(n=this._types[n])for(var w=n.listeners,u=0,x=w.length;u<x;u++){var B=w[u];if(B&&B.context===o&&B.func===m&&B.data===q){if(n.level!==0){w[u]=null;n.compact=true}else w.splice(u,1);break}}}};return k}();
a.prototype={addEventListener:function(k,n,o,m){this._eventTable.addEventListener(k,n,o,m)},addRuler:function(k){this._rulers.push(k);k.setView(this);this._createRuler(k);this._updatePage()},computeSize:function(){var k=0,n=0,o=this._model,m=this._clientDiv,q=m.style.width;if(j)m.style.width=(524287).toString()+"px";for(var w=o.getLineCount(),u=this._frameDocument,x=0;x<w;x++){var B=this._getLineNode(x),C=null;if(!B||B.lineChanged)B=C=this._createLine(m,null,u,x,o);B=this._getLineBoundingClientRect(B);
k=Math.max(k,B.right-B.left);n+=B.bottom-B.top;C&&m.removeChild(C)}if(j)m.style.width=q;o=this._getViewPadding();k+=o.right-o.left;n+=o.bottom-o.top;return{width:k,height:n}},convert:function(k,n,o){var m=this._getScroll(),q=this._getViewPadding(),w=this._frame.getBoundingClientRect(),u=this._viewDiv.getBoundingClientRect();switch(n){case "document":if(k.x!==undefined)k.x+=-m.x+u.left+q.left;if(k.y!==undefined)k.y+=-m.y+u.top+q.top;break;case "page":if(k.x!==undefined)k.x+=-w.left;if(k.y!==undefined)k.y+=
-w.top;break}switch(o){case "document":if(k.x!==undefined)k.x+=m.x-u.left-q.left;if(k.y!==undefined)k.y+=m.y-u.top-q.top;break;case "page":if(k.x!==undefined)k.x+=w.left;if(k.y!==undefined)k.y+=w.top;break}return k},destroy:function(){for(var k=0;k<this._rulers.length;k++)this._rulers[k].setView(null);this.rulers=null;this._destroyFrame();this.onDestroy({});this._actions=this._keyBindings=this._eventTable=this._doubleClickSelection=this._selection=this._model=this._parentDocument=this._parent=null},
focus:function(){if(this._clientDiv){this._updateDOMSelection();if(h)this._textArea.focus();else{f&&this._clientDiv.blur();this._clientDiv.focus()}this._updateDOMSelection()}},getActions:function(k){for(var n=[],o=this._actions,m=0;m<o.length;m++)!k&&o[m].defaultHandler||n.push(o[m].name);return n},getBottomIndex:function(k){return this._getBottomIndex(k)},getBottomPixel:function(){return this._getScroll().y+this._getClientHeight()},getCaretOffset:function(){return this._getSelection().getCaret()},
getClientArea:function(){var k=this._getScroll();return{x:k.x,y:k.y,width:this._getClientWidth(),height:this._getClientHeight()}},getHorizontalPixel:function(){return this._getScroll().x},getKeyBindings:function(k){for(var n=[],o=this._keyBindings,m=0;m<o.length;m++)o[m].name===k&&n.push(o[m].keyBinding);return n},getLineHeight:function(){return this._getLineHeight()},getLinePixel:function(k){k=Math.min(Math.max(0,k),this._model.getLineCount());return this._getLineHeight()*k},getLocationAtOffset:function(k){var n=
this._model;k=Math.min(Math.max(0,k),n.getCharCount());n=n.getLineAtOffset(k);var o=this._getScroll(),m=this._viewDiv.getBoundingClientRect(),q=this._getViewPadding();k=this._getOffsetToX(k)+o.x-m.left-q.left;n=this.getLinePixel(n);return{x:k,y:n}},getModel:function(){return this._model},getOffsetAtLocation:function(k,n){var o=this._getScroll(),m=this._viewDiv.getBoundingClientRect(),q=this._getViewPadding();n=this._getYToLine(n-o.y);k+=-o.x+m.left+q.left;return this._getXToOffset(n,k)},getRulers:function(){return this._rulers.slice(0)},
getSelection:function(){var k=this._getSelection();return{start:k.start,end:k.end}},getText:function(k,n){return this._model.getText(k,n)},getTopIndex:function(k){return this._getTopIndex(k)},getTopPixel:function(){return this._getScroll().y},invokeAction:function(k,n){for(var o=this._actions,m=0;m<o.length;m++){var q=o[m];if(q.name&&q.name===k){if(!n&&q.userHandler)if(q.userHandler())return;if(q.defaultHandler)return q.defaultHandler();return false}}return false},onContextMenu:function(k){this._eventTable.sendEvent("ContextMenu",
k)},onDestroy:function(k){this._eventTable.sendEvent("Destroy",k)},onLineStyle:function(k){this._eventTable.sendEvent("LineStyle",k)},onModelChanged:function(k){this._eventTable.sendEvent("ModelChanged",k)},onModelChanging:function(k){this._eventTable.sendEvent("ModelChanging",k)},onModify:function(k){this._eventTable.sendEvent("Modify",k)},onSelection:function(k){this._eventTable.sendEvent("Selection",k)},onScroll:function(k){this._eventTable.sendEvent("Scroll",k)},onVerify:function(k){this._eventTable.sendEvent("Verify",
k)},redrawLines:function(k,n,o){if(!(this._redrawCount>0)){if(k===undefined)k=0;if(n===undefined)n=this._model.getLineCount();if(k!==n){var m=this._clientDiv;if(m){if(o)for(var q=(o.getLocation()==="left"?this._leftDiv:this._rightDiv).firstChild.rows[0].cells,w=0;w<q.length;w++)if(q[w].firstChild._ruler===o){m=q[w].firstChild;break}if(o)m.rulerChanged=true;if(!o||o.getOverview()==="page")for(m=m.firstChild;m;){q=m.lineIndex;if(k<=q&&q<n)m.lineChanged=true;m=m.nextSibling}if(!o)if(k<=this._maxLineIndex&&
this._maxLineIndex<n){this._checkMaxLineIndex=this._maxLineIndex;this._maxLineIndex=-1;this._maxLineWidth=0}this._queueUpdatePage()}}}},redrawRange:function(k,n){var o=this._model;if(k===undefined)k=0;if(n===undefined)n=o.getCharCount();if(k!==n){k=o.getLineAtOffset(k);n=o.getLineAtOffset(Math.max(0,n-1))+1;this.redrawLines(k,n)}},removeEventListener:function(k,n,o,m){this._eventTable.removeEventListener(k,n,o,m)},removeRuler:function(k){for(var n=this._rulers,o=0;o<n.length;o++)if(n[o]===k){n.splice(o,
1);k.setView(null);this._destroyRuler(k);this._updatePage();break}},setAction:function(k,n){if(k){for(var o=this._actions,m=0;m<o.length;m++){var q=o[m];if(q.name===k){q.userHandler=n;return}}o.push({name:k,userHandler:n})}},setKeyBinding:function(k,n){for(var o=this._keyBindings,m=0;m<o.length;m++){var q=o[m];if(q.keyBinding.equals(k)){if(n)q.name=n;else if(q.predefined)q.name=null;else{k=q.name;o.splice(m,1);for(m=0;m<o.length&&k!==o[m].name;)m++;if(m===o.length){o=this._actions;for(m=0;m<o.length;m++)if(o[m].name===
k)o[m].defaultHandler||o.splice(m,1)}}return}}n&&o.push({keyBinding:k,name:n})},setCaretOffset:function(k,n){var o=this._model.getCharCount();k=Math.max(0,Math.min(k,o));this._setSelection(new z(k,k,false),n===undefined||n)},setHorizontalPixel:function(k){k=Math.max(0,k);this._scrollView(k-this._getScroll().x,0)},setRedraw:function(k){if(k){if(--this._redrawCount===0){k=this._model.getLineCount();for(var n=this.getRulers(),o=0;o<n.length;o++)this.redrawLines(0,k,n[o]);this.redrawLines(0,k);this._queueUpdatePage()}}else this._redrawCount++},
setModel:function(k){if(k)if(k!==this._model){this._model.removeListener(this._modelListener);var n=this._model.getLineCount(),o=this._model.getCharCount(),m=k.getLineCount(),q=k.getCharCount(),w={text:k.getText(),start:0,removedCharCount:o,addedCharCount:q,removedLineCount:n,addedLineCount:m};this.onModelChanging(w);this._model=k;w={start:0,removedCharCount:o,addedCharCount:q,removedLineCount:n,addedLineCount:m};this.onModelChanged(w);this._model.addListener(this._modelListener);this._reset();this._updatePage()}},
setSelection:function(k,n,o){var m=k>n;if(m){var q=k;k=n;n=q}q=this._model.getCharCount();k=Math.max(0,Math.min(k,q));n=Math.max(0,Math.min(n,q));this._setSelection(new z(k,n,m),o===undefined||o)},setText:function(k,n,o){var m=n===undefined&&o===undefined;if(n===undefined)n=0;if(o===undefined)o=this._model.getCharCount();this._modifyContent({text:k,start:n,end:o,_code:true},!m);if(m){this._columnX=-1;this._setSelection(new z(0,0,false),true);if(e)if(k=this._clientDiv){(n=this._hasFocus)&&k.blur();
k.contentEditable=false;k.contentEditable=true;n&&k.focus()}}},setTopIndex:function(k){var n=this._model;if(n.getCharCount()!==0){n=n.getLineCount();var o=this._getLineHeight(),m=Math.max(1,Math.min(n,Math.floor(this._getClientHeight()/o)));if(k<0)k=0;else if(k>n-m)k=n-m;this._scrollView(0,k*o-this._getScroll().y)}},setTopPixel:function(k){var n=this._getLineHeight(),o=this._getClientHeight(),m=this._model.getLineCount();k=Math.min(Math.max(0,k),n*m-o);this._scrollView(0,k-this._getScroll().y)},showSelection:function(){return this._showCaret(true)},
_handleBodyMouseDown:function(k){if(!k)k=window.event;for(var n=f?this._clientDiv:this._overlayDiv||this._viewDiv,o=k.target?k.target:k.srcElement;o;){if(n===o)return;o=o.parentNode}k.preventDefault&&k.preventDefault();k.stopPropagation&&k.stopPropagation();if(!r){n.setCapture();setTimeout(function(){n.releaseCapture()},0)}},_handleBlur:function(){this._hasFocus=false;if(c<9)if(!this._getSelection().isEmpty()){var k=this._frameDocument,n=k.createElement("DIV");k=k.body;k.appendChild(n);k.removeChild(n)}if(e||
c)if(this._selDiv1){n=c?"transparent":"#AFAFAF";this._selDiv1.style.background=n;this._selDiv2.style.background=n;this._selDiv3.style.background=n}},_handleContextMenu:function(k){if(!k)k=window.event;var n=this._getScroll(),o=this._viewDiv.getBoundingClientRect(),m=this._getViewPadding();this.onContextMenu({x:k.clientX+n.x-o.left-m.left,y:k.clientY+n.y-o.top-m.top,screenX:k.screenX,screenY:k.screenY});k.preventDefault&&k.preventDefault();return false},_handleCopy:function(k){if(!this._ignoreCopy){if(!k)k=
window.event;if(this._doCopy(k)){k.preventDefault&&k.preventDefault();return false}}},_handleCut:function(k){if(!k)k=window.event;if(this._doCut(k)){k.preventDefault&&k.preventDefault();return false}},_handleDOMAttrModified:function(k){if(!k)k=window.event;for(var n=false,o=this._parent;o;){if(o===k.target){n=true;break}o=o.parentNode}if(n){k=this._getVisible();if(k==="visible")this._createView();else k==="hidden"&&this._destroyView()}},_handleDataModified:function(){this._startIME()},_handleDblclick:function(k){if(!k)k=
window.event;this._lastMouseTime=k.timeStamp?k.timeStamp:(new Date).getTime();if(this._clickCount!==2){this._clickCount=2;this._handleMouse(k)}},_handleDragStart:function(k){if(!k)k=window.event;k.preventDefault&&k.preventDefault();return false},_handleDragOver:function(k){if(!k)k=window.event;k.dataTransfer.dropEffect="none";k.preventDefault&&k.preventDefault();return false},_handleDrop:function(k){if(!k)k=window.event;k.preventDefault&&k.preventDefault();return false},_handleDocFocus:function(){this._clientDiv.focus()},
_handleFocus:function(){this._hasFocus=true;c&&this._updateDOMSelection();if(e||c)if(this._selDiv1){var k=this._hightlightRGB;this._selDiv1.style.background=k;this._selDiv2.style.background=k;this._selDiv3.style.background=k}},_handleKeyDown:function(k){if(!k)k=window.event;if(h){if(k.keyCode===8){this._doBackspace({});k.preventDefault()}}else{switch(k.keyCode){case 16:case 17:case 18:case 91:break;default:this._setLinksVisible(false)}if(k.keyCode===229){if(this.readonly){k.preventDefault&&k.preventDefault();
return false}this._startIME()}else this._commitIME();if((l||t)&&e<4||f){this._keyDownEvent=k;return true}if(this._doAction(k)){if(k.preventDefault)k.preventDefault();else{k.cancelBubble=true;k.returnValue=false;k.keyCode=0}return false}}},_handleKeyPress:function(k){if(!k)k=window.event;if(l&&j)if(63232<=k.keyCode&&k.keyCode<=63487||k.keyCode===13||k.keyCode===8){k.preventDefault&&k.preventDefault();return false}if((l||t)&&e<4||f)if(this._doAction(this._keyDownEvent)){k.preventDefault&&k.preventDefault();
return false}var n=l?k.metaKey:k.ctrlKey;if(k.charCode!==undefined)if(n)switch(k.charCode){case 99:case 118:case 120:return true}n=false;if(l){if(k.ctrlKey||k.metaKey)n=true}else if(e){if(k.ctrlKey||k.altKey)n=true}else if(k.ctrlKey^k.altKey)n=true;if(!n){n=f?k.which:k.charCode!==undefined?k.charCode:k.keyCode;if(n>31){this._doContent(String.fromCharCode(n));k.preventDefault&&k.preventDefault();return false}}},_handleKeyUp:function(k){if(!k)k=window.event;(l?k.metaKey:k.ctrlKey)||this._setLinksVisible(false);
k.keyCode===13&&this._commitIME()},_handleLinkClick:function(k){if(!k)k=window.event;if(!(l?k.metaKey:k.ctrlKey)){k.preventDefault&&k.preventDefault();return false}},_handleLoad:function(k){var n=this._getVisible();if(n==="visible"||n==="hidden"&&j)this._createView(!k)},_handleMouse:function(k){var n=this._frameWindow;if(c)n=this._clientDiv;if(this._overlayDiv){var o=this;setTimeout(function(){o.focus()},0)}if(this._clickCount===1){this._setGrab(n);this._setSelectionTo(k.clientX,k.clientY,k.shiftKey)}else{r&&
this._setGrab(n);this._doubleClickSelection=null;this._setSelectionTo(k.clientX,k.clientY,k.shiftKey);this._doubleClickSelection=this._getSelection()}},_handleMouseDown:function(k){if(!k)k=window.event;if(this._linksVisible)if((k.target||k.srcElement).tagName!=="A")this._setLinksVisible(false);else return;var n=k.which?k.button===0:k.button===1;this._commitIME();if(n){this._isMouseDown=true;n=Math.abs(this._lastMouseX-k.clientX);var o=Math.abs(this._lastMouseY-k.clientY),m=k.timeStamp?k.timeStamp:
(new Date).getTime();if(m-this._lastMouseTime<=this._clickTime&&n<=this._clickDist&&o<=this._clickDist)this._clickCount++;else this._clickCount=1;this._lastMouseX=k.clientX;this._lastMouseY=k.clientY;this._lastMouseTime=m;this._handleMouse(k);if(f||g){this._hasFocus||this.focus();k.preventDefault()}}},_handleMouseMove:function(k){if(!k)k=window.event;this._setLinksVisible(!this._isMouseDown&&(l?k.metaKey:k.ctrlKey));if(this._isMouseDown){if(!r){if(k.button===0){this._setGrab(null);return true}if(!this._isMouseDown&&
k.button===1&&(this._clickCount&1)!==0){this._clickCount=2;return this._handleMouse(k,this._clickCount)}}var n=k.clientX,o=k.clientY;if(g)if(k.currentTarget!==this._frameWindow){k=this._frame.getBoundingClientRect();n-=k.left;o-=k.top}var m=this._getViewPadding(),q=this._viewDiv.getBoundingClientRect(),w=this._getClientWidth(),u=this._getClientHeight();k=q.left+m.left;var x=q.top+m.top;w=q.left+m.left+w;m=q.top+m.top+u;q=this._model;u=q.getLineAtOffset(this._getSelection().getCaret());if(o<x&&u!==
0)this._doAutoScroll("up",n,o-x);else if(o>m&&u!==q.getLineCount()-1)this._doAutoScroll("down",n,o-m);else if(n<k)this._doAutoScroll("left",n-k,o);else if(n>w)this._doAutoScroll("right",n-w,o);else{this._endAutoScroll();this._setSelectionTo(n,o,true);c&&this._frameDocument.body.getBoundingClientRect()}}},_handleMouseUp:function(k){if(!k)k=window.event;if(!this._linksVisible)if(k.which?k.button===0:k.button===1){this._isMouseDown=false;this._endAutoScroll();r&&this._setGrab(null)}},_handleMouseWheel:function(k){if(!k)k=
window.event;var n=this._getLineHeight(),o=0,m=0;if(e){n=l?k.detail*3:Math.max(-256,Math.min(256,k.detail))*n;if(k.axis===k.HORIZONTAL_AXIS)o=n;else m=n}else if(l){m=o=40;if(k.wheelDeltaX%120!==0)o=1;if(k.wheelDeltaY%120!==0)m=1;o=-k.wheelDeltaX/o;if(-1<o&&o<0)o=-1;if(0<o&&o<1)o=1;m=-k.wheelDeltaY/m;if(-1<m&&m<0)m=-1;if(0<m&&m<1)m=1}else{o=-k.wheelDeltaX;m=-k.wheelDeltaY/120*8*n}if(i){for(n=k.target;n&&n.lineIndex===undefined;)n=n.parentNode;this._mouseWheelLine=n}n=this._getScroll();this._scrollView(o,
m);o=this._getScroll();if(i)this._mouseWheelLine=null;if(n.x!==o.x||n.y!==o.y){k.preventDefault&&k.preventDefault();return false}},_handlePaste:function(k){if(!this._ignorePaste){if(!k)k=window.event;if(this._doPaste(k)){if(c){var n=this;setTimeout(function(){n._updateDOMSelection()},0)}k.preventDefault&&k.preventDefault();return false}}},_handleResize:function(){var k=this._frameDocument.documentElement,n=k.clientWidth;k=k.clientHeight;if(this._frameWidth!==n||this._frameHeight!==k){this._frameWidth=
n;this._frameHeight=k;this._updatePage()}},_handleRulerEvent:function(k){if(!k)k=window.event;var n=k.target?k.target:k.srcElement,o=n.lineIndex;for(n=n;n&&!n._ruler;){if(o===undefined&&n.lineIndex!==undefined)o=n.lineIndex;n=n.parentNode}n=n?n._ruler:null;if(o===undefined&&n&&n.getOverview()==="document"){o=h?0:17;var m=this._getClientHeight(),q=this._model.getLineCount(),w=this._getViewPadding();o=Math.floor((k.clientY-o)*q/(m+w.top+w.bottom-2*o));0<=o&&o<q||(o=undefined)}if(n)switch(k.type){case "click":n.onClick&&
n.onClick(o,k);break;case "dblclick":n.onDblClick&&n.onDblClick(o,k);break;case "mousemove":n.onMouseMove&&n.onMouseMove(o,k);break;case "mouseover":n.onMouseOver&&n.onMouseOver(o,k);break;case "mouseout":n.onMouseOut&&n.onMouseOut(o,k);break}},_handleScroll:function(){var k=this._getScroll(),n=this._hScroll,o=this._vScroll;if(n!==k.x||o!==k.y){this._hScroll=k.x;this._vScroll=k.y;this._commitIME();this._updatePage();this.onScroll({oldValue:{x:n,y:o},newValue:k})}},_handleSelectStart:function(k){if(!k)k=
window.event;if(this._ignoreSelect){k&&k.preventDefault&&k.preventDefault();return false}},_handleUnload:function(){this._destroyView()},_handleInput:function(k){var n=this._textArea;this._doContent(n.value);n.selectionStart=n.selectionEnd=0;n.value="";k.preventDefault()},_handleTextInput:function(k){this._doContent(k.data);k.preventDefault()},_touchConvert:function(k){var n=this._frame.getBoundingClientRect(),o=this._parentDocument.body;return{left:k.clientX-n.left-o.scrollLeft,top:k.clientY-n.top-
o.scrollTop}},_handleTextAreaClick:function(k){k=this._touchConvert(k);this._clickCount=1;this._ignoreDOMSelection=false;this._setSelectionTo(k.left,k.top,false);this._textArea.focus()},_handleTouchStart:function(k){var n=k.touches,o,m;this._touchMoved=false;this._touchStartScroll=undefined;if(n.length===1){o=n[0];m=o.pageY;this._touchStartX=o.pageX;this._touchStartY=m;this._touchStartTime=k.timeStamp;this._touchStartScroll=this._getScroll();k=this._getSelection();m=this._touchConvert(n[0]);this._touchGesture=
"none";if(!k.isEmpty())if(this._hitOffset(k.end,m.left,m.top))this._touchGesture="extendEnd";else if(this._hitOffset(k.start,m.left,m.top))this._touchGesture="extendStart";if(this._touchGesture==="none"){n=this._textArea;n.value="";n.style.left="-1000px";n.style.top="-1000px";n.style.width="3000px";n.style.height="3000px"}}else if(n.length===2){this._touchGesture="select";if(this._touchTimeout){clearTimeout(this._touchTimeout);this._touchTimeout=null}m=this._touchConvert(n[0]);o=this._getXToOffset(this._getYToLine(m.top),
m.left);m=this._touchConvert(n[1]);n=this._getXToOffset(this._getYToLine(m.top),m.left);k=this._getSelection();k.setCaret(o);k.extend(n);this._setSelection(k,true,true)}},_handleTouchMove:function(k){this._touchMoved=true;var n=k.touches,o;if(n.length===1){n=n[0];var m=n.pageX,q=n.pageY,w=this._touchStartX-m,u=this._touchStartY-q;o=this._touchConvert(n);n=this._getSelection();if(this._touchGesture==="none")this._touchGesture=k.timeStamp-this._touchStartTime<200&&(Math.abs(w)>5||Math.abs(u)>5)?"scroll":
"caret";if(this._touchGesture==="select")this._touchGesture=this._hitOffset(n.end,o.left,o.top)?"extendEnd":this._hitOffset(n.start,o.left,o.top)?"extendStart":"caret";switch(this._touchGesture){case "scroll":this._touchStartX=m;this._touchStartY=q;this._scrollView(w,u);break;case "extendStart":case "extendEnd":this._clickCount=1;o=this._getXToOffset(this._getYToLine(o.top),o.left);n.setCaret(this._touchGesture==="extendStart"?n.end:n.start);n.extend(o);if(o>=n.end&&this._touchGesture==="extendStart")this._touchGesture=
"extendEnd";if(o<=n.start&&this._touchGesture==="extendEnd")this._touchGesture="extendStart";this._setSelection(n,true,true);break;case "caret":this._setSelectionTo(o.left,o.top,false);break}}else if(n.length===2){o=this._touchConvert(n[0]);m=this._getXToOffset(this._getYToLine(o.top),o.left);o=this._touchConvert(n[1]);o=this._getXToOffset(this._getYToLine(o.top),o.left);n=this._getSelection();n.setCaret(m);n.extend(o);this._setSelection(n,true,true)}k.preventDefault()},_handleTouchEnd:function(k){var n=
this;if(!this._touchMoved)if(k.touches.length===0&&k.changedTouches.length===1){var o=this._touchConvert(k.changedTouches[0]),m=this._textArea;m.value="";m.style.left="-1000px";m.style.top="-1000px";m.style.width="3000px";m.style.height="3000px";setTimeout(function(){n._clickCount=1;n._ignoreDOMSelection=false;n._setSelectionTo(o.left,o.top,false)},300)}k.touches.length===0&&setTimeout(function(){var q=n._getSelection(),w=n._model.getText(q.start,q.end),u=n._textArea;u.value=w;u.selectionStart=0;
u.selectionEnd=w.length;if(!q.isEmpty()){w=n._touchDiv.getBoundingClientRect();q=n._getOffsetBounds(q.start);u.style.left=w.width/2+"px";u.style.top=(q.top>40?q.top-30:q.top+30)+"px"}},0)},_doAction:function(k){for(var n=this._keyBindings,o=0;o<n.length;o++){var m=n[o];if(m.keyBinding.match(k)){if(m.name){k=this._actions;for(n=0;n<k.length;n++){o=k[n];if(o.name===m.name){if(o.userHandler){if(!o.userHandler())if(o.defaultHandler)o.defaultHandler();else return false}else o.defaultHandler&&o.defaultHandler();
break}}}return true}}return false},_doBackspace:function(k){var n=this._getSelection();if(n.isEmpty()){var o=this._model,m=n.getCaret(),q=o.getLineAtOffset(m);if(m===o.getLineStart(q))q>0&&n.extend(o.getLineEnd(q-1));else n.extend(this._getOffset(m,k.unit,-1))}this._modifyContent({text:"",start:n.start,end:n.end},true);return true},_doContent:function(k){var n=this._getSelection();this._modifyContent({text:k,start:n.start,end:n.end,_ignoreDOMSelection:true},true)},_doCopy:function(k){var n=this._getSelection();
if(!n.isEmpty())return this._setClipboardText(this._getBaseText(n.start,n.end),k);return true},_doCursorNext:function(k){if(!k.select)if(this._clearSelection("next"))return true;var n=this._model,o=this._getSelection(),m=o.getCaret(),q=n.getLineAtOffset(m);if(m===n.getLineEnd(q))q+1<n.getLineCount()&&o.extend(n.getLineStart(q+1));else o.extend(this._getOffset(m,k.unit,1));k.select||o.collapse();this._setSelection(o,true);return true},_doCursorPrevious:function(k){if(!k.select)if(this._clearSelection("previous"))return true;
var n=this._model,o=this._getSelection(),m=o.getCaret(),q=n.getLineAtOffset(m);if(m===n.getLineStart(q))q>0&&o.extend(n.getLineEnd(q-1));else o.extend(this._getOffset(m,k.unit,-1));k.select||o.collapse();this._setSelection(o,true);return true},_doCut:function(k){var n=this._getSelection();if(!n.isEmpty()){n=this._getBaseText(n.start,n.end);this._doContent("");return this._setClipboardText(n,k)}return true},_doDelete:function(k){var n=this._getSelection();if(n.isEmpty()){var o=this._model,m=n.getCaret(),
q=o.getLineAtOffset(m);if(m===o.getLineEnd(q))q+1<o.getLineCount()&&n.extend(o.getLineStart(q+1));else n.extend(this._getOffset(m,k.unit,1))}this._modifyContent({text:"",start:n.start,end:n.end},true);return true},_doEnd:function(k){var n=this._getSelection(),o=this._model;if(k.ctrl)n.extend(o.getCharCount());else{var m=o.getLineAtOffset(n.getCaret());n.extend(o.getLineEnd(m))}k.select||n.collapse();this._setSelection(n,true);return true},_doEnter:function(k){var n=this._model,o=this._getSelection();
this._doContent(n.getLineDelimiter());if(k&&k.noCursor){o.end=o.start;this._setSelection(o)}return true},_doHome:function(k){var n=this._getSelection(),o=this._model;if(k.ctrl)n.extend(0);else{var m=o.getLineAtOffset(n.getCaret());n.extend(o.getLineStart(m))}k.select||n.collapse();this._setSelection(n,true);return true},_doLineDown:function(k){var n=this._model,o=this._getSelection(),m=o.getCaret(),q=n.getLineAtOffset(m);if(q+1<n.getLineCount()){var w=this._getScroll().x,u=this._columnX;if(u===-1||
k.select)u=this._getOffsetToX(k.wholeLine?n.getLineEnd(q+1):m)+w;o.extend(this._getXToOffset(q+1,u-w));k.select||o.collapse();this._setSelection(o,true,true);this._columnX=u}return true},_doLineUp:function(k){var n=this._model,o=this._getSelection(),m=o.getCaret(),q=n.getLineAtOffset(m);if(q>0){var w=this._getScroll().x,u=this._columnX;if(u===-1||k.select)u=this._getOffsetToX(k.wholeLine?n.getLineStart(q-1):m)+w;o.extend(this._getXToOffset(q-1,u-w));k.select||o.collapse();this._setSelection(o,true,
true);this._columnX=u}return true},_doPageDown:function(k){var n=this._model,o=this._getSelection(),m=o.getCaret(),q=n.getLineAtOffset(m),w=n.getLineCount();if(q<w-1){n=this._getScroll();var u=this._getClientHeight(),x=this._getLineHeight(),B=Math.floor(u/x),C=Math.min(w-q-1,B);C=Math.max(1,C);B=this._columnX;if(B===-1||k.select)B=this._getOffsetToX(m)+n.x;o.extend(this._getXToOffset(q+C,B-n.x));k.select||o.collapse();k=w*x;m=n.y+C*x;if(m+u>k)m=k-u;this._setSelection(o,true,true,m-n.y);this._columnX=
B}return true},_doPageUp:function(k){var n=this._model,o=this._getSelection(),m=o.getCaret(),q=n.getLineAtOffset(m);if(q>0){n=this._getScroll();var w=this._getClientHeight(),u=this._getLineHeight();w=Math.floor(w/u);var x=Math.max(1,Math.min(q,w));w=this._columnX;if(w===-1||k.select)w=this._getOffsetToX(m)+n.x;o.extend(this._getXToOffset(q-x,w-n.x));k.select||o.collapse();k=Math.max(0,n.y-x*u);this._setSelection(o,true,true,k-n.y);this._columnX=w}return true},_doPaste:function(k){(k=this._getClipboardText(k))&&
this._doContent(k);return k!==null},_doScroll:function(k){var n=k.type,o=this._model,m=o.getLineCount();k=this._getClientHeight();var q=this._getLineHeight();m=m*q;var w=this._getScroll().y,u;switch(n){case "textStart":u=0;break;case "textEnd":u=m-k;break;case "pageDown":u=w+k;break;case "pageUp":u=w-k;break;case "centerLine":n=this._getSelection();u=o.getLineAtOffset(n.start);o=(o.getLineAtOffset(n.end)-u+1)*q;u=u*q-k/2+o/2;break}if(u!==undefined){u=Math.min(Math.max(0,u),m-k);this._scrollView(0,
u-w)}},_doSelectAll:function(){var k=this._model,n=this._getSelection();n.setCaret(0);n.extend(k.getCharCount());this._setSelection(n,false);return true},_doTab:function(){this._doContent("\t");return true},_applyStyle:function(k,n){if(k){if(k.styleClass)n.className=k.styleClass;var o=k.style;if(o)for(var m in o)if(o.hasOwnProperty(m))n.style[m]=o[m];if(k=k.attributes)for(var q in k)k.hasOwnProperty(q)&&n.setAttribute(q,k[q])}},_autoScroll:function(){var k=this._getSelection(),n,o=this._autoScrollX;
if(this._autoScrollDir==="up"||this._autoScrollDir==="down"){var m=this._autoScrollY/this._getLineHeight();m=m<0?Math.floor(m):Math.ceil(m);n=this._model.getLineAtOffset(k.getCaret());n=Math.max(0,Math.min(this._model.getLineCount()-1,n+m))}else if(this._autoScrollDir==="left"||this._autoScrollDir==="right"){n=this._getYToLine(this._autoScrollY);o+=this._getOffsetToX(k.getCaret())}k.extend(this._getXToOffset(n,o));this._setSelection(k,true)},_autoScrollTimer:function(){this._autoScroll();var k=this;
this._autoScrollTimerID=setTimeout(function(){k._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateLineHeight:function(){var k=this._clientDiv,n=this._frameDocument,o=n.createElement("DIV");o.style.position="fixed";o.style.left="-1000px";var m=n.createElement("SPAN");m.appendChild(n.createTextNode(" "));o.appendChild(m);var q=n.createElement("SPAN");q.style.fontStyle="italic";q.appendChild(n.createTextNode(" "));o.appendChild(q);var w=n.createElement("SPAN");w.style.fontWeight="bold";w.appendChild(n.createTextNode(" "));
o.appendChild(w);var u=n.createElement("SPAN");u.style.fontWeight="bold";u.style.fontStyle="italic";u.appendChild(n.createTextNode(" "));o.appendChild(u);k.appendChild(o);n=m.getBoundingClientRect();q=q.getBoundingClientRect();m=w.getBoundingClientRect();var x=u.getBoundingClientRect();u=n.bottom-n.top;w=q.bottom-q.top;n=m.bottom-m.top;q=x.bottom-x.top;m=0;x=u;if(w>u){x=w;m=1}if(n>w){x=n;m=2}if(q>n){x=q;m=3}this._largestFontStyle=m;k.removeChild(o);return x},_calculatePadding:function(){var k=this._frameDocument,
n=this._clientDiv,o=this._getPadding(this._viewDiv),m=k.createElement("DIV");m.style.position="fixed";m.style.left="-1000px";m.style.paddingLeft=o.left+"px";m.style.paddingTop=o.top+"px";m.style.paddingRight=o.right+"px";m.style.paddingBottom=o.bottom+"px";m.style.width="100px";m.style.height="100px";o=k.createElement("DIV");o.style.width="100%";o.style.height="100%";m.appendChild(o);n.appendChild(m);k=m.getBoundingClientRect();o=o.getBoundingClientRect();n.removeChild(m);return o={left:o.left-k.left,
top:o.top-k.top,right:k.right-o.right,bottom:k.bottom-o.bottom}},_clearSelection:function(k){var n=this._getSelection();if(n.isEmpty())return false;if(k==="next")n.start=n.end;else n.end=n.start;this._setSelection(n,true);return true},_commitIME:function(){if(this._imeOffset!==-1){this._scrollDiv.focus();this._clientDiv.focus();var k=this._model,n=k.getLineAtOffset(this._imeOffset),o=k.getLineStart(n),m=this._getDOMText(n);k=k.getLine(n);o=this._imeOffset-o;k=o+m.length-k.length;o!==k&&this._doContent(m.substring(o,
k));this._imeOffset=-1}},_convertDelimiter:function(k,n,o){for(var m=0,q=0,w=0,u=k.length;w<u;){if(m!==-1&&m<=w)m=k.indexOf("\r",w);if(q!==-1&&q<=w)q=k.indexOf("\n",w);var x=w,B;if(q===-1&&m===-1){n(k.substring(w));break}if(m!==-1&&q!==-1)if(m+1===q){B=m;w=q+1}else{B=m<q?m:q;w=(m<q?m:q)+1}else if(m!==-1){B=m;w=m+1}else{B=q;w=q+1}n(k.substring(x,B));o()}},_createActions:function(){var k=orion.textview.KeyBinding,n=this._keyBindings=[];n.push({name:"lineUp",keyBinding:new k(38),predefined:true});n.push({name:"lineDown",
keyBinding:new k(40),predefined:true});n.push({name:"charPrevious",keyBinding:new k(37),predefined:true});n.push({name:"charNext",keyBinding:new k(39),predefined:true});if(l){n.push({name:"scrollPageUp",keyBinding:new k(33),predefined:true});n.push({name:"scrollPageDown",keyBinding:new k(34),predefined:true});n.push({name:"pageUp",keyBinding:new k(33,null,null,true),predefined:true});n.push({name:"pageDown",keyBinding:new k(34,null,null,true),predefined:true});n.push({name:"lineStart",keyBinding:new k(37,
true),predefined:true});n.push({name:"lineEnd",keyBinding:new k(39,true),predefined:true});n.push({name:"wordPrevious",keyBinding:new k(37,null,null,true),predefined:true});n.push({name:"wordNext",keyBinding:new k(39,null,null,true),predefined:true});n.push({name:"scrollTextStart",keyBinding:new k(36),predefined:true});n.push({name:"scrollTextEnd",keyBinding:new k(35),predefined:true});n.push({name:"textStart",keyBinding:new k(38,true),predefined:true});n.push({name:"textEnd",keyBinding:new k(40,
true),predefined:true})}else{n.push({name:"pageUp",keyBinding:new k(33),predefined:true});n.push({name:"pageDown",keyBinding:new k(34),predefined:true});n.push({name:"lineStart",keyBinding:new k(36),predefined:true});n.push({name:"lineEnd",keyBinding:new k(35),predefined:true});n.push({name:"wordPrevious",keyBinding:new k(37,true),predefined:true});n.push({name:"wordNext",keyBinding:new k(39,true),predefined:true});n.push({name:"textStart",keyBinding:new k(36,true),predefined:true});n.push({name:"textEnd",
keyBinding:new k(35,true),predefined:true})}n.push({name:"selectLineUp",keyBinding:new k(38,null,true),predefined:true});n.push({name:"selectLineDown",keyBinding:new k(40,null,true),predefined:true});n.push({name:"selectCharPrevious",keyBinding:new k(37,null,true),predefined:true});n.push({name:"selectCharNext",keyBinding:new k(39,null,true),predefined:true});n.push({name:"selectPageUp",keyBinding:new k(33,null,true),predefined:true});n.push({name:"selectPageDown",keyBinding:new k(34,null,true),predefined:true});
if(l){n.push({name:"selectLineStart",keyBinding:new k(37,true,true),predefined:true});n.push({name:"selectLineEnd",keyBinding:new k(39,true,true),predefined:true});n.push({name:"selectWordPrevious",keyBinding:new k(37,null,true,true),predefined:true});n.push({name:"selectWordNext",keyBinding:new k(39,null,true,true),predefined:true});n.push({name:"selectTextStart",keyBinding:new k(36,null,true),predefined:true});n.push({name:"selectTextEnd",keyBinding:new k(35,null,true),predefined:true});n.push({name:"selectTextStart",
keyBinding:new k(38,true,true),predefined:true});n.push({name:"selectTextEnd",keyBinding:new k(40,true,true),predefined:true})}else{if(t){n.push({name:"selectWholeLineUp",keyBinding:new k(38,true,true),predefined:true});n.push({name:"selectWholeLineDown",keyBinding:new k(40,true,true),predefined:true})}n.push({name:"selectLineStart",keyBinding:new k(36,null,true),predefined:true});n.push({name:"selectLineEnd",keyBinding:new k(35,null,true),predefined:true});n.push({name:"selectWordPrevious",keyBinding:new k(37,
true,true),predefined:true});n.push({name:"selectWordNext",keyBinding:new k(39,true,true),predefined:true});n.push({name:"selectTextStart",keyBinding:new k(36,true,true),predefined:true});n.push({name:"selectTextEnd",keyBinding:new k(35,true,true),predefined:true})}n.push({name:"deletePrevious",keyBinding:new k(8),predefined:true});n.push({name:"deletePrevious",keyBinding:new k(8,null,true),predefined:true});n.push({name:"deleteNext",keyBinding:new k(46),predefined:true});n.push({name:"deleteWordPrevious",
keyBinding:new k(8,true),predefined:true});n.push({name:"deleteWordPrevious",keyBinding:new k(8,true,true),predefined:true});n.push({name:"deleteWordNext",keyBinding:new k(46,true),predefined:true});n.push({name:"tab",keyBinding:new k(9),predefined:true});n.push({name:"enter",keyBinding:new k(13),predefined:true});n.push({name:"enter",keyBinding:new k(13,null,true),predefined:true});n.push({name:"selectAll",keyBinding:new k("a",true),predefined:true});if(l){n.push({name:"deleteNext",keyBinding:new k(46,
null,true),predefined:true});n.push({name:"deleteWordPrevious",keyBinding:new k(8,null,null,true),predefined:true});n.push({name:"deleteWordNext",keyBinding:new k(46,null,null,true),predefined:true})}if(!e){var o=l&&g;n.push({name:null,keyBinding:new k("u",!o,false,false,o),predefined:true});n.push({name:null,keyBinding:new k("i",!o,false,false,o),predefined:true});n.push({name:null,keyBinding:new k("b",!o,false,false,o),predefined:true})}if(e){n.push({name:"copy",keyBinding:new k(45,true),predefined:true});
n.push({name:"paste",keyBinding:new k(45,null,true),predefined:true});n.push({name:"cut",keyBinding:new k(46,null,true),predefined:true})}if(l){n.push({name:"lineStart",keyBinding:new k("a",false,false,false,true),predefined:true});n.push({name:"lineEnd",keyBinding:new k("e",false,false,false,true),predefined:true});n.push({name:"lineUp",keyBinding:new k("p",false,false,false,true),predefined:true});n.push({name:"lineDown",keyBinding:new k("n",false,false,false,true),predefined:true});n.push({name:"charPrevious",
keyBinding:new k("b",false,false,false,true),predefined:true});n.push({name:"charNext",keyBinding:new k("f",false,false,false,true),predefined:true});n.push({name:"deletePrevious",keyBinding:new k("h",false,false,false,true),predefined:true});n.push({name:"deleteNext",keyBinding:new k("d",false,false,false,true),predefined:true});n.push({name:"deleteLineEnd",keyBinding:new k("k",false,false,false,true),predefined:true});if(e){n.push({name:"scrollPageDown",keyBinding:new k("v",false,false,false,true),
predefined:true});n.push({name:"deleteLineStart",keyBinding:new k("u",false,false,false,true),predefined:true});n.push({name:"deleteWordPrevious",keyBinding:new k("w",false,false,false,true),predefined:true})}else{n.push({name:"pageDown",keyBinding:new k("v",false,false,false,true),predefined:true});n.push({name:"centerLine",keyBinding:new k("l",false,false,false,true),predefined:true});n.push({name:"enterNoCursor",keyBinding:new k("o",false,false,false,true),predefined:true})}}var m=this;this._actions=
[{name:"lineUp",defaultHandler:function(){return m._doLineUp({select:false})}},{name:"lineDown",defaultHandler:function(){return m._doLineDown({select:false})}},{name:"lineStart",defaultHandler:function(){return m._doHome({select:false,ctrl:false})}},{name:"lineEnd",defaultHandler:function(){return m._doEnd({select:false,ctrl:false})}},{name:"charPrevious",defaultHandler:function(){return m._doCursorPrevious({select:false,unit:"character"})}},{name:"charNext",defaultHandler:function(){return m._doCursorNext({select:false,
unit:"character"})}},{name:"pageUp",defaultHandler:function(){return m._doPageUp({select:false})}},{name:"pageDown",defaultHandler:function(){return m._doPageDown({select:false})}},{name:"scrollPageUp",defaultHandler:function(){return m._doScroll({type:"pageUp"})}},{name:"scrollPageDown",defaultHandler:function(){return m._doScroll({type:"pageDown"})}},{name:"wordPrevious",defaultHandler:function(){return m._doCursorPrevious({select:false,unit:"word"})}},{name:"wordNext",defaultHandler:function(){return m._doCursorNext({select:false,
unit:"word"})}},{name:"textStart",defaultHandler:function(){return m._doHome({select:false,ctrl:true})}},{name:"textEnd",defaultHandler:function(){return m._doEnd({select:false,ctrl:true})}},{name:"scrollTextStart",defaultHandler:function(){return m._doScroll({type:"textStart"})}},{name:"scrollTextEnd",defaultHandler:function(){return m._doScroll({type:"textEnd"})}},{name:"centerLine",defaultHandler:function(){return m._doScroll({type:"centerLine"})}},{name:"selectLineUp",defaultHandler:function(){return m._doLineUp({select:true})}},
{name:"selectLineDown",defaultHandler:function(){return m._doLineDown({select:true})}},{name:"selectWholeLineUp",defaultHandler:function(){return m._doLineUp({select:true,wholeLine:true})}},{name:"selectWholeLineDown",defaultHandler:function(){return m._doLineDown({select:true,wholeLine:true})}},{name:"selectLineStart",defaultHandler:function(){return m._doHome({select:true,ctrl:false})}},{name:"selectLineEnd",defaultHandler:function(){return m._doEnd({select:true,ctrl:false})}},{name:"selectCharPrevious",
defaultHandler:function(){return m._doCursorPrevious({select:true,unit:"character"})}},{name:"selectCharNext",defaultHandler:function(){return m._doCursorNext({select:true,unit:"character"})}},{name:"selectPageUp",defaultHandler:function(){return m._doPageUp({select:true})}},{name:"selectPageDown",defaultHandler:function(){return m._doPageDown({select:true})}},{name:"selectWordPrevious",defaultHandler:function(){return m._doCursorPrevious({select:true,unit:"word"})}},{name:"selectWordNext",defaultHandler:function(){return m._doCursorNext({select:true,
unit:"word"})}},{name:"selectTextStart",defaultHandler:function(){return m._doHome({select:true,ctrl:true})}},{name:"selectTextEnd",defaultHandler:function(){return m._doEnd({select:true,ctrl:true})}},{name:"deletePrevious",defaultHandler:function(){return m._doBackspace({unit:"character"})}},{name:"deleteNext",defaultHandler:function(){return m._doDelete({unit:"character"})}},{name:"deleteWordPrevious",defaultHandler:function(){return m._doBackspace({unit:"word"})}},{name:"deleteWordNext",defaultHandler:function(){return m._doDelete({unit:"word"})}},
{name:"deleteLineStart",defaultHandler:function(){return m._doBackspace({unit:"line"})}},{name:"deleteLineEnd",defaultHandler:function(){return m._doDelete({unit:"line"})}},{name:"tab",defaultHandler:function(){return m._doTab()}},{name:"enter",defaultHandler:function(){return m._doEnter()}},{name:"enterNoCursor",defaultHandler:function(){return m._doEnter({noCursor:true})}},{name:"selectAll",defaultHandler:function(){return m._doSelectAll()}},{name:"copy",defaultHandler:function(){return m._doCopy()}},
{name:"cut",defaultHandler:function(){return m._doCut()}},{name:"paste",defaultHandler:function(){return m._doPaste()}}]},_createLine:function(k,n,o,m,q){var w=q.getLine(m),u=q.getLineStart(m),x={textView:this,lineIndex:m,lineText:w,lineStart:u};this.onLineStyle(x);q=o.createElement("DIV");q.lineIndex=m;this._applyStyle(x.style,q);if(w.length!==0){var B=0;if((m=this._customTabSize)&&m!==8)for(var C=w.indexOf("\t"),D=0;C!==-1;){this._createRanges(q,o,x.ranges,B,C,w,u);var F=m-(C+D)%m,J="\u00a0";for(B=
1;B<F;B++)J+=" ";B=o.createElement("SPAN");B.appendChild(o.createTextNode(J));B.ignoreChars=F-1;D+=B.ignoreChars;if(x.ranges)for(F=0;F<x.ranges.length;F++){J=x.ranges[F];var K=J.start-u,L=J.end-u;if(K>C)break;if(K<=C&&C<L){this._applyStyle(J.style,B);break}}q.appendChild(B);B=C+1;C=w.indexOf("\t",B)}this._createRanges(q,o,x.ranges,B,w.length,w,u)}w=o.createElement("SPAN");w.ignoreChars=1;if((this._largestFontStyle&1)!==0)w.style.fontStyle="italic";if((this._largestFontStyle&2)!==0)w.style.fontWeight=
"bold";u=" ";if(!this._fullSelection&&c<9)u="\ufeff";if(j)u="\u200c";w.appendChild(o.createTextNode(u));q.appendChild(w);k.insertBefore(q,n);return q},_createRanges:function(k,n,o,m,q,w,u){if(!(m>=q)){if(o)for(var x=0;x<o.length;x++){var B=o[x];if(!(B.end<=u+m)){var C=Math.max(u+m,B.start)-u;if(C>=q)break;var D=Math.min(u+q,B.end)-u;if(C<D){C=Math.max(m,C);D=Math.min(q,D);m<C&&k.appendChild(this._createRange(k,n,w.substring(m,C),null));k.appendChild(this._createRange(k,n,w.substring(C,D),B.style));
m=D}}}m<q&&k.appendChild(this._createRange(k,n,w.substring(m,q),null))}},_createRange:function(k,n,o,m){var q=m&&m.tagName==="A";if(q)k.hasLink=true;k=q&&this._linksVisible?"A":"SPAN";q=n.createElement(k);q.appendChild(n.createTextNode(o));this._applyStyle(m,q);if(k==="A"){var w=this;d(q,"click",function(u){return w._handleLinkClick(u)},false)}q.viewStyle=m;return q},_createRuler:function(k){if(this._clientDiv){var n=this._frameDocument,o=n.body,m=k.getLocation(),q=m==="left"?this._leftDiv:this._rightDiv;
if(!q){q=n.createElement("DIV");q.style.overflow="hidden";q.style.MozUserSelect="none";q.style.WebkitUserSelect="none";c&&q.attachEvent("onselectstart",function(){return false});q.style.position="absolute";q.style.top="0px";q.style.cursor="default";o.appendChild(q);if(m==="left"){this._leftDiv=q;q.className="viewLeftRuler"}else{this._rightDiv=q;q.className="viewRightRuler"}o=n.createElement("TABLE");q.appendChild(o);o.cellPadding="0px";o.cellSpacing="0px";o.border="0px";o.insertRow(0);var w=this;
d(q,"click",function(u){w._handleRulerEvent(u)});d(q,"dblclick",function(u){w._handleRulerEvent(u)});d(q,"mousemove",function(u){w._handleRulerEvent(u)});d(q,"mouseover",function(u){w._handleRulerEvent(u)});d(q,"mouseout",function(u){w._handleRulerEvent(u)})}n=n.createElement("DIV");n._ruler=k;n.rulerChanged=true;n.style.position="relative";k=q.firstChild.rows[0];k=k.insertCell(k.cells.length);k.vAlign="top";k.appendChild(n)}},_createFrame:function(){if(!this.frame){for(var k=this._parent;k.hasChildNodes();)k.removeChild(k.lastChild);
var n=k.ownerDocument;this._parentDocument=n;var o=n.createElement("IFRAME");this._frame=o;o.frameBorder="0px";o.style.border="0px";o.style.width="100%";o.style.height="100%";o.scrolling="no";var m=this;d(o,"load",this._loadHandler=function(q){m._handleLoad(q)});if(!j)d(n,"DOMAttrModified",this._attrModifiedHandler=function(q){m._handleDOMAttrModified(q)});k.appendChild(o);this._handleLoad()}},_getFrameHTML:function(k){var n=[];n.push("<!DOCTYPE html>");n.push("<html>");n.push("<head>");c<9&&n.push("<meta http-equiv='X-UA-Compatible' content='IE=EmulateIE7'/>");
n.push("<style>");n.push(".viewContainer {font-family: monospace; font-size: 10pt;}");n.push(".view {padding: 1px 2px;}");n.push(".viewContent {}");n.push("</style>");if(this._stylesheet)for(var o=typeof this._stylesheet==="string"?[this._stylesheet]:this._stylesheet,m=0;m<o.length;m++){if(k)try{var q=new XMLHttpRequest;q.overrideMimeType&&q.overrideMimeType("text/css");q.open("GET",o[m],false);q.send(null);n.push("<style>");n.push(q.responseText);n.push("</style>");continue}catch(w){}n.push("<link rel='stylesheet' type='text/css' href='");
n.push(o[m]);n.push("'></link>")}n.push("</head>");n.push("<body spellcheck='false'></body>");n.push("</html>");return n.join("")},_createView:function(k){if(!this._clientDiv)if(!this._ignoreCreate){this._ignoreCreate=true;var n=this._parent,o=this._parentDocument,m=this._frame.contentWindow;this._frameWindow=m;var q=m.document;this._frameDocument=q;q.open();q.write(this._getFrameHTML(true));q.close();m=q.body;m.className="viewContainer";m.style.margin="0px";m.style.borderWidth="0px";m.style.padding=
"0px";if(h){var w=o.createElement("DIV");this._touchDiv=w;w.style.position="absolute";w.style.border="0px";w.style.padding="0px";w.style.margin="0px";w.style.zIndex="2";w.style.overflow="hidden";w.style.background="transparent";w.style.WebkitUserSelect="none";n.appendChild(w);this._textArea=n=o.createElement("TEXTAREA");n.style.position="absolute";n.style.whiteSpace="pre";n.style.left="-1000px";n.tabIndex=1;n.autocapitalize=false;n.autocorrect=false;n.className="viewContainer";n.style.background=
"transparent";n.style.color="transparent";n.style.border="0px";n.style.padding="0px";n.style.margin="0px";n.style.borderRadius="0px";n.style.WebkitAppearance="none";n.style.WebkitTapHighlightColor="transparent";w.appendChild(n)}if(e){this._clipboardDiv=n=q.createElement("DIV");n.style.position="fixed";n.style.whiteSpace="pre";n.style.left="-1000px";m.appendChild(n)}o=q.createElement("DIV");o.className="view";this._viewDiv=o;o.id="viewDiv";o.tabIndex=-1;o.style.overflow="auto";o.style.position="absolute";
o.style.top="0px";o.style.borderWidth="0px";o.style.margin="0px";o.style.MozOutline="none";o.style.outline="none";m.appendChild(o);this._scrollDiv=n=q.createElement("DIV");n.id="scrollDiv";n.style.margin="0px";n.style.borderWidth="0px";n.style.padding="0px";o.appendChild(n);if(h||this._fullSelection&&!j){this._hightlightRGB="Highlight";this._selDiv1=o=q.createElement("DIV");o.id="selDiv1";o.style.position="fixed";o.style.borderWidth="0px";o.style.margin="0px";o.style.padding="0px";o.style.MozOutline=
"none";o.style.outline="none";o.style.background=this._hightlightRGB;o.style.width="0px";o.style.height="0px";n.appendChild(o);this._selDiv2=w=q.createElement("DIV");w.id="selDiv2";w.style.position="fixed";w.style.borderWidth="0px";w.style.margin="0px";w.style.padding="0px";w.style.MozOutline="none";w.style.outline="none";w.style.background=this._hightlightRGB;w.style.width="0px";w.style.height="0px";n.appendChild(w);var u=q.createElement("DIV");this._selDiv3=u;u.id="selDiv3";u.style.position="fixed";
u.style.borderWidth="0px";u.style.margin="0px";u.style.padding="0px";u.style.MozOutline="none";u.style.outline="none";u.style.background=this._hightlightRGB;u.style.width="0px";u.style.height="0px";n.appendChild(u);if(e&&l){var x=this._frameWindow.getComputedStyle(u,null).getPropertyValue("background-color");switch(x){case "rgb(119, 141, 168)":x="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":x="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":x="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":x=
"rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":x="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":x="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":x="rgb(232, 184, 255)";break;default:x="rgb(180, 213, 255)";break}this._hightlightRGB=x;o.style.background=x;w.style.background=x;u.style.background=x;q.styleSheets[0].insertRule("::-moz-selection {background: "+x+"; }",0)}}o=q.createElement("DIV");o.className="viewContent";this._clientDiv=o;o.id="clientDiv";o.style.whiteSpace="pre";o.style.position=
"fixed";o.style.borderWidth="0px";o.style.margin="0px";o.style.padding="0px";o.style.MozOutline="none";o.style.outline="none";if(h)o.style.WebkitTapHighlightColor="transparent";n.appendChild(o);if(e){this._overlayDiv=q=q.createElement("DIV");q.id="overlayDiv";q.style.position=o.style.position;q.style.borderWidth=o.style.borderWidth;q.style.margin=o.style.margin;q.style.padding=o.style.padding;q.style.cursor="text";q.style.zIndex="1";n.appendChild(q)}if(!h)o.contentEditable="true";this._lineHeight=
this._calculateLineHeight();this._viewPadding=this._calculatePadding();if(c)m.style.lineHeight=this._lineHeight+"px";if(this._tabSize)if(f)o.style.OTabSize=this._tabSize+"";else if(e>=4)o.style.MozTabSize=this._tabSize+"";else if(this._tabSize!==8)this._customTabSize=this._tabSize;this._hookEvents();m=this._rulers;for(q=0;q<m.length;q++)this._createRuler(m[q]);if(k)this._updatePage();else{this._queueUpdatePage();var B=this._hScroll,C=this._vScroll;this._vScroll=this._hScroll=0;if(B>0||C>0){var D=
this;setTimeout(function(){D._scrollView(B,C)},0)}}this._ignoreCreate=false}},_destroyFrame:function(){var k=this._frame;if(k){if(this._loadHandler){b(k,"load",this._loadHandler);this._loadHandler=null}if(this._attrModifiedHandler){b(this._parentDocument,"DOMAttrModified",this._attrModifiedHandler);this._attrModifiedHandler=null}k.parentNode.removeChild(k);this._frameWindow=this._frameDocument=this._frame=null}},_destroyRuler:function(k){var n=k.getLocation()==="left"?this._leftDiv:this._rightDiv;
if(n){n=n.firstChild.rows[0];for(var o=n.cells,m=0;m<o.length;m++)if(o[m].firstChild._ruler===k)break;if(m!==o.length){n.cells[m]._ruler=undefined;n.deleteCell(m)}}},_destroyView:function(){if(this._clientDiv){this._setGrab(null);this._unhookEvents();if(this._autoScrollTimerID){clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=null}if(this._updateTimer){clearTimeout(this._updateTimer);this._updateTimer=null}for(var k=this._frameDocument.body;k.hasChildNodes();)k.removeChild(k.lastChild);
if(this._touchDiv){this._parent.removeChild(this._touchDiv);this._touchDiv=null}this._rightDiv=this._leftDiv=this._overlayDiv=this._clientDiv=this._viewDiv=this._scrollDiv=this._clipboardDiv=this._textArea=this._selDiv3=this._selDiv2=this._selDiv1=null}},_doAutoScroll:function(k,n,o){this._autoScrollDir=k;this._autoScrollX=n;this._autoScrollY=o;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=
this._autoScrollDir=undefined},_getBaseText:function(k,n){var o=this._model;if(o.getBaseModel){k=o.mapOffset(k);n=o.mapOffset(n);o=o.getBaseModel()}return o.getText(k,n)},_getBoundsAtOffset:function(k){var n=this._model,o=this._frameDocument,m=this._clientDiv,q=n.getLineAtOffset(k),w,u=this._getLineNode(q);u||(u=w=this._createLine(m,null,o,q,n));var x=null;if(k<n.getLineEnd(q)){n=n.getLineStart(q);for(q=u.firstChild;q;){var B=q.firstChild,C=B.length;if(q.ignoreChars)C-=q.ignoreChars;if(n+C>k){x=k-
n;if(s){o=o.createRange();o.setStart(B,x);o.setEnd(B,x+1);x=o.getBoundingClientRect()}else if(c){o=o.body.createTextRange();o.moveToElementText(q);o.collapse();o.moveEnd("character",x+1);o.moveStart("character",x);x=o.getBoundingClientRect()}else{k=B.data;q.removeChild(B);q.appendChild(o.createTextNode(k.substring(0,x)));var D=o.createElement("SPAN");D.appendChild(o.createTextNode(k.substring(x,x+1)));q.appendChild(D);q.appendChild(o.createTextNode(k.substring(x+1)));x=D.getBoundingClientRect();q.innerHTML=
"";q.appendChild(B);if(!w){o=this._getSelection();if(n<=o.start&&o.start<n+C||n<=o.end&&o.end<n+C)this._updateDOMSelection()}}if(c){o=window.screen.logicalXDPI;n=window.screen.deviceXDPI;x.left=x.left*o/n;x.right=x.right*o/n}break}n+=C;q=q.nextSibling}}if(!x){u=this._getLineBoundingClientRect(u);x={left:u.right,right:u.right}}w&&m.removeChild(w);return x},_getBottomIndex:function(k){var n=this._bottomChild;if(k&&this._getClientHeight()>this._getLineHeight()){k=n.getBoundingClientRect();var o=this._clientDiv.getBoundingClientRect();
if(k.bottom>o.bottom)n=this._getLinePrevious(n)||n}return n.lineIndex},_getFrameHeight:function(){return this._frameDocument.documentElement.clientHeight},_getFrameWidth:function(){return this._frameDocument.documentElement.clientWidth},_getClientHeight:function(){var k=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-k.top-k.bottom)},_getClientWidth:function(){var k=this._getViewPadding();return Math.max(0,this._viewDiv.clientWidth-k.left-k.right)},_getClipboardText:function(k){var n=
this._model.getLineDelimiter(),o;if(this._frameWindow.clipboardData){o=[];k=this._frameWindow.clipboardData.getData("Text");this._convertDelimiter(k,function(C){o.push(C)},function(){o.push(n)});return o.join("")}if(e){var m=this._frameDocument,q=this._clipboardDiv;q.innerHTML="<pre contenteditable=''></pre>";q.firstChild.focus();var w=this,u=function(){var C=w._getTextFromElement(q);q.innerHTML="";o=[];w._convertDelimiter(C,function(D){o.push(D)},function(){o.push(n)});return o.join("")},x=false;
this._ignorePaste=true;try{x=m.execCommand("paste",false,null)}catch(B){}this._ignorePaste=false;if(!x)if(k){setTimeout(function(){w.focus();var C=u();C&&w._doContent(C)},0);return null}else{this.focus();return""}this.focus();return u()}if(k&&k.clipboardData){o=[];k=k.clipboardData.getData("text/plain");this._convertDelimiter(k,function(C){o.push(C)},function(){o.push(n)});return o.join("")}return""},_getDOMText:function(k){k=this._getLineNode(k).firstChild;for(var n="";k;){for(var o=k.firstChild;o;){if(k.ignoreChars)for(var m=
0;m<o.length;m++){var q=o.data.substring(m,m+1);if(q!==" ")n+=q}else n+=o.data;o=o.nextSibling}k=k.nextSibling}return n},_getTextFromElement:function(k){var n=k.ownerDocument,o=n.defaultView;if(!o.getSelection)return k.innerText||k.textContent;n=n.createRange();n.selectNode(k);k=o.getSelection();o=[];for(var m=0;m<k.rangeCount;m++)o.push(k.getRangeAt(m));this._ignoreSelect=true;k.removeAllRanges();k.addRange(n);n=k.toString();k.removeAllRanges();for(m=0;m<o.length;m++)k.addRange(o[m]);this._ignoreSelect=
false;return n},_getViewPadding:function(){return this._viewPadding},_getLineBoundingClientRect:function(k){var n=k.getBoundingClientRect();for(k=k.lastChild;k&&k.ignoreChars===k.firstChild.length;)k=k.previousSibling;if(!k)return{left:n.left,top:n.top,right:n.left,bottom:n.bottom};k=k.getBoundingClientRect();return{left:n.left,top:n.top,right:k.right,bottom:n.bottom}},_getLineHeight:function(){return this._lineHeight},_getLineNode:function(k){for(var n=this._clientDiv.firstChild;n;){if(k===n.lineIndex)return n;
n=n.nextSibling}},_getLineNext:function(k){for(k=k?k.nextSibling:this._clientDiv.firstChild;k&&k.lineIndex===-1;)k=k.nextSibling;return k},_getLinePrevious:function(k){for(k=k?k.previousSibling:this._clientDiv.lastChild;k&&k.lineIndex===-1;)k=k.previousSibling;return k},_getOffset:function(k,n,o){if(n==="line"){n=this._model;k=n.getLineAtOffset(k);if(o>0)return n.getLineEnd(k);return n.getLineStart(k)}if(n==="wordend")return this._getOffset_W3C(k,n,o);return c?this._getOffset_IE(k,n,o):this._getOffset_W3C(k,
n,o)},_getOffset_W3C:function(k,n,o){function m(F){return 33<=F&&F<=47||58<=F&&F<=64||91<=F&&F<=94||F===96||123<=F&&F<=126}function q(F){return F===32||F===9}if(n==="word"||n==="wordend"){var w=this._model,u=w.getLineAtOffset(k),x=w.getLine(u),B=w.getLineStart(u);u=w.getLineEnd(u);w=x.length;k=k-B;var C,D;if(o>0){if(k===w)return u;C=x.charCodeAt(k);D=m(C);o=!D&&!q(C);for(k++;k<w;){C=x.charCodeAt(k);u=m(C);if(n==="wordend"){if(!u&&D)break}else if(u&&!D)break;C=!u&&!q(C);if(n==="wordend"){if(!C&&o)break}else if(C&&
!o)break;o=C;D=u;k++}}else{if(k===0)return B;k--;C=x.charCodeAt(k);D=m(C);for(o=!D&&!q(C);0<k;){C=x.charCodeAt(k-1);u=m(C);if(n==="wordend"){if(u&&!D)break}else if(!u&&D)break;C=!u&&!q(C);if(n==="wordend"){if(C&&!o)break}else if(!C&&o)break;o=C;D=u;k--}}return B+k}return k+o},_getOffset_IE:function(k,n,o){var m=this._frameDocument,q=this._model,w=q.getLineAtOffset(k),u=this._clientDiv,x,B=this._getLineNode(w);B||(B=x=this._createLine(u,null,m,w,q));var C=0,D;D=q.getLineStart(w);if(k===q.getLineEnd(w)){m=
m.body.createTextRange();m.moveToElementText(B.lastChild);D=m.text.length;m.moveEnd(n,o);C=k+m.text.length-D}else if(k===D&&o<0)C=D;else for(B=B.firstChild;B;){q=B.firstChild.length;if(B.ignoreChars)q-=B.ignoreChars;if(D+q>k){m=m.body.createTextRange();if(k===D&&o<0)m.moveToElementText(B.previousSibling);else{m.moveToElementText(B);m.collapse();m.moveEnd("character",k-D)}D=m.text.length;m.moveEnd(n,o);C=k+m.text.length-D;break}D=q+D;B=B.nextSibling}x&&u.removeChild(x);return C},_getOffsetToX:function(k){return this._getBoundsAtOffset(k).left},
_getPadding:function(k){var n,o,m,q;if(k.currentStyle){n=k.currentStyle.paddingLeft;o=k.currentStyle.paddingTop;m=k.currentStyle.paddingRight;q=k.currentStyle.paddingBottom}else if(this._frameWindow.getComputedStyle){k=this._frameWindow.getComputedStyle(k,null);n=k.getPropertyValue("padding-left");o=k.getPropertyValue("padding-top");m=k.getPropertyValue("padding-right");q=k.getPropertyValue("padding-bottom")}return{left:parseInt(n,10),top:parseInt(o,10),right:parseInt(m,10),bottom:parseInt(q,10)}},
_getScroll:function(){var k=this._viewDiv;return{x:k.scrollLeft,y:k.scrollTop}},_getSelection:function(){return this._selection.clone()},_getTopIndex:function(k){var n=this._topChild;if(k&&this._getClientHeight()>this._getLineHeight()){k=n.getBoundingClientRect();var o=this._getViewPadding(),m=this._viewDiv.getBoundingClientRect();if(k.top<m.top+o.top)n=this._getLineNext(n)||n}return n.lineIndex},_getXToOffset:function(k,n){function o(W){var X,$,fa,ga;if(!W._rectsCache){X=W.getClientRects();$=[X.length];
for(fa=0;fa<X.length;fa++){ga=X[fa];$[fa]={left:ga.left-D+K,top:ga.top,right:ga.right-D+K,bottom:ga.bottom}}W._rectsCache=$}X=W._rectsCache;$=[X.length];for(fa=0;fa<X.length;fa++){ga=X[fa];$[fa]={left:ga.left-K,top:ga.top,right:ga.right-K,bottom:ga.bottom}}return $}var m=this._model,q=m.getLineStart(k),w=m.getLineEnd(k);if(q===w)return q;var u=this._frameDocument,x=this._clientDiv,B,C=this._getLineNode(k);C||(C=B=this._createLine(x,null,u,k,m));k=this._getLineBoundingClientRect(C);if(n<k.left)n=k.left;
if(n>k.right)n=k.right;var D=0,F;if(c<9){F=C.getClientRects();m=F[0].left;for(var J=1;J<F.length;J++)m=Math.min(F[J].left,m);D=m-k.left}var K=this._getScroll().x,L=c?window.screen.logicalXDPI:1,R=c?window.screen.deviceXDPI:1;k=q;m=C.firstChild;a:for(;m;){J=m.firstChild;C=J.length;if(m.ignoreChars)C-=m.ignoreChars;F=o(m);for(var T=0;T<F.length;T++){var S=F[T];if(S.left<=n&&n<S.right){if(c||s){u=s?u.createRange():u.body.createTextRange();T=C;for(var ca=-1;T-ca>1;){var A=Math.floor((T+ca)/2);F=ca+1;
S=A===C-1&&m.ignoreChars?J.length:A+1;if(s){u.setStart(J,F);u.setEnd(J,S)}else{u.moveToElementText(m);u.move("character",F);u.moveEnd("character",S-F)}F=u.getClientRects();for(var E=false,H=0;H<F.length;H++){S=F[H];var P=S.right*L/R-D;if(S.left*L/R-D<=n&&n<P){E=true;break}}if(E)T=A;else ca=A}k+=T;F=T;S=T===C-1&&m.ignoreChars?J.length:T+1;if(s){u.setStart(J,F);u.setEnd(J,S)}else{u.moveToElementText(m);u.move("character",F);u.moveEnd("character",S-F)}S=u.getClientRects()[0];n>S.left*L/R-D+(S.right-
S.left)*L/R/2&&k++}else{F=[];for(L=0;L<C;L++){F.push("<span>");L===C-1?F.push(J.data.substring(L)):F.push(J.data.substring(L,L+1));F.push("</span>")}m.innerHTML=F.join("");for(F=m.firstChild;F;){S=F.getBoundingClientRect();if(S.left<=n&&n<S.right){n>S.left+(S.right-S.left)/2&&k++;break}k++;F=F.nextSibling}if(!B){m.innerHTML="";m.appendChild(J);n=this._getSelection();if(k<=n.start&&n.start<k+C||k<=n.end&&n.end<k+C)this._updateDOMSelection()}}break a}}k+=C;m=m.nextSibling}B&&x.removeChild(B);return Math.min(w,
Math.max(q,k))},_getYToLine:function(k){var n=this._getViewPadding(),o=this._viewDiv.getBoundingClientRect();k-=o.top+n.top;n=this._getLineHeight();k=Math.floor((k+this._getScroll().y)/n);n=this._model.getLineCount();return Math.max(0,Math.min(n-1,k))},_getOffsetBounds:function(k){var n=this._model.getLineAtOffset(k),o=this._getLineHeight(),m=this._getScroll(),q=this._getViewPadding(),w=this._viewDiv.getBoundingClientRect();k=this._getBoundsAtOffset(k);n=n*o-m.y+w.top+q.top;return{left:k.left,top:n,
right:k.right,bottom:n+o}},_getVisible:function(){for(var k=this._parent,n=k.ownerDocument;k!==n;){var o;if(c<9)o=k.currentStyle&&k.currentStyle.display==="none";else o=(o=n.defaultView.getComputedStyle(k,null))&&o.getPropertyValue("display")==="none";if(o)return"hidden";k=k.parentNode;if(!k)return"disconnected"}return"visible"},_hitOffset:function(k,n,o){var m=this._getOffsetBounds(k);k=m.left;var q=m.right,w=m.top;m=m.bottom;k-=20;w-=20;q+=20;m+=20;return k<=n&&n<=q&&w<=o&&o<=m},_hookEvents:function(){var k=
this;this._modelListener={onChanging:function(x){k._onModelChanging(x)},onChanged:function(x){k._onModelChanged(x)}};this._model.addListener(this._modelListener);var n=this._clientDiv,o=this._viewDiv,m=this._frameDocument.body,q=this._handlers=[],w=c<9?this._frame:this._frameWindow,u=h?this._textArea:c||e?this._clientDiv:this._frameWindow;q.push({target:this._frameWindow,type:"unload",handler:function(x){return k._handleUnload(x)}});q.push({target:w,type:"resize",handler:function(x){return k._handleResize(x)}});
q.push({target:u,type:"blur",handler:function(x){return k._handleBlur(x)}});q.push({target:u,type:"focus",handler:function(x){return k._handleFocus(x)}});q.push({target:o,type:"scroll",handler:function(x){return k._handleScroll(x)}});if(h){n=this._touchDiv;m=this._textArea;q.push({target:m,type:"keydown",handler:function(x){return k._handleKeyDown(x)}});q.push({target:m,type:"input",handler:function(x){return k._handleInput(x)}});q.push({target:m,type:"textInput",handler:function(x){return k._handleTextInput(x)}});
q.push({target:m,type:"click",handler:function(x){return k._handleTextAreaClick(x)}});q.push({target:n,type:"touchstart",handler:function(x){return k._handleTouchStart(x)}});q.push({target:n,type:"touchmove",handler:function(x){return k._handleTouchMove(x)}});q.push({target:n,type:"touchend",handler:function(x){return k._handleTouchEnd(x)}})}else{o=this._overlayDiv||this._clientDiv;w=c?n:this._frameWindow;q.push({target:n,type:"keydown",handler:function(x){return k._handleKeyDown(x)}});q.push({target:n,
type:"keypress",handler:function(x){return k._handleKeyPress(x)}});q.push({target:n,type:"keyup",handler:function(x){return k._handleKeyUp(x)}});q.push({target:n,type:"selectstart",handler:function(x){return k._handleSelectStart(x)}});q.push({target:n,type:"contextmenu",handler:function(x){return k._handleContextMenu(x)}});q.push({target:n,type:"copy",handler:function(x){return k._handleCopy(x)}});q.push({target:n,type:"cut",handler:function(x){return k._handleCut(x)}});q.push({target:n,type:"paste",
handler:function(x){return k._handlePaste(x)}});q.push({target:n,type:"mousedown",handler:function(x){return k._handleMouseDown(x)}});q.push({target:w,type:"mouseup",handler:function(x){return k._handleMouseUp(x)}});q.push({target:w,type:"mousemove",handler:function(x){return k._handleMouseMove(x)}});q.push({target:m,type:"mousedown",handler:function(x){return k._handleBodyMouseDown(x)}});q.push({target:o,type:"dragstart",handler:function(x){return k._handleDragStart(x)}});q.push({target:o,type:"dragover",
handler:function(x){return k._handleDragOver(x)}});q.push({target:o,type:"drop",handler:function(x){return k._handleDrop(x)}});if(g){q.push({target:this._parentDocument,type:"mousemove",handler:function(x){return k._handleMouseMove(x)}});q.push({target:this._parentDocument,type:"mouseup",handler:function(x){return k._handleMouseUp(x)}})}c&&q.push({target:this._frameDocument,type:"activate",handler:function(x){return k._handleDocFocus(x)}});e&&q.push({target:this._frameDocument,type:"focus",handler:function(x){return k._handleDocFocus(x)}});
if(!c&&!f)q.push({target:this._viewDiv,type:e?"DOMMouseScroll":"mousewheel",handler:function(x){return k._handleMouseWheel(x)}});e&&!p&&q.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(x){return k._handleDataModified(x)}});if(this._overlayDiv){q.push({target:this._overlayDiv,type:"mousedown",handler:function(x){return k._handleMouseDown(x)}});q.push({target:this._overlayDiv,type:"contextmenu",handler:function(x){return k._handleContextMenu(x)}})}r||q.push({target:this._clientDiv,
type:"dblclick",handler:function(x){return k._handleDblclick(x)}})}for(n=0;n<q.length;n++){m=q[n];d(m.target,m.type,m.handler,m.capture)}},_init:function(k){var n=k.parent;if(typeof n==="string")n=window.document.getElementById(n);if(!n)throw"no parent";this._parent=n;this._model=k.model?k.model:new orion.textview.TextModel;this.readonly=k.readonly===true;this._fullSelection=k.fullSelection===undefined||k.fullSelection;if(c<9)this._fullSelection=false;this._stylesheet=k.stylesheet;this._tabSize=k.tabSize;
this._rulers=[];this._selection=new z(0,0,false);this._linksVisible=false;this._eventTable=new y;this._maxLineWidth=this._redrawCount=0;this._maxLineIndex=-1;this._ignoreSelect=true;this._columnX=-1;this._autoScrollTimerID=this._autoScrollY=this._autoScrollX=null;this._AUTO_SCROLL_RATE=50;this._mouseUpClosure=this._moseMoveClosure=this._grabControl=null;this._clickCount=this._lastMouseTime=this._lastMouseY=this._lastMouseX=0;this._clickTime=250;this._clickDist=5;this._isMouseDown=false;this._doubleClickSelection=
null;this._vScroll=this._hScroll=0;this._imeOffset=-1;this._createActions();this._createFrame()},_modifyContent:function(k,n){if(!(this.readonly&&!k._code)){this.onVerify(k);if(!(k.text===null||k.text===undefined)){var o=this._model;try{if(k._ignoreDOMSelection)this._ignoreDOMSelection=true;o.setText(k.text,k.start,k.end)}finally{if(k._ignoreDOMSelection)this._ignoreDOMSelection=false}if(n){n=this._getSelection();n.setCaret(k.start+k.text.length);this._setSelection(n,true)}this.onModify({})}}},_onModelChanged:function(k){this.onModelChanged(k);
var n=k.start,o=k.addedCharCount,m=k.removedCharCount,q=k.addedLineCount;k=k.removedLineCount;var w=this._getSelection();if(w.end>n){if(w.end>n&&w.start<n+m)w.setCaret(n+o);else{w.start+=o-m;w.end+=o-m}this._setSelection(w,false,false)}n=this._model.getLineAtOffset(n);for(o=this._getLineNext();o;){m=o.lineIndex;if(n<=m&&m<=n+k)o.lineChanged=true;if(m>n+k)o.lineIndex=m+q-k;o=this._getLineNext(o)}if(n<=this._maxLineIndex&&this._maxLineIndex<=n+k){this._checkMaxLineIndex=this._maxLineIndex;this._maxLineIndex=
-1;this._maxLineWidth=0}this._updatePage()},_onModelChanging:function(k){this.onModelChanging(k)},_queueUpdatePage:function(){if(!this._updateTimer){var k=this;this._updateTimer=setTimeout(function(){k._updateTimer=null;k._updatePage()},0)}},_reset:function(){this._maxLineIndex=-1;this._maxLineWidth=0;this._columnX=-1;this._bottomChild=this._topChild=null;this._partialY=0;this._setSelection(new z(0,0,false),false,false);if(this._viewDiv){this._viewDiv.scrollLeft=0;this._viewDiv.scrollTop=0}var k=
this._clientDiv;if(k){for(var n=k.firstChild;n;){n.lineChanged=true;n=n.nextSibling}if(e){(n=this._hasFocus)&&k.blur();k.contentEditable=false;k.contentEditable=true;n&&k.focus()}}},_resizeTouchDiv:function(){for(var k=this._viewDiv.getBoundingClientRect(),n=this._frame.getBoundingClientRect(),o=this._frame;o;){if(o.style&&o.style.top)break;o=o.parentNode}var m=n.top;if(o)m-=o.getBoundingClientRect().top;else m+=this._parentDocument.body.scrollTop;for(o=this._frame;o;){if(o.style&&o.style.left)break;
o=o.parentNode}n=n.left;if(o)n-=o.getBoundingClientRect().left;else n+=this._parentDocument.body.scrollLeft;o=this._touchDiv;o.style.left=n+k.left+"px";o.style.top=m+k.top+"px";o.style.width=k.width+"px";o.style.height=k.height+"px"},_scrollView:function(k,n){this._ensureCaretVisible=false;var o=this._viewDiv;if(k)o.scrollLeft+=k;if(n)o.scrollTop+=n},_setClipboardText:function(k,n){var o;if(this._frameWindow.clipboardData){o=[];this._convertDelimiter(k,function(B){o.push(B)},function(){o.push(v)});
return this._frameWindow.clipboardData.setData("Text",o.join(""))}if(g||e||!n){var m=this._frameWindow,q=this._frameDocument,w=q.createElement("PRE");w.style.position="fixed";w.style.left="-1000px";this._convertDelimiter(k,function(B){w.appendChild(q.createTextNode(B))},function(){w.appendChild(q.createElement("BR"))});w.appendChild(q.createTextNode(" "));this._clientDiv.appendChild(w);k=q.createRange();k.setStart(w.firstChild,0);k.setEndBefore(w.lastChild);m=m.getSelection();m.rangeCount>0&&m.removeAllRanges();
m.addRange(k);var u=this;m=function(){u._clientDiv.removeChild(w);u._updateDOMSelection()};k=false;this._ignoreCopy=true;try{k=q.execCommand("copy",false,null)}catch(x){}this._ignoreCopy=false;if(!k)if(n){setTimeout(m,0);return false}m();return true}if(n&&n.clipboardData){o=[];this._convertDelimiter(k,function(B){o.push(B)},function(){o.push(v)});return n.clipboardData.setData("text/plain",o.join(""))}},_setDOMSelection:function(k,n,o,m){for(var q=this._frameWindow,w=this._frameDocument,u,x,B,C,D=
0,F=k.firstChild,J,K,L=this._model.getLine(k.lineIndex).length;F;){J=F.firstChild;K=J.length;if(F.ignoreChars)K-=F.ignoreChars;if(D+K>n||D+K>=L){u=J;x=n-D;if(F.ignoreChars&&K>0&&x===K)x+=F.ignoreChars;break}D+=K;F=F.nextSibling}D=0;F=o.firstChild;for(var R=this._model.getLine(o.lineIndex).length;F;){J=F.firstChild;K=J.length;if(F.ignoreChars)K-=F.ignoreChars;if(K+D>m||D+K>=R){B=J;C=m-D;if(F.ignoreChars&&K>0&&C===K)C+=F.ignoreChars;break}D+=K;F=F.nextSibling}this._setDOMFullSelection(k,n,L,o,m,R);
if(!h)if(q.getSelection){w=w.createRange();w.setStart(u,x);w.setEnd(B,C);B=q.getSelection();this._ignoreSelect=false;B.rangeCount>0&&B.removeAllRanges();B.addRange(w);this._ignoreSelect=true}else if(w.selection){q=w.body;w=w.createElement("DIV");q.appendChild(w);q.removeChild(w);w=q.createTextRange();w.moveToElementText(u.parentNode);w.moveStart("character",x);u=q.createTextRange();u.moveToElementText(B.parentNode);u.moveStart("character",C);w.setEndPoint("EndToStart",u);this._ignoreSelect=false;
w.select();this._ignoreSelect=true}},_setDOMFullSelection:function(k,n,o,m,q,w){var u=this._model;if(this._selDiv1){var x,B;x=this._getLineBoundingClientRect(k);if(n===0)B=x.left;else if(n>=o)B=x.right;else{this._ignoreDOMSelection=true;B=this._getBoundsAtOffset(u.getLineStart(k.lineIndex)+n).left;this._ignoreDOMSelection=false}if((o=this._textArea)&&h){o.selectionStart=o.selectionEnd=0;var C=this._frame.getBoundingClientRect(),D=this._touchDiv.getBoundingClientRect(),F=this._viewDiv.getBoundingClientRect();
o.style.left=!(F.left<=B&&B<=F.left+F.width&&F.top<=x.top&&x.top<=F.top+F.height)||!(k===m&&n===q)?"-1000px":B-4+C.left-D.left+"px";o.style.top=x.top+C.top-D.top+"px";o.style.width="6px";o.style.height=x.bottom-x.top+"px"}o=this._selDiv1;o.style.width="0px";o.style.height="0px";o=this._selDiv2;o.style.width="0px";o.style.height="0px";o=this._selDiv3;o.style.width="0px";o.style.height="0px";if(!(k===m&&n===q)){C=h?2:0;D=C+"px blue solid";F=this._getViewPadding();var J=this._clientDiv.getBoundingClientRect(),
K=this._viewDiv.getBoundingClientRect();n=K.left+F.left;o=J.right;F=K.top+F.top;J=J.bottom;K=this._getLineBoundingClientRect(m);if(q===0)q=K.left;else if(q>=w)q=K.right;else{this._ignoreDOMSelection=true;q=this._getBoundsAtOffset(u.getLineStart(m.lineIndex)+q).left;this._ignoreDOMSelection=false}w=this._selDiv1;B=Math.min(o,Math.max(n,B));u=Math.min(J,Math.max(F,x.top));var L=o;x=Math.min(J,Math.max(F,x.bottom));w.style.left=B+"px";w.style.top=u+"px";w.style.width=Math.max(0,L-B)+"px";w.style.height=
Math.max(0,x-u)+(h?1:0)+"px";if(h){w.style.borderLeft=D;w.style.borderRight="0px"}if(k===m){L=Math.min(q,o);w.style.width=Math.max(0,L-B-C*2)+"px";if(h)w.style.borderRight=D}else{k=Math.min(J,Math.max(F,K.top));m=Math.min(o,Math.max(n,q));B=Math.min(J,Math.max(F,K.bottom));q=this._selDiv3;q.style.left=n+"px";q.style.top=k+"px";q.style.width=Math.max(0,m-n-C)+"px";q.style.height=Math.max(0,B-k)+"px";if(h)q.style.borderRight=D;if(k-x>0){m=this._selDiv2;m.style.left=n+"px";m.style.top=x+"px";m.style.width=
Math.max(0,o-n)+"px";m.style.height=Math.max(0,k-x)+(h?1:0)+"px"}}}}},_setGrab:function(k){if(k!==this._grabControl)if(k){k.setCapture&&k.setCapture();this._grabControl=k}else{this._grabControl.releaseCapture&&this._grabControl.releaseCapture();this._grabControl=null}},_setLinksVisible:function(k){if(this._linksVisible!==k){this._linksVisible=k;if(c&&k)this._hadFocus=this._hasFocus;var n=this._clientDiv;n.contentEditable=!k;this._hadFocus&&!k&&n.focus();if(this._overlayDiv)this._overlayDiv.style.zIndex=
k?"-1":"1";k=this._frameDocument;for(n=this._getLineNext();n;){if(n.hasLink)for(var o=n.firstChild;o;){var m=o.nextSibling,q=o.viewStyle;q&&q.tagName==="A"&&n.replaceChild(this._createRange(n,k,o.firstChild.data,q),o);o=m}n=this._getLineNext(n)}}},_setSelection:function(k,n,o,m){if(k){this._columnX=-1;if(o===undefined)o=true;var q=this._selection;if(!q.equals(k)){this._selection=k;this.onSelection({oldValue:{start:q.start,end:q.end},newValue:{start:k.start,end:k.end}})}if(n)o=!this._showCaret(false,
m);o&&this._updateDOMSelection()}},_setSelectionTo:function(k,n,o){var m=this._model,q=this._getSelection();n=this._getYToLine(n);if(this._clickCount===1){m=this._getXToOffset(n,k);q.extend(m);o||q.collapse()}else{if((this._clickCount&1)===0){m=this._getXToOffset(n,k);if(this._doubleClickSelection)if(m>=this._doubleClickSelection.start){o=this._doubleClickSelection.start;m=this._getOffset(m,"wordend",+1)}else{o=this._getOffset(m,"word",-1);m=this._doubleClickSelection.end}else{o=this._getOffset(m,
"word",-1);m=this._getOffset(o,"wordend",+1)}}else if(this._doubleClickSelection){k=m.getLineAtOffset(this._doubleClickSelection.start);if(n>=k){o=m.getLineStart(k);m=m.getLineEnd(n)}else{o=m.getLineStart(n);m=m.getLineEnd(k)}}else{o=m.getLineStart(n);m=m.getLineEnd(n)}q.setCaret(o);q.extend(m)}this._setSelection(q,true,true)},_showCaret:function(k,n){if(this._clientDiv){var o=this._model,m=this._getSelection(),q=this._getScroll(),w=m.getCaret(),u=m.start,x=m.end,B=o.getLineAtOffset(u),C=o.getLineAtOffset(x),
D=Math.max(Math.max(u,o.getLineStart(C)),x-1),F=this._getViewPadding(),J=this._getClientWidth(),K=F.left;F=F.left+J;var L=this._getBoundsAtOffset(w===u?u:D),R=L.left,T=L.right,S=J/4;if(k&&!m.isEmpty()&&B===C){L=this._getBoundsAtOffset(w===x?u:D);if(J-S>(w===u?L.right-R:T-L.left)){if(R>L.left)R=L.left;if(T<L.right)T=L.right}}m=this._viewDiv.getBoundingClientRect();R-=m.left;T-=m.left;m=0;if(R<K)m=Math.min(R-K,-S);if(T>F)m=Math.min(this._scrollDiv.scrollWidth-q.x-J,Math.max(T-F,S));K=0;R=this._getTopIndex(true);
T=this._getBottomIndex(true);o=o.getLineAtOffset(w);F=this._getClientHeight();if(!(R<=o&&o<=T)){R=this._getLineHeight();k=k?(C-B)*R:0;K=o*R;K-=q.y;if(K+R>F){K-=F-R;if(w===u&&u!==x)K+=Math.min(F-R,k)}else if(w===x)K-=Math.min(F-R,k);if(n)if(n>0){if(K>0)K=Math.max(K,n)}else if(K<0)K=Math.min(K,n)}if(m!==0||K!==0){this._scrollView(m,K);if(F!==this._getClientHeight()||J!==this._getClientWidth())this._showCaret();else this._ensureCaretVisible=true;return true}return false}},_startIME:function(){if(this._imeOffset===
-1){var k=this._getSelection();k.isEmpty()||this._modifyContent({text:"",start:k.start,end:k.end},true);this._imeOffset=k.start}},_unhookEvents:function(){this._model.removeListener(this._modelListener);this._modelListener=null;for(var k=0;k<this._handlers.length;k++){var n=this._handlers[k];b(n.target,n.type,n.handler)}this._handlers=null},_updateDOMSelection:function(){if(!this._ignoreDOMSelection)if(this._clientDiv){var k=this._getSelection(),n=this._model,o=n.getLineAtOffset(k.start),m=n.getLineAtOffset(k.end),
q=this._getLineNext();if(q){var w=this._getLinePrevious(),u;if(o<q.lineIndex){u=q;o=0}else if(o>w.lineIndex){u=w;o=0}else{u=this._getLineNode(o);o=k.start-n.getLineStart(o)}if(m<q.lineIndex){q=q;k=0}else if(m>w.lineIndex){q=w;k=0}else{q=this._getLineNode(m);k=k.end-n.getLineStart(m)}this._setDOMSelection(u,o,q,k)}}},_updatePage:function(){function k(E){if(E){for(var H=K+u.top+u.bottom,P=E.firstChild.rows[0].cells,W=0;W<P.length;W++){var X=P[W].firstChild,$=B;if(X._ruler.getOverview()==="page")$+=
L;X.style.top=-$+"px";X.style.height=H+$+"px"}E.style.height=H+"px"}}if(!(this._redrawCount>0)){if(this._updateTimer){clearTimeout(this._updateTimer);this._updateTimer=null}var n=this._frameDocument,o=this._viewDiv,m=this._clientDiv;if(m){var q=this._getFrameWidth(),w=this._getFrameHeight();n.body.style.width=q+"px";n.body.style.height=w+"px";var u=this._getViewPadding();o.style.height=Math.max(0,w-u.top-u.bottom)+"px";var x=this._model,B=this._getLineHeight();w=this._getScroll().y;var C=Math.max(0,
w)/B,D=Math.floor(C),F=Math.max(0,D-1);w=Math.round((C-F)*B);var J=x.getLineCount(),K=this._getClientHeight(),L=Math.round((C-D)*B);C=Math.floor((K+L)/B);C=Math.min(D+C,J-1);var R=Math.min(C+1,J-1);this._partialY=L;for(var T,S=m.firstChild;S;){T=S.lineIndex;var ca=S.nextSibling;if(!(F<=T&&T<=R)||S.lineChanged||S.lineIndex===-1)if(this._mouseWheelLine===S){S.style.display="none";S.lineIndex=-1}else m.removeChild(S);S=ca}S=this._getLineNext();ca=n.createDocumentFragment();for(T=F;T<=R;T++)if(!S||S.lineIndex>
T)this._createLine(ca,null,n,T,x);else{if(ca.firstChild){m.insertBefore(ca,S);ca=n.createDocumentFragment()}S=this._getLineNext(S)}ca.firstChild&&m.insertBefore(ca,S);if(j)m.style.width=(524287).toString()+"px";for(S=this._getLineNext();S;){F=S.lineWidth;if(F===undefined){F=this._getLineBoundingClientRect(S);F=S.lineWidth=F.right-F.left}if(F>=this._maxLineWidth){this._maxLineWidth=F;this._maxLineIndex=S.lineIndex}if(S.lineIndex===D)this._topChild=S;if(S.lineIndex===C)this._bottomChild=S;if(this._checkMaxLineIndex===
S.lineIndex)this._checkMaxLineIndex=-1;S=this._getLineNext(S)}if(this._checkMaxLineIndex!==-1){T=this._checkMaxLineIndex;this._checkMaxLineIndex=-1;if(0<=T&&T<J){n=this._createLine(m,null,n,T,x);F=this._getLineBoundingClientRect(n);F=F.right-F.left;if(F>=this._maxLineWidth){this._maxLineWidth=F;this._maxLineIndex=T}m.removeChild(n)}}this._updateRuler(this._leftDiv,D,C);this._updateRuler(this._rightDiv,D,C);n=this._leftDiv?this._leftDiv.scrollWidth:0;x=this._rightDiv?this._rightDiv.scrollWidth:0;o.style.left=
n+"px";o.style.width=Math.max(0,q-n-x-u.left-u.right)+"px";if(this._rightDiv)this._rightDiv.style.left=q-x+"px";x=this._scrollDiv;o=J*B;x.style.height=o+"px";q=this._getClientWidth();J=D=Math.max(this._maxLineWidth,q);if(!c||c>=9)D+=u.right;x.style.width=D+"px";x=this._getScroll();C=D=x.x;T=w;F=D+q;S=w+K;if(C===0)C-=u.left;if(T===0)T-=u.top;if(F===J)F+=u.right;if(x.y+K===o)S+=u.bottom;m.style.clip="rect("+T+"px,"+F+"px,"+S+"px,"+C+"px)";m.style.left=-D+n+u.left+"px";m.style.top=-w+u.top+"px";m.style.width=
(j?J:q+D)+"px";m.style.height=K+w+"px";if(w=this._overlayDiv){w.style.clip=m.style.clip;w.style.left=m.style.left;w.style.top=m.style.top;w.style.width=m.style.width;w.style.height=m.style.height}k(this._leftDiv);k(this._rightDiv);if(h){var A=this;setTimeout(function(){A._resizeTouchDiv()},0)}this._updateDOMSelection();m=this._ensureCaretVisible;this._ensureCaretVisible=false;if(K!==this._getClientHeight()){this._updatePage();m&&this._showCaret()}}}},_updateRuler:function(k,n,o){if(k){k=k.firstChild.rows[0].cells;
for(var m=this._getLineHeight(),q=this._frameDocument,w=this._getViewPadding(),u=0;u<k.length;u++){var x=k[u].firstChild,B=x._ruler;x.rulerChanged&&this._applyStyle(B.getRulerStyle(),x);var C,D=x.firstChild;if(D){C=D;D=D.nextSibling}else{C=q.createElement("DIV");C.style.visibility="hidden";x.appendChild(C)}var F,J;if(x.rulerChanged)if(C){F=-1;if(J=B.getWidestAnnotation()){this._applyStyle(J.style,C);if(J.html)C.innerHTML=J.html}C.lineIndex=F;C.style.height=m+w.top+"px"}var K,L;if(B.getOverview()===
"page"){for(B=B.getAnnotations(n,o+1);D;){F=D.lineIndex;J=D.nextSibling;if(!(n<=F&&F<=o)||D.lineChanged)x.removeChild(D);D=J}D=x.firstChild.nextSibling;L=q.createDocumentFragment();for(F=n;F<=o;F++)if(!D||D.lineIndex>F){K=q.createElement("DIV");if(J=B[F]){this._applyStyle(J.style,K);if(J.html)K.innerHTML=J.html;K.annotation=J}K.lineIndex=F;K.style.height=m+"px";L.appendChild(K)}else{if(L.firstChild){x.insertBefore(L,D);L=q.createDocumentFragment()}if(D)D=D.nextSibling}L.firstChild&&x.insertBefore(L,
D)}else{D=h?0:17;J=this._getClientHeight();F=this._model.getLineCount();C=J+w.top+w.bottom-2*D;var R;R=m*F<C?m:C/F;if(x.rulerChanged){for(J=x.childNodes.length;J>1;){x.removeChild(x.lastChild);J--}B=B.getAnnotations(0,F);L=q.createDocumentFragment();for(var T in B){F=T>>>0;if(!(F<0)){K=q.createElement("DIV");J=B[T];this._applyStyle(J.style,K);K.style.position="absolute";K.style.top=D+m+Math.floor(F*R)+"px";if(J.html)K.innerHTML=J.html;K.annotation=J;K.lineIndex=F;L.appendChild(K)}}x.appendChild(L)}else if(x._oldTrackHeight!==
C)for(K=x.firstChild?x.firstChild.nextSibling:null;K;){K.style.top=D+m+Math.floor(K.lineIndex*R)+"px";K=K.nextSibling}x._oldTrackHeight=C}x.rulerChanged=false}}}};return a}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/textview/textView",["orion/textview/textModel","orion/textview/keyBinding"],function(){return orion.textview});orion=orion||{};orion.textview=orion.textview||{};
orion.textview.ProjectionTextModel=function(){function d(b){this._model=b;this._listeners=[];this._projections=[]}d.prototype={addProjection:function(b){if(b){var a=this._model,c=this._projections;b._lineIndex=a.getLineAtOffset(b.start);b._lineCount=a.getLineAtOffset(b.end)-b._lineIndex;var e=b.text;e||(e="");b._model=typeof e==="string"?new orion.textview.TextModel(e,a.getLineDelimiter()):e;a=this.mapOffset(b.start,true);e=b.end-b.start;var f=b._lineCount,g=b._model.getCharCount(),i=b._model.getLineCount()-
1;this.onChanging({text:b._model.getText(),start:a,removedCharCount:e,addedCharCount:g,removedLineCount:f,addedLineCount:i});var j=this._binarySearch(c,b.start);c.splice(j,0,b);this.onChanged({start:a,removedCharCount:e,addedCharCount:g,removedLineCount:f,addedLineCount:i})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(b,a){var c=this._projections,e=0,f;if(a){for(a=0;a<c.length;a++){f=c[a];if(f.start>b)break;if(f.end>
b)return-1;e+=f._model.getCharCount()-(f.end-f.start)}return b+e}for(a=0;a<c.length;a++){f=c[a];if(f.start>b-e)break;var g=f._model.getCharCount();if(f.start+g>b-e)return-1;e+=g-(f.end-f.start)}return b-e},removeProjection:function(b){var a,c=0;for(a=0;a<this._projections.length;a++){var e=this._projections[a];if(e===b){b=e;break}c+=e._model.getCharCount()-(e.end-e.start)}if(a<this._projections.length){e=this._model;c=b.start+c;var f=b.end-b.start,g=b._lineCount,i=b._model.getCharCount(),j=b._model.getLineCount()-
1;this.onChanging({text:e.getText(b.start,b.end),start:c,removedCharCount:i,addedCharCount:f,removedLineCount:j,addedLineCount:g});this._projections.splice(a,1);this.onChanged({start:c,removedCharCount:i,addedCharCount:f,removedLineCount:j,addedLineCount:g})}},_binarySearch:function(b,a){for(var c=b.length,e=-1,f;c-e>1;){f=Math.floor((c+e)/2);if(a<=b[f].start)c=f;else e=f}return c},addListener:function(b){this._listeners.push(b)},removeListener:function(b){for(var a=0;a<this._listeners.length;a++)if(this._listeners[a]===
b){this._listeners.splice(a,1);return}},getCharCount:function(){for(var b=this._model.getCharCount(),a=this._projections,c=0;c<a.length;c++){var e=a[c];b+=e._model.getCharCount()-(e.end-e.start)}return b},getLine:function(b,a){if(b<0)return null;var c=this._model,e=this._projections,f=0,g=[],i=0,j,h,l;for(j=0;j<e.length;j++){l=e[j];if(l._lineIndex>=b-f)break;h=l._model.getLineCount()-1;if(l._lineIndex+h>=b-f){i=b-(l._lineIndex+f);if(i<h)return l._model.getLine(i,a);else g.push(l._model.getLine(h))}i=
l.end;f+=h-l._lineCount}for(i=Math.max(i,c.getLineStart(b-f));j<e.length;j++){l=e[j];if(l._lineIndex>b-f)break;g.push(c.getText(i,l.start));h=l._model.getLineCount()-1;if(l._lineIndex+h>b-f){g.push(l._model.getLine(0,a));return g.join("")}g.push(l._model.getText());i=l.end;f+=h-l._lineCount}b=c.getLineEnd(b-f,a);i<b&&g.push(c.getText(i,b));return g.join("")},getLineAtOffset:function(b){for(var a=this._model,c=this._projections,e=0,f=0,g=0;g<c.length;g++){var i=c[g];if(i.start>b-e)break;var j=i._model.getCharCount();
if(i.start+j>b-e){c=b-(i.start+e);f+=i._model.getLineAtOffset(c);e+=c;break}f+=i._model.getLineCount()-1-i._lineCount;e+=j-(i.end-i.start)}return a.getLineAtOffset(b-e)+f},getLineCount:function(){for(var b=this._projections,a=this._model.getLineCount(),c=0;c<b.length;c++){var e=b[c];a+=e._model.getLineCount()-1-e._lineCount}return a},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(b,a){if(b<0)return-1;for(var c=this._model,e=this._projections,f=0,g=0,i=0;i<e.length;i++){var j=
e[i];if(j._lineIndex>b-f)break;var h=j._model.getLineCount()-1;if(j._lineIndex+h>b-f)return j._model.getLineEnd(b-(j._lineIndex+f),a)+j.start+g;g+=j._model.getCharCount()-(j.end-j.start);f+=h-j._lineCount}return c.getLineEnd(b-f,a)+g},getLineStart:function(b){if(b<0)return-1;for(var a=this._model,c=this._projections,e=0,f=0,g=0;g<c.length;g++){var i=c[g];if(i._lineIndex>=b-e)break;var j=i._model.getLineCount()-1;if(i._lineIndex+j>=b-e)return i._model.getLineStart(b-(i._lineIndex+e))+i.start+f;f+=
i._model.getCharCount()-(i.end-i.start);e+=j-i._lineCount}return a.getLineStart(b-e)+f},getText:function(b,a){if(b===undefined)b=0;var c=this._model,e=this._projections,f=0,g=[],i,j,h;for(i=0;i<e.length;i++){j=e[i];if(j.start>b-f)break;h=j._model.getCharCount();if(j.start+h>b-f)if(a!==undefined&&j.start+h>a-f)return j._model.getText(b-(j.start+f),a-(j.start+f));else{g.push(j._model.getText(b-(j.start+f)));b=j.end+f+h-(j.end-j.start)}f+=h-(j.end-j.start)}b=b-f;if(a!==undefined){for(;i<e.length;i++){j=
e[i];if(j.start>a-f)break;g.push(c.getText(b,j.start));h=j._model.getCharCount();if(j.start+h>a-f){g.push(j._model.getText(0,a-(j.start+f)));return g.join("")}g.push(j._model.getText());b=j.end;f+=h-(j.end-j.start)}g.push(c.getText(b,a-f))}else{for(;i<e.length;i++){j=e[i];g.push(c.getText(b,j.start));g.push(j._model.getText());b=j.end}g.push(c.getText(b))}return g.join("")},_onChanging:function(b,a,c,e,f,g){for(var i=this._model,j=this._projections,h,l=0,p,t=a+c;h<j.length;h++){c=j[h];if(c.start>
a)break;l+=c._model.getCharCount()-(c.end-c.start)}a=a+l;for(var r=h;h<j.length;h++){c=j[h];if(c.start>t)break;l+=c._model.getCharCount()-(c.end-c.start);p+=c._model.getLineCount()-1-c._lineCount}c=t+l;l=h;this.onChanging(a,c-a,e,f+p,g);j.splice(j,l-r);for(b=b.length-(c-a);h<j.length;h++){c=j[h];c.start+=b;c.end+=b;c._lineIndex=i.getLineAtOffset(c.start)}},onChanging:function(b){for(var a=0;a<this._listeners.length;a++){var c=this._listeners[a];c&&c.onChanging&&c.onChanging(b)}},onChanged:function(b){for(var a=
0;a<this._listeners.length;a++){var c=this._listeners[a];c&&c.onChanged&&c.onChanged(b)}},setLineDelimiter:function(b){this._model.setLineDelimiter(b)},setText:function(b,a,c){if(b===undefined)b="";if(a===undefined)a=0;var e=a,f=c,g=this._model,i=this._projections,j=0,h=0,l,p,t,r,s,v=0;for(l=0;l<i.length;l++){p=i[l];if(p.start>a-j)break;t=p._model.getCharCount();if(p.start+t>a-j)if(c!==undefined&&p.start+t>c-j){p._model.setText(b,a-(p.start+j),c-(p.start+j));return}else{v=p._model.getLineCount()-
1-p._model.getLineAtOffset(a-(p.start+j));r={projection:p,start:a-(p.start+j)};a=p.end+j+t-(p.end-p.start)}h+=p._model.getLineCount()-1-p._lineCount;j+=t-(p.end-p.start)}a=a-j;var z=l;v=g.getLineAtOffset(a)+h-v;if(c!==undefined)for(;l<i.length;l++){p=i[l];if(p.start>c-j)break;t=p._model.getCharCount();if(p.start+t>c-j){h+=p._model.getLineAtOffset(c-(p.start+j));t=c-(p.start+j);c=p.end+j;s={projection:p,end:t};break}h+=p._model.getLineCount()-1-p._lineCount;j+=t-(p.end-p.start)}else{for(;l<i.length;l++){p=
i[l];h+=p._model.getLineCount()-1-p._lineCount;j+=p._model.getCharCount()-(p.end-p.start)}c=f=g.getCharCount()+j}c=c-j;l=l;p=g.getLineAtOffset(c)+h;f=f-e;h=p-v;v=b.length;for(var y=t=p=j=0;;){if(p!==-1&&p<=y)p=b.indexOf("\r",y);if(t!==-1&&t<=y)t=b.indexOf("\n",y);if(t===-1&&p===-1)break;y=p!==-1&&t!==-1?p+1===t?t+1:(p<t?p:t)+1:p!==-1?p+1:t+1;j++}this.onChanging({text:b,start:e,removedCharCount:f,addedCharCount:v,removedLineCount:h,addedLineCount:j});g.setText(b,a,c);if(r){p=r.projection;p._model.setText("",
r.start)}if(s){p=s.projection;p._model.setText("",0,s.end);p.start=p.end;p._lineCount=0}i.splice(z,l-z);b=b.length-(c-a);for(l=l;l<i.length;l++){p=i[l];p.start+=b;p.end+=b;p._lineIndex=g.getLineAtOffset(p.start)}this.onChanged({start:e,removedCharCount:f,addedCharCount:v,removedLineCount:h,addedLineCount:j})}};return d}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/textview/projectionTextModel",[],function(){return orion.textview});
define("orion/searchAndReplace/textSearcher",["require","dojo","dijit","orion/commands","dijit/Menu","dijit/MenuItem","dijit/form/DropDownButton"],function(d,b,a,c){var e=e||{};e.TextSearcher=function(){function f(g,i,j,h){this._commandService=g;this._undoStack=i;this._textSearchAdaptor=j;this._wrapSearch=this._ignoreCase=true;this._wholeWord=false;this._incremental=true;this._useRegExp=false;this._findAfterReplace=true;this._reverse=false;this.isMac=navigator.platform.indexOf("Mac")!==-1;this._searchRange=
null;this._searchOnRange=false;this._lastSearchString="";this._toolBarId="optionalPageActions";this.setOptions(h)}f.prototype={_createActionTable:function(){var g=this,i=document.getElementById(this._toolBarId),j=document.createElement("table");i.appendChild(j);i=document.createElement("tr");j.appendChild(i);i.align="right";j.align="right";var h=document.createElement("td");i.appendChild(h);var l=document.createElement("input");l.type="text";l.name="Find:";l.id="localSearchFindWith";l.placeholder=
"Find With";l.onkeyup=function(p){return g._handleKeyUp(p)};l.onkeydown=function(p){return g._handleKeyDown(p,true)};h.appendChild(l);h=document.createElement("td");h.id="localSearchFindCommands";i.appendChild(h);h=document.createElement("td");i.appendChild(h);l=document.createElement("input");l.type="text";l.name="ReplaceWith:";l.id="localSearchReplaceWith";l.placeholder="Replace With";b.addClass(l,"searchCmdGroupMargin");l.onkeydown=function(p){return g._handleKeyDown(p,false)};h.appendChild(l);
h=document.createElement("td");h.id="localSearchReplaceCommands";i.appendChild(h);h=document.createElement("td");h.id="localSearchOtherCommands";i.appendChild(h);h=document.createElement("td");i.appendChild(h);h=document.createElement("td");i.appendChild(h);h=document.createElement("td");i.appendChild(h);(l=a.byId("searchOptMenu"))&&l.destroy();l=new a.Menu({style:"display: none;",id:"searchOptMenu"});l.addChild(new a.CheckedMenuItem({label:"Case sensitive",checked:!g._ignoreCase,onChange:function(p){g.setOptions({ignoreCase:!p})}}));
l.addChild(new a.CheckedMenuItem({label:"Wrap search",checked:g._wrapSearch,onChange:function(p){g.setOptions({wrapSearch:p})}}));l.addChild(new a.CheckedMenuItem({label:"Incremental search",checked:g._incremental,onChange:function(p){g.setOptions({incremental:p})}}));l.addChild(new a.CheckedMenuItem({label:"Regular expression",checked:g._useRegExp,onChange:function(p){g.setOptions({useRegExp:p})}}));l.addChild(new a.CheckedMenuItem({label:"Find after replace",checked:g._findAfterReplace,onChange:function(p){g.setOptions({findAfterReplace:p})}}));
l=new a.form.DropDownButton({label:"Options",dropDown:l});b.addClass(l.domNode,"commandImage");b.place(l.domNode,h,"last");h=document.createElement("td");h.id="localSearchCloseCommands";i.appendChild(h);return j},visible:function(){return this._visible},_handleKeyUp:function(g){this._incremental&&!this._keyUpHandled&&!b.isIE&&this.findNext(true,null,true,g.target);this._keyUpHandled=false;return true},_handleKeyDown:function(g,i){var j=this.isMac?g.metaKey:g.ctrlKey;if(j&&g.keyCode===70){this._keyUpHandled=
i;g.stopPropagation&&g.stopPropagation();g.cancelBubble=true;return false}if(j&&g.keyCode===75||g.keyCode===13){g.stopPropagation&&g.stopPropagation();g.cancelBubble=true;this.findNext(!g.shiftKey,null,false,j&&g.keyCode===75?null:g.target);this._keyUpHandled=i;return false}if(j&&g.keyCode===82){g.stopPropagation&&g.stopPropagation();g.cancelBubble=true;i||this.replace(b.isIE?null:function(){g.target.focus()});this._keyUpHandled=i;return false}if(g.keyCode===27){this.closeUI();this._keyUpHandled=
i;return false}return true},closeUI:function(){if(this._visible){b.empty(this._toolBarId);this._refreshTopContainer();this._visible=false;this._textSearchAdaptor.adaptCloseToolBar()}},_refreshTopContainer:function(){var g=a.byId("topContainer");g&&g.layout&&g.layout()},buildToolBar:function(g){this._keyUpHandled=true;var i=document.getElementById("localSearchFindWith");if(this._visible){if(g.length>0)i.value=g;window.setTimeout(function(){i.select();i.focus()},10)}else{this._visible=true;this._createActionTable();
this._refreshTopContainer();i=document.getElementById("localSearchFindWith");i.value=g;window.setTimeout(function(){i.select();i.focus()},10);var j=this;g=new c.Command({name:"Find Next",image:d.toUrl("images/move_down.gif"),id:"orion.search.findNext",groupId:"orion.searchGroup",callback:function(){j.findNext(true)}});var h=new c.Command({name:"Find Previous",image:d.toUrl("images/move_up.gif"),id:"orion.search.findPrev",groupId:"orion.searchGroup",callback:function(){j.findNext(false)}}),l=new c.Command({name:"Replace",
image:d.toUrl("images/replace.gif"),id:"orion.search.replace",groupId:"orion.searchGroup",callback:function(){j.replace()}}),p=new c.Command({name:"Replace All",image:d.toUrl("images/replaceAll.gif"),id:"orion.search.replaceAll",groupId:"orion.searchGroup",callback:function(){j.replaceAll()}}),t=new c.Command({name:"Close",image:d.toUrl("images/delete.gif"),id:"orion.search.closeUI",groupId:"orion.searchGroup",callback:function(){j.closeUI()}});this._commandService.addCommand(g,"dom");this._commandService.addCommand(h,
"dom");this._commandService.addCommand(l,"dom");this._commandService.addCommand(p,"dom");this._commandService.addCommand(t,"dom");this._commandService.registerCommandContribution("orion.search.findNext",1,"localSearchFindCommands");this._commandService.registerCommandContribution("orion.search.findPrev",2,"localSearchFindCommands");this._commandService.registerCommandContribution("orion.search.replace",1,"localSearchReplaceCommands");this._commandService.registerCommandContribution("orion.search.replaceAll",
2,"localSearchReplaceCommands");this._commandService.registerCommandContribution("orion.search.closeUI",1,"localSearchCloseCommands");this._commandService.renderCommands("localSearchFindCommands","dom",j,j,"image","searchCommandImage",null,false,"searchCommandOver","searchCommandLink");this._commandService.renderCommands("localSearchReplaceCommands","dom",j,j,"image","searchCommandImage",null,false,"searchCommandOver","searchCommandLink");this._commandService.renderCommands("localSearchCloseCommands",
"dom",j,j,"image","searchCommandImage",null,false,"searchCommandOver","searchCommandLink")}},_findString:function(g,i,j,h,l,p){if(l){if(g){i=i.split("").reverse().join("");j=j.split("").reverse().join("")}h=i.length-h-1;h=i.indexOf(j,h);if(h===-1){if(p&&g)return this._findString(false,i,j,i.length-1,l,p)}else return{index:i.length-j.length-h,length:j.length}}else{h=i.indexOf(j,h);if(h===-1){if(p&&g)return this._findString(false,i,j,0)}else return{index:h,length:j.length}}return null},getAdaptor:function(){return this._textSearchAdaptor},
setOptions:function(g){if(g){if(g.ignoreCase===true||g.ignoreCase===false)this._ignoreCase=g.ignoreCase;if(g.wrapSearch===true||g.wrapSearch===false)this._wrapSearch=g.wrapSearch;if(g.wholeWord===true||g.wholeWord===false)this._wholeWord=g.wholeWord;if(g.incremental===true||g.incremental===false)this._incremental=g.incremental;if(g.useRegExp===true||g.useRegExp===false)this._useRegExp=g.useRegExp;if(g.findAfterReplace===true||g.findAfterReplace===false)this._findAfterReplace=g.findAfterReplace;if(g.reverse===
true||g.reverse===false)this._reverse=g.reverse;if(g.toolBarId)this._toolBarId=g.toolBarId;if(g.searchRange)this._searchRange=g.searchRange;if(g.searchOnRange===true||g.searchOnRange===false)this._searchOnRange=g.searchOnRange}},findNext:function(g,i,j,h){this.setOptions({reverse:!g});var l=document.getElementById("localSearchFindWith");j=this._textSearchAdaptor.getSearchStartIndex(j?true:!g);if(this._visible)return this.findOnce(i?i:l.value,j,h&&!b.isIE?function(){h.focus()}:null);else if(this._lastSearchString&&
this._lastSearchString.length>0){i=this._prepareFind(i?i:this._lastSearchString,j);return this._doFind(i.text,i.searchStr,i.startIndex,!g,this._wrapSearch)}},startUndo:function(){this._undoStack&&this._undoStack.startCompoundChange()},endUndo:function(){this._undoStack&&this._undoStack.endCompoundChange()},replace:function(g){this.startUndo();this._textSearchAdaptor.adaptReplace(document.getElementById("localSearchReplaceWith").value,g);this.endUndo();var i=document.getElementById("localSearchFindWith");
if(this._findAfterReplace&&i.value.length>0){i=this._prepareFind(i.value,this._textSearchAdaptor.getSearchStartIndex(false));this._doFind(i.text,i.searchStr,i.startIndex,false,this._wrapSearch,g)}},_prepareFind:function(g,i){var j;if(this._searchOnRange&&this._searchRange){j=this._textSearchAdaptor.getText().substring(this._searchRange.start,this._searchRange.end);i-=this._searchRange.start}else j=this._textSearchAdaptor.getText();if(this._ignoreCase){g=g.toLowerCase();j=j.toLowerCase()}if(i<0)i=
0;return{text:j,searchStr:g,startIndex:i}},_doFind:function(g,i,j,h,l,p){if(!i||i.length===0)return null;this._lastSearchString=i;if(this._useRegExp){var t=this.parseRegExp("/"+i+"/");if(t){i=t.pattern;t=t.flags;t+=this._ignoreCase&&t.indexOf("i")===-1?"i":"";result=this._findRegExp(true,g,i,t,j,h,l)}}else result=this._findString(true,g,i,j,h,l);result?this._textSearchAdaptor.adaptFind(result.index,result.index+result.length,h,p,this._replacingAll):this._textSearchAdaptor.adaptFind(-1,-1,h,null,this._replacingAll);
return result},findOnce:function(g,i,j){g=this._prepareFind(g,i);return this._doFind(g.text,g.searchStr,g.startIndex,this._reverse,this._wrapSearch,j)},replaceAll:function(){var g=document.getElementById("localSearchFindWith").value;if(g&&g.length>0){this._replacingAll=true;this._textSearchAdaptor.adaptReplaceAllStart(true);window.setTimeout(b.hitch(this,function(){for(var i=0,j=0;;){var h=this._prepareFind(g,i);if(!this._doFind(h.text,h.searchStr,h.startIndex,false,false))break;j++;j===1&&this.startUndo();
this._textSearchAdaptor.adaptReplace(document.getElementById("localSearchReplaceWith").value);i=this._textSearchAdaptor.getSearchStartIndex(true,true)}j>0&&this.endUndo();this._textSearchAdaptor.adaptReplaceAllEnd(i>0,j);this._replacingAll=false}),100)}},_findRegExp:function(g,i,j,h,l,p,t){if(!j)return null;h=h||"";h+=(h.indexOf("g")===-1?"g":"")+(h.indexOf("m")===-1?"m":"");g=new RegExp(j,h);h=j=null;if(p)for(;;)if(j=g.exec(i)){if(!(j.index<=l)){if(!t)return h;if(h)return h;l=i.length-1}h={index:j.index,
length:j[0].length}}else return h;else{j=g.exec(i.substring(l));if(!j&&t){l=0;j=g.exec(i.substring(l))}return j&&{index:j.index+l,length:j[0].length}}},parseRegExp:function(g){if(g=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(g))return{pattern:g[1],flags:g[2]};return null}};return f}();return e});
define("orion/searchAndReplace/orionTextSearchAdaptor",[],function(){var d=d||{};d.OrionTextSearchAdaptor=function(){function b(a){this.setEditor(a)}b.prototype={setEditor:function(a){this._editor=a},getText:function(){return this._editor.getText()},getSearchStartIndex:function(a,c){var e=this._editor.getCaretOffset();if(a){a=this._editor.getSelection();var f=a.end>a.start?a.end-a.start:0;if(!c)return e-f-1>0?e-f-1:0;return a.end>0?a.end:0}return e>0?e:0},adaptCloseToolBar:function(){this._editor.getTextView().focus()},
adaptReplaceAllStart:function(){this._editor.reportStatus("",false);this._editor.reportStatus("Replacing all...",false,true)},adaptReplaceAllEnd:function(a,c){this._editor.reportStatus("",false,true);a?this._editor.reportStatus("Replaced "+c+" matches",false):this._editor.reportStatus("Nothing replaced",true)},adaptFind:function(a,c,e,f,g){if(a===-1)g||this._editor.reportStatus("Not found",true);else{g||this._editor.reportStatus("",false);this._editor.moveSelection(a,c,f)}},adaptReplace:function(a){var c=
this._editor.getSelection();this._editor.setText(a,c.start,c.end);this._editor.setSelection(c.start,c.start+a.length,true)}};return b}();return d});
define("dojox/layout/ToggleSplitter",["dojo","dijit","dijit/layout/BorderContainer"],function(d,b){d.declare("dojox.layout.ToggleSplitter",[b.layout._Splitter],{open:true,closedThreshold:5,openSize:"",_closedSize:"0",templateString:'<div class="dijitSplitter dojoxToggleSplitter" dojoAttachEvent="onkeypress:_onKeyPress,onmousedown:_onMouseDown" tabIndex="0" role="separator"><div dojoAttachPoint="toggleNode" class="dijitSplitterThumb dojoxToggleSplitterIcon"></div></div>',postCreate:function(){this._started=
false;this.inherited(arguments);var a=this.region;d.addClass(this.domNode,"dojoxToggleSplitter"+a.charAt(0).toUpperCase()+a.substring(1));this.connect(this,"onDblClick","_toggleMe")},startup:function(){this.inherited(arguments);var a=this.child.domNode,c=d.style(a,this.horizontal?"height":"width");d.forEach(["toggleSplitterOpen","toggleSplitterClosedThreshold","toggleSplitterOpenSize"],function(e){var f=e.substring(14);f=f.charAt(0).toLowerCase()+f.substring(1);if(e in this.child)this[f]=this.child[e]},
this);if(!this.openSize)this.openSize=this.open?c+"px":"75px";this._openStyleProps=this._getStyleProps(a,true);this._started=true;this.set("open",this.open);return this},_onMouseUp:function(){d.disconnect(this._onMoveHandle);d.disconnect(this._onUpHandle);delete this._onMoveHandle;delete this._onUpHandle;delete this._startPosn},_onPrelimMouseMove:function(a){if(Math.abs((this._startPosn||0)-(this.horizontal?a.clientY:a.clientX))>=3){d.disconnect(this._onMoveHandle);this._startDrag(a)}},_onMouseDown:function(a){if(this.open){if(!this._onUpHandle)this._onUpHandle=
d.connect(d.body(),"onmouseup",this,"_onMouseUp");if(!this._onMoveHandle){this._startPosn=this.horizontal?a.clientY:a.clientX;this._onMoveHandle=d.connect(d.body(),"onmousemove",this,"_onPrelimMouseMove")}}},_handleOnChange:function(){var a=this.child.domNode,c;c=this.horizontal?"height":"width";if(this.open){var e=d.mixin({display:"block",overflow:"auto",visibility:"visible"},this._openStyleProps);e[c]=this._openStyleProps&&this._openStyleProps[c]?this._openStyleProps[c]:this.openSize;d.style(a,
e);this.connect(this.domNode,"onmousedown","_onMouseDown")}else{e=d.getComputedStyle(a);c=this._getStyleProps(a,true,e);e=this._getStyleProps(a,false,e);this._openStyleProps=c;d.style(a,e)}this._setStateClass();this.container._started&&this.container._layoutChildren(this.region)},_getStyleProps:function(a,c,e){e||(e=d.getComputedStyle(a));var f={},g=this.horizontal?"height":"width";f.visibility=c?e.visibility:"hidden";f[g]=c?a.style[g]||e[g]:this._closedSize;var i=["Top","Right","Bottom","Left"];
d.forEach(["padding","margin","border"],function(j){for(var h=0;h<i.length;h++){var l=j+i[h];if(j=="border")j+="Width";if(undefined!==e[l])f[l]=c?e[l]:0}});return f},_setStateClass:function(){if(this.open){d.removeClass(this.domNode,"dojoxToggleSplitterClosed");d.addClass(this.domNode,"dojoxToggleSplitterOpen");d.removeClass(this.toggleNode,"dojoxToggleSplitterIconClosed");d.addClass(this.toggleNode,"dojoxToggleSplitterIconOpen")}else{d.addClass(this.domNode,"dojoxToggleSplitterClosed");d.removeClass(this.domNode,
"dojoxToggleSplitterOpen");d.addClass(this.toggleNode,"dojoxToggleSplitterIconClosed");d.removeClass(this.toggleNode,"dojoxToggleSplitterIconOpen")}},_setOpenAttr:function(a){if(this._started){this.open=a;this._handleOnChange(a,true);this[this.open?"onOpen":"onClose"](this.child)}},onOpen:function(){},onClose:function(){},_toggleMe:function(a){a&&d.stopEvent(a);this.set("open",!this.open)},_onKeyPress:function(){this.inherited(arguments)}});d.extend(b._Widget,{toggleSplitterOpen:true,toggleSplitterClosedThreshold:5,
toggleSplitterOpenSize:""})});
define("orion/widgets/eWebBorderContainer",["dojo","dijit","dijit/layout/BorderContainer","dojox/layout/ToggleSplitter"],function(d,b){d.declare("orion.widgets.eWebBorderContainer",b.layout.BorderContainer,{_splitterClass:"orion.widgets.eWebSplitter",getPreferredLeftPaneWidth:function(){var a=this.getSizeCookie();return a<=0?d.position(this.getRightPane()).w*0.25:a},isLeftPaneOpen:function(){var a=this.getSplitter("left");if(a)return a.open;return false},getLeftPane:function(){if(this._left)return this._left;for(var a=
this.getChildren(),c=0;c<a.length;c++)if(a[c].region&&(a[c].region==="leading"||a[c].region==="left"))return this._left=a[c].domNode},getHidingPane:function(){return this.getLeftPane()},getRightPane:function(){if(this._center)return this._center;for(var a=this.getChildren(),c=0;c<a.length;c++)if(a[c].region&&a[c].region==="center")return this._center=a[c].domNode},getSizeCookie:function(){var a=this.getSplitter("left");if(a)return a.getSizeCookie();return 0},setSizeCookie:function(a){var c=this.getSplitter("left");
if(c)return c.setSizeCookie(a)},toggleLeftPaneState:function(){var a=this.getSplitter("left");a&&a.toggleHidingPaneState()},setToggleCallback:function(a){this.toggleCallback=a},toggle:function(){if(!this._left||!this._center)for(var a=this.getChildren(),c=0;c<a.length;c++)if(a[c].region&&a[c].region==="center")this._center=a[c].domNode;else if(a[c].region&&(a[c].region==="leading"||a[c].region==="left"))this._left=a[c].domNode;var e=this._left,f=this._center,g=d.position(e).w,i=this.isLeftPaneOpen(),
j;j=i?0:this.getPreferredLeftPaneWidth();i||this.toggleLeftPaneState();var h=e.style.overflow,l=f.style.overflow;(new d.Animation({node:e,duration:300,curve:[1,100],onAnimate:d.hitch(this,function(p){e.style.width=g+(j-g)*p/100+"px";e.style.overflow="hidden";f.style.overflow="hidden";this.layout()}),onEnd:d.hitch(this,function(){f.style.overflow=l;e.style.overflow=h;this.toggleCallback&&this.toggleCallback.apply();i?this.toggleLeftPaneState():this.setSizeCookie(null)})})).play()}});d.declare("orion.widgets.eWebSplitter",
dojox.layout.ToggleSplitter,{postCreate:function(){this.inherited(arguments);this.connect(this.toggleNode,"onmousedown","_onThumbMouseDown");this.connect(this.toggleNode,"onmouseover","_onThumbMouseOver");this.connect(this.domNode,"onmouseover","_onMouseOver");this.connect(this.toggleNode,"onmouseout","_onThumbMouseOut");this._openStateCookieName=this.container.id+"_"+this.region+"_open"},startup:function(){this.inherited(arguments);if(this.container.persist){var a=d.cookie(this._openStateCookieName);
if(a==="true")this.container.getHidingPane().style.width=this.getSizeCookie()+"px";else{a==="false"?this.set("open",false):this.set("open",true);this._handleOnChange()}}else{this.set("open",true);this._handleOnChange()}return this},_handleOnChange:function(){var a=this.child.domNode,c;c=this.horizontal?"height":"width";if(this.open){var e=d.mixin({display:"block",overflow:"auto",visibility:"visible"},this._openStyleProps);e[c]=this._openStyleProps&&this._openStyleProps[c]?this._openStyleProps[c]:
this.openSize;d.style(a,e);this.connect(this.domNode,"onmousedown","_onMouseDown")}else{e=d.getComputedStyle(a);c=this._getStyleProps(a,true,e);e=this._getStyleProps(a,false,e);this._openStyleProps=c;d.style(a,e)}this._setStateClass();if(this.container._started){a=0;if(this.open&&this.openSize)a=parseInt(this.openSize.replace("px",""),10);this.container._layoutChildren(this.region,a)}},_removeFocusVisual:function(a){d.stopEvent(a)},_onMouseDown:function(a){this.open?this._startDrag(a):this._removeFocusVisual(a)},
_onMouseOver:function(){this.domNode.style.cursor=this.open?"e-resize":"default"},_onThumbMouseDown:function(a){a.stopPropagation();this._removeFocusVisual(a);this.container.toggle()},_onThumbMouseOver:function(){this.toggleNode.style.backgroundColor="#AAAAAA"},_onThumbMouseOut:function(){this.toggleNode.style.backgroundColor="#DDDDDD"},_toggleMe:function(){},getSizeCookie:function(){if(this.container.persist){var a=d.cookie(this._cookieName);if(a)return parseInt(a.replace("px",""),10)}return 0},
setSizeCookie:function(){if(this.container.persist)d.cookie(this._cookieName,this.child.domNode.style[this.horizontal?"height":"width"],{expires:365})},toggleHidingPaneState:function(){this.set("open",!this.open);this.container.getHidingPane().style.visibility=this.open?"visible":"hidden";if(this.container.persist)d.cookie(this._openStateCookieName,this.open?"true":"false",{expires:365})}});d.declare("orion.widgets.eWebBorderContainerReverse",b.layout.BorderContainer,{_splitterClass:"orion.widgets.eWebSplitter",
getPreferredRightPaneWidth:function(){var a=this.getSizeCookie();return a<=0?d.position(this.getLeftPane()).w*0.25:a},isRightPaneOpen:function(){var a=this.getSplitter("right");if(a)return a.open;return false},getRightPane:function(){if(this._right)return this._right;for(var a=this.getChildren(),c=0;c<a.length;c++)if(a[c].region&&(a[c].region==="trailing"||a[c].region==="right"))return this._right=a[c].domNode},getHidingPane:function(){return this.getRightPane()},getLeftPane:function(){if(this._center)return this._center;
for(var a=this.getChildren(),c=0;c<a.length;c++)if(a[c].region&&a[c].region==="center")return this._center=a[c].domNode},getSizeCookie:function(){var a=this.getSplitter("right");if(a)return a.getSizeCookie();return 0},setSizeCookie:function(a){var c=this.getSplitter("right");if(c)return c.setSizeCookie(a)},toggleRightPaneState:function(){var a=this.getSplitter("right");a&&a.toggleHidingPaneState()},setToggleCallback:function(a){this.toggleCallback=a},toggle:function(){if(!this._right||!this._center)for(var a=
this.getChildren(),c=0;c<a.length;c++)if(a[c].region&&a[c].region==="center")this._center=a[c].domNode;else if(a[c].region&&(a[c].region==="trailing"||a[c].region==="right"))this._right=a[c].domNode;var e=this._right,f=this._center,g=d.position(e).w,i=this.isRightPaneOpen(),j;j=i?0:this.getPreferredRightPaneWidth();i||this.toggleRightPaneState();var h=e.style.overflow,l=f.style.overflow;(new d.Animation({node:e,duration:300,curve:[1,100],onAnimate:d.hitch(this,function(p){e.style.width=g+(j-g)*p/
100+"px";e.style.overflow="hidden";f.style.overflow="hidden";this.layout()}),onEnd:d.hitch(this,function(){f.style.overflow=l;e.style.overflow=h;this.toggleCallback&&this.toggleCallback.apply();i?this.toggleRightPaneState():this.setSizeCookie(null)})})).play()}})});
define("setup",["require","dojo","orion/selection","orion/status","orion/dialogs","orion/commands","orion/util","orion/favorites","orion/fileClient","orion/searchClient","orion/globalCommands","orion/outliner","orion/problems","orion/editor/contentAssist","orion/editorCommands","orion/editor/editorFeatures","orion/editor/editor","orion/syntaxchecker","orion/editor/textMateStyler","orion/breadcrumbs","examples/textview/textStyler","orion/textview/textView","orion/textview/textModel","orion/textview/projectionTextModel",
"orion/textview/keyBinding","orion/searchAndReplace/textSearcher","orion/searchAndReplace/orionTextSearchAdaptor","dojo/parser","dojo/hash","dijit/layout/BorderContainer","dijit/layout/ContentPane","orion/widgets/eWebBorderContainer"],function(d,b,a,c,e,f,g,i,j,h,l,p,t,r,s,v,z,y,k,n,o,m,q,w,u,x,B){var C=C||{};C.setUpEditor=function(D,F,J){var K=window.document,L,R,T,S;K.body.style.visibility="visible";b.parser.parse();(function(){L=new a.Selection(D);T=new c.StatusReportingService(D,"statusPane",
"notifications");new e.DialogService(D);R=new f.CommandService({serviceRegistry:D,selection:L});new t.ProblemService(D);S=new p.OutlineService({serviceRegistry:D,preferences:F});new i.FavoritesService({serviceRegistry:D})})();var ca=dijit.byId("orion.innerCoding"),A=b.byId("outline"),E=b.byId("editor"),H=b.byId("searchFloat");b.byId("leftPane");var P=null;J||(P=function(N){var Q=new r.ContentAssist(N,"contentassist"),U=false;Q.addEventListener("show",function(){function V(la,ba,ha){Q.addProvider(ha,
la,ba)}if(!U){for(var Y=N.getTitle(),Z=D.getServiceReferences("orion.edit.contentAssist"),da=0;da<Z.length;da++){var aa=Z[da],ja=aa.getProperty("name"),ea=aa.getProperty("pattern");ea&&(new RegExp(ea)).test(Y)&&function(la,ba){D.getService(aa).then(function(ha){V(la,ba,ha)})}(ja,ea)}U=true}});return Q});for(var W=D.getServiceReferences("orion.edit.highlighter"),X={styler:null,highlight:function(N,Q){if(this.styler){this.styler.destroy();this.styler=null}if(N){var U=Q.getTextView(),V=N.split(".");
N=V.pop().toLowerCase();if(V.length>0){V=Q.getAnnotationModel();switch(N){case "js":case "json":this.styler=new o.TextStyler(U,"js",V);break;case "java":this.styler=new o.TextStyler(U,"java",V);break;case "css":this.styler=new o.TextStyler(U,"css",V);break}this.styler&&Q.setFoldingEnabled(this.styler.foldingEnabled);if(!this.styler&&W){Q=[];var Y;for(V=0;V<W.length;V++){var Z=W[V],da=Z.getProperty("fileTypes");Z.getProperty("type")==="grammar"&&Q.push(Z.getProperty("grammar"));if(da&&da.indexOf(N)!==
-1)Y=Z}if(Y){N=Y.getProperty("type");if(N==="parser")console.debug("TODO implement support for parser-based syntax highlight provider");else if(N==="grammar"||typeof N==="undefined"){Y=Y.getProperty("grammar");this.styler=new k.TextMateStyler(U,Y,Q)}}}}}}},$=D.getServiceReferences("orion.core.file"),fa=0;fa<$.length;fa++){for(var ga={},na=$[fa].getPropertyNames(),ia=0;ia<na.length;ia++)ga[na[ia]]=$[fa].getProperty(na[ia]);(new RegExp(ga.pattern)).test(b.hash())}var ka=new j.FileClient(D),pa=new h.Searcher({serviceRegistry:D,
commandService:R}),G={lastFilePath:"",setInput:function(N,Q){var U=g.getPositionInfo(N),V=U.filePath;if(V){if(V===this.lastFilePath)Q.showSelection(U.start,U.end,U.line,U.offset,U.length);else{Q.getTextView()||Q.installTextView();var Y=setTimeout(function(){Q.onInputChange(V,"Fetching "+V,null)},800);ka.read(V).then(b.hitch(this,function(Z){clearTimeout(Y);Q.onInputChange(V,null,Z);X.highlight(V,Q);Q.highlightAnnotations();Q.showSelection(U.start,U.end,U.line,U.offset,U.length)}),b.hitch(this,function(Z){clearTimeout(Y);
Q.onInputChange(V,"An error occurred: "+Z.message,null);console.error("HTTP status code: ",Z.status)}));ka.read(V,true).then(b.hitch(this,function(Z){this._fileMetadata=Z;this.setTitle(Z.Location)}),b.hitch(this,function(Z){console.error("Error loading file metadata: "+Z.message);this.setTitle(V)}))}this.lastFilePath=V}else Q.onInputChange("No File Selected","",null)},getInput:function(){return this.lastFilePath},setTitle:function(N){var Q=N.lastIndexOf("/"),U=N;if(Q!==-1){U=U.substring(Q+1);if(N.charAt(0)===
"*")U="*"+U}this._lastTitle=U;window.document.title=U;if(Q=b.byId("location")){b.empty(Q);U=g.getUserName()||"Navigator Root";new n.BreadCrumbs({container:"location",resource:this._fileMetadata,firstSegmentName:U});if(N.charAt(0)==="*")b.create("b",null,Q,"last").innerHTML="*"}},getTitle:function(){return this._lastTitle},getFileMetadata:function(){return this._fileMetadata},setDirty:function(N){if(N)this._lastTitle&&this._lastTitle.charAt(0)!=="*"&&this.setTitle("*"+this._lastTitle);else this._lastTitle&&
this._lastTitle.charAt(0)==="*"&&this.setTitle(this._lastTitle.substring(1))},hashChanged:function(N){this.shouldGoToURI(N,b.hash())?L.setSelections(b.hash()):b.hash(this.lastFilePath)},shouldGoToURI:function(N,Q){if(N.isDirty()){N=g.getPositionInfo(this.lastFilePath).filePath;Q=g.getPositionInfo(Q).filePath;if(N!==Q)return window.confirm("There are unsaved changes.  Do you still want to navigate away?")}return true}},I={handlers:[],addHandler:function(N){this.handlers.push(N)},cancel:function(){for(var N=
false,Q=0;Q<this.handlers.length;Q++)N=this.handlers[Q].cancel()||N;return N},isActive:function(){for(var N=0;N<this.handlers.length;N++)if(this.handlers[N].isActive())return true;return false},lineUp:function(){return false},lineDown:function(){return false},enter:function(){return false}};$=new v.AnnotationFactory;var M=new z.Editor({textViewFactory:function(){return new m.TextView({parent:E,model:new w.ProjectionTextModel(new q.TextModel),stylesheet:[d.toUrl("orion/textview/textview.css"),d.toUrl("orion/textview/rulers.css"),
d.toUrl("examples/textview/textstyler.css"),d.toUrl("css/default-theme.css"),d.toUrl("orion/textview/annotations.css")],tabSize:4,readonly:J})},undoStackFactory:new s.UndoCommandFactory(D,R,"pageActions"),annotationFactory:$,foldingRulerFactory:new v.FoldingRulerFactory,lineNumberRulerFactory:new v.LineNumberRulerFactory,contentAssistFactory:P,keyBindingFactory:function(N,Q,U,V){(new s.EditorCommandFactory(D,R,ka,G,"pageActions",J)).generateEditorCommands(N);var Y=new v.TextActions(N,U,new x.TextSearcher(R,
U,new B.OrionTextSearchAdaptor));Q.push(Y);Y=new orion.editor.LinkedMode(N);Q.push(Y);U=new v.SourceCodeActions(N,U,V,Y);Q.push(U);Q.push(I);N.getTextView().setKeyBinding(new u.KeyBinding("h",true),"Search Files");N.getTextView().setAction("Search Files",function(){window.setTimeout(function(){var Z=N.getTextView(),da=Z.getSelection(),aa="";if(da.end>da.start)aa=Z.getText().substring(da.start,da.end);if(aa.length<=0)aa=prompt("Enter search term:",aa);if(aa){b.connect(K,"onkeypress",b.hitch(this,function(ja){if(ja.charOrCode===
b.keys.ESCAPE)H.style.display="none"}));I.addHandler({isActive:function(){return H.style.display==="block"},cancel:function(){if(this.isActive()){H.style.display="none";return true}return false}});b.place(K.createTextNode("Searching for occurrences of "),H,"last");Z=b.create("b",null,H,"last");b.place(K.createTextNode('"'+aa+'"...'),Z,"only");H.style.display="block";aa=G.getFileMetadata().SearchLocation+aa;pa.search(H,aa,G.getInput(),false,null,false,true)}},0);return true});N.getTextView().setKeyBinding(new u.KeyBinding("o",
true),"Toggle Outliner");N.getTextView().setAction("Toggle Outliner",function(){ca.toggle();return true})},statusReporter:function(N,Q,U){if(U)T.setProgressMessage(N);else Q?T.setErrorMessage(N):T.setMessage(N)},domNode:E});D.getService("orion.core.marker").then(function(N){N.addEventListener("problemsChanged",function(Q){M.showProblems(Q)})});b.connect(M,"onDirtyChange",G,G.setDirty);D.getService("orion.page.selection").then(function(N){N.addEventListener("selectionChanged",function(Q){G.shouldGoToURI(M,
Q)&&G.setInput(Q,M)})});b.subscribe("/dojo/hashchange",G,function(){G.hashChanged(M)});G.setInput(b.hash(),M);l.generateBanner("toolbar",D,R,F,pa,M,M,I);l.generateDomCommandsInBanner(R,M);new y.SyntaxChecker(D,M);var O=new p.Outliner({parent:A,serviceRegistry:D,outlineService:D.getService("orion.edit.outline"),commandService:R,selectionService:L});b.connect(M,"onInputChange",function(N){for(var Q=D.getServiceReferences("orion.edit.outliner"),U=[],V=0;V<Q.length;V++){var Y=Q[V],Z=Y.getProperty("pattern");
Z&&(new RegExp(Z)).test(N)&&U.push(Y)}S.setOutlineProviders(U,M.getText(),M.getTitle());O.setOutlineProviders(U)});b.connect(O,"setSelectedProvider",function(N){S.setProvider(N);S.emitOutline(M.getText(),M.getTitle())});window.onbeforeunload=function(){if(M.isDirty())return"There are unsaved changes."};ca.setToggleCallback(function(){M.getTextView().redrawLines()});K.onkeydown=function(N){N=N||window.event;if(N.ctrlKey&&N.keyCode===79){ca.toggle();if(K.all)N.keyCode=0;else{N.preventDefault();N.stopPropagation()}}}};
return C});define("edit",["dojo","orion/bootstrap","./setup"],function(d,b,a){d.addOnLoad(function(){b.startup().then(function(c){a.setUpEditor(c.serviceRegistry,c.preferences,false)})})});