/*
 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 b(a,c,d){(function(){if(typeof this.loadFirebugConsole=="function")this.loadFirebugConsole();else{this.console=this.console||{};for(var e=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","profile","profileEnd","time","timeEnd","trace","warn","log"],k=0,h;h=e[k++];)console[h]||function(){var u=h+"";console[u]="log"in console?function(){var s=Array.apply({},arguments);s.unshift(u+":");console.log(s.join(" "))}:function(){};console[u]._fake=true}()}if(typeof a==
"undefined")a={_scopeName:"dojo",_scopePrefix:"",_scopePrefixArgs:"",_scopeSuffix:"",_scopeMap:{},_scopeMapRev:{}};var i=a;if(typeof c=="undefined")c={_scopeName:"dijit"};if(typeof d=="undefined")d={_scopeName:"dojox"};if(!i._scopeArgs)i._scopeArgs=[a,c,d];i.global=this;i.config={isDebug:false,debugAtAllCosts:false};if(e=typeof djConfig!="undefined"?djConfig:typeof dojoConfig!="undefined"?dojoConfig:null)for(var m in e)i.config[m]=e[m];a.locale=i.config.locale;m="$Rev: 24595 $".match(/\d+/);a.version=
{major:1,minor:6,patch:1,flag:"",revision:m?+m[0]:NaN,toString:function(){with(i.version)return major+"."+minor+"."+patch+flag+" ("+revision+")"}};typeof OpenAjax!="undefined"&&OpenAjax.hub.registerLibrary(a._scopeName,"http://dojotoolkit.org",i.version.toString());var p,t,y={};for(k in{toString:1}){p=[];break}a._extraNames=p=p||["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];t=p.length;a._mixin=function(u,s){var q,x,w;for(q in s){x=s[q];
if(!(q in u)||u[q]!==x&&(!(q in y)||y[q]!==x))u[q]=x}if(t&&s)for(w=0;w<t;++w){q=p[w];x=s[q];if(!(q in u)||u[q]!==x&&(!(q in y)||y[q]!==x))u[q]=x}return u};a.mixin=function(u){u||(u={});for(var s=1,q=arguments.length;s<q;s++)i._mixin(u,arguments[s]);return u};a._getProp=function(u,s,q){q=q||i.global;for(var x=0,w;q&&(w=u[x]);x++){if(x==0&&i._scopeMap[w])w=i._scopeMap[w];q=w in q?q[w]:s?(q[w]={}):undefined}return q};a.setObject=function(u,s,q){var x=u.split(".");u=x.pop();return(q=i._getProp(x,true,
q))&&u?(q[u]=s):undefined};a.getObject=function(u,s,q){return i._getProp(u.split("."),s,q)};a.exists=function(u,s){return i.getObject(u,false,s)!==undefined};a.eval=function(u){return i.global.eval?i.global.eval(u):eval(u)};i.deprecated=i.experimental=function(){}})();return{dojo:a,dijit:c,dojox:d}}if(this.define)define("dojo/_base/_loader/bootstrap",[],function(){var a=b();a.dojo._dijit=a.dijit;a.dojo._dojox=a.dojox;return a.dojo});else{var f=b();dojo=f.dojo;dijit=f.dijit;dojox=f.dojox}})();
define("dojo/lib/backCompat",["require","dojo/_base/_loader/bootstrap"],function(b,f){var a=["_moduleHasPrefix","_loadPath","_loadUri","_loadUriAndCheck","loaded","_callLoaded","_getModuleSymbols","_loadModule","require","provide","platformRequire","requireIf","requireAfterIf","registerModulePath"],c,d;for(c=0;c<a.length;){d=a[c++];f[d]=function(u){return function(){console.warn("dojo."+u+" not available when using an AMD loader.")}}(d)}var e=function(u){var s=[],q;for(q=0;q<u.length;)s.push(u[q++]);
return s},k=function(u,s){return s?typeof s=="string"?function(){u[s]()}:function(){s.call(u)}:u};f.ready=f.addOnLoad=function(u,s){b.ready(s?k(u,s):u)};f.addOnLoad(function(){f.postLoad=f.config.afterOnLoad=true});if(a=f.config.addOnLoad)f.addOnLoad[a instanceof Array?"apply":"call"](f,a);var h=f._loaders=[],i=function(){var u=h.slice(0);for(Array.prototype.splice.apply(h,[0,h.length]);u.length;)u.shift().call()};h.unshift=function(){Array.prototype.unshift.apply(h,e(arguments));b.ready(i)};h.splice=
function(){Array.prototype.splice.apply(h,e(arguments));b.ready(i)};var m=f._unloaders=[];f.unloaded=function(){for(;m.length;)m.pop().call()};f._onto=function(u,s,q){u.push(q?k(s,q):s)};f._modulesLoaded=function(){};f.loadInit=function(u){u()};var p=function(u){return u.replace(/\./g,"/")};f.getL10nName=function(u,s,q){q=q?q.toLowerCase():f.locale;u="i18n!"+p(u);return/root/i.test(q)?u+"/nls/"+s:u+"/nls/"+q+"/"+s};f.requireLocalization=function(u,s,q){if(b.vendor!="altoviso.com")q=!q||q.toLowerCase()===
f.locale?"root":q;return b(f.getL10nName(u,s,q))};f.i18n={getLocalization:f.requireLocalization,normalizeLocale:function(u){u=u?u.toLowerCase():f.locale;if(u=="root")u="ROOT";return u}};var t=/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/,y=/^((([^\[:]+):)?([^@]+)@)?(\[([^\]]+)\]|([^\[:]*))(:([0-9]+))?$/;f._Url=function(){for(var u=arguments,s=[u[0]],q=1;q<u.length;q++)if(u[q]){var x=new f._Url(u[q]+"");s=new f._Url(s[0]+"");if(x.path==""&&!x.scheme&&!x.authority&&!x.query){if(x.fragment!=
null)s.fragment=x.fragment;x=s}else if(!x.scheme){x.scheme=s.scheme;if(!x.authority){x.authority=s.authority;if(x.path.charAt(0)!="/"){s=(s.path.substring(0,s.path.lastIndexOf("/")+1)+x.path).split("/");for(var w=0;w<s.length;w++)if(s[w]==".")if(w==s.length-1)s[w]="";else{s.splice(w,1);w--}else if(w>0&&!(w==1&&s[0]=="")&&s[w]==".."&&s[w-1]!="..")if(w==s.length-1){s.splice(w,1);s[w-1]=""}else{s.splice(w-1,2);w-=2}x.path=s.join("/")}}}s=[];x.scheme&&s.push(x.scheme,":");x.authority&&s.push("//",x.authority);
s.push(x.path);x.query&&s.push("?",x.query);x.fragment&&s.push("#",x.fragment)}this.uri=s.join("");q=this.uri.match(t);this.scheme=q[2]||(q[1]?"":null);this.authority=q[4]||(q[3]?"":null);this.path=q[5];this.query=q[7]||(q[6]?"":null);this.fragment=q[9]||(q[8]?"":null);if(this.authority!=null){q=this.authority.match(y);this.user=q[3]||null;this.password=q[4]||null;this.host=q[6]||q[7];this.port=q[9]||null}};f._Url.prototype.toString=function(){return this.uri};f.moduleUrl=function(u,s){if(!u)return null;
u=p(u)+(s?"/"+s:"");s="";var q=u.match(/(.+)(\.[^\/]*)$/);if(q){u=q[1];s=q[2]}return new f._Url(b.nameToUrl(u,s))};return f});
define("dojo/_base/_loader/hostenv_browser",["dojo/lib/backCompat"],function(b){if(typeof window!="undefined"){b.isBrowser=true;b._name="browser";(function(){var a=b;if(document&&document.getElementsByTagName)for(var c=document.getElementsByTagName("script"),d=/dojo(\.xd)?\.js(\W|$)/i,e=0;e<c.length;e++){var k=c[e].getAttribute("src");if(k){var h=k.match(d);if(h){if(!a.config.baseUrl)a.config.baseUrl=k.substring(0,h.index);if(c=c[e].getAttribute("djConfig")||c[e].getAttribute("data-dojo-config")){c=
eval("({ "+c+" })");for(var i in c)b.config[i]=c[i]}break}}}a.baseUrl=a.config.baseUrl;i=navigator;c=i.userAgent;d=i.appVersion;e=parseFloat(d);if(c.indexOf("Opera")>=0)a.isOpera=e;if(c.indexOf("AdobeAIR")>=0)a.isAIR=1;a.isKhtml=d.indexOf("Konqueror")>=0?e:0;a.isWebKit=parseFloat(c.split("WebKit/")[1])||undefined;a.isChrome=parseFloat(c.split("Chrome/")[1])||undefined;a.isMac=d.indexOf("Macintosh")>=0;if((k=Math.max(d.indexOf("WebKit"),d.indexOf("Safari"),0))&&!b.isChrome){a.isSafari=parseFloat(d.split("Version/")[1]);
if(!a.isSafari||parseFloat(d.substr(k+7))<=419.3)a.isSafari=2}if(c.indexOf("Gecko")>=0&&!a.isKhtml&&!a.isWebKit)a.isMozilla=a.isMoz=e;if(a.isMoz)a.isFF=parseFloat(c.split("Firefox/")[1]||c.split("Minefield/")[1])||undefined;if(document.all&&!a.isOpera){a.isIE=parseFloat(d.split("MSIE ")[1])||undefined;if((c=document.documentMode)&&c!=5&&Math.floor(a.isIE)!=c)a.isIE=c}if(b.isIE&&window.location.protocol==="file:")b.config.ieForceActiveXXhr=true;a.isQuirks=document.compatMode=="BackCompat";a.locale=
b.config.locale||(a.isIE?i.userLanguage:i.language).toLowerCase();a._XMLHTTP_PROGIDS=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];a._xhrObj=function(){var q,x;if(!b.isIE||!b.config.ieForceActiveXXhr)try{q=new XMLHttpRequest}catch(w){}if(!q)for(var g=0;g<3;++g){var j=a._XMLHTTP_PROGIDS[g];try{q=new ActiveXObject(j)}catch(l){x=l}if(q){a._XMLHTTP_PROGIDS=[j];break}}if(!q)throw new Error("XMLHTTP not available: "+x);return q};a._isDocumentOk=function(q){q=q.status||0;var x=location.protocol;
return q>=200&&q<300||q==304||q==1223||!q&&(x=="file:"||x=="chrome:"||x=="chrome-extension:"||x=="app:")};var m=window.location+"";var p=(i=document.getElementsByTagName("base"))&&i.length>0;a._getText=function(q,x){var w=a._xhrObj();if(!p&&b._Url)q=(new b._Url(m,q)).toString();if(a.config.cacheBust){q+="";q+=(q.indexOf("?")==-1?"?":"&")+String(a.config.cacheBust).replace(/\W+/g,"")}w.open("GET",q,false);try{w.send(null);if(!a._isDocumentOk(w)){var g=Error("Unable to load "+q+" status:"+w.status);
g.status=w.status;g.responseText=w.responseText;throw g;}}catch(j){if(x)return null;throw j;}return w.responseText};var t=window,y=function(q,x){var w=t.attachEvent||t.addEventListener;q=t.attachEvent?q:q.substring(2);w(q,function(){x.apply(t,arguments)},false)};a._windowUnloaders=[];a.windowUnloaded=function(){for(var q=a._windowUnloaders;q.length;)q.pop()();a=null};var u=0;a.addOnWindowUnload=function(q,x){a._onto(a._windowUnloaders,q,x);if(!u){u=1;y("onunload",a.windowUnloaded)}};var s=0;a.addOnUnload=
function(q,x){a._onto(a._unloaders,q,x);if(!s){s=1;y("onbeforeunload",b.unloaded)}}})();b._initFired=false;b._loadInit=function(){if(b._scrollIntervalId){clearInterval(b._scrollIntervalId);b._scrollIntervalId=0}if(!b._initFired){b._initFired=true;!b.config.afterOnLoad&&window.detachEvent&&window.detachEvent("onload",b._loadInit);b._inFlightCount==0&&b._modulesLoaded()}};if(!b.config.afterOnLoad)if(document.addEventListener){document.addEventListener("DOMContentLoaded",b._loadInit,false);window.addEventListener("load",
b._loadInit,false)}else if(window.attachEvent){window.attachEvent("onload",b._loadInit);if(!b.config.skipIeDomLoaded&&self===self.top)b._scrollIntervalId=setInterval(function(){try{if(document.body){document.documentElement.doScroll("left");b._loadInit()}}catch(a){}},30)}if(b.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,d=1,e=document.createStyleSheet();if(b.isIE>=8){c=
1;d=a.length}for(;c<d;++c)e.addRule("v\\:"+a[c],"behavior:url(#default#VML); display:inline-block")})()}catch(f){}}(function(){var a=b.config.modulePaths;if(a)for(var c in a)b.registerModulePath(c,a[c])})();b.config.isDebug&&b.require("dojo._firebug.firebug");if(b.config.debugAtAllCosts){b.require("dojo._base._loader.loader_debug");b.require("dojo.i18n")}return b});define("dojo/lib/kernel",["dojo/_base/_loader/hostenv_browser"],function(b){return dojo=b});
define("dojo/_base/lang",["dojo/lib/kernel"],function(b){(function(){var f=Object.prototype.toString;b.isString=function(i){return typeof i=="string"||i instanceof String};b.isArray=function(i){return i&&(i instanceof Array||typeof i=="array")};b.isFunction=function(i){return f.call(i)==="[object Function]"};b.isObject=function(i){return i!==undefined&&(i===null||typeof i=="object"||b.isArray(i)||b.isFunction(i))};b.isArrayLike=function(i){return i&&i!==undefined&&!b.isString(i)&&!b.isFunction(i)&&
!(i.tagName&&i.tagName.toLowerCase()=="form")&&(b.isArray(i)||isFinite(i.length))};b.isAlien=function(i){return i&&!b.isFunction(i)&&/\{\s*\[native code\]\s*\}/.test(String(i))};b.extend=function(i){for(var m=1,p=arguments.length;m<p;m++)b._mixin(i.prototype,arguments[m]);return i};b._hitchArgs=function(i,m){var p=b._toArray(arguments,2),t=b.isString(m);return function(){var y=b._toArray(arguments),u=t?(i||b.global)[m]:m;return u&&u.apply(i||this,p.concat(y))}};b.hitch=function(i,m){if(arguments.length>
2)return b._hitchArgs.apply(b,arguments);if(!m){m=i;i=null}if(b.isString(m)){i=i||b.global;if(!i[m])throw['dojo.hitch: scope["',m,'"] is null (scope="',i,'")'].join("");return function(){return i[m].apply(i,arguments||[])}}return!i?m:function(){return m.apply(i,arguments||[])}};b.delegate=b._delegate=function(){function i(){}return function(m,p){i.prototype=m;m=new i;i.prototype=null;p&&b._mixin(m,p);return m}}();var a=function(i,m,p){return(p||[]).concat(Array.prototype.slice.call(i,m||0))},c=function(i,
m,p){p=p||[];for(m=m||0;m<i.length;m++)p.push(i[m]);return p};b._toArray=b.isIE?function(i){return(i.item?c:a).apply(this,arguments)}:a;b.partial=function(){return b.hitch.apply(b,[null].concat(b._toArray(arguments)))};var d=b._extraNames,e=d.length,k={};b.clone=function(i){if(!i||typeof i!="object"||b.isFunction(i))return i;if(i.nodeType&&"cloneNode"in i)return i.cloneNode(true);if(i instanceof Date)return new Date(i.getTime());if(i instanceof RegExp)return new RegExp(i);var m,p,t,y;if(b.isArray(i)){m=
[];p=0;for(t=i.length;p<t;++p)p in i&&m.push(b.clone(i[p]))}else m=i.constructor?new i.constructor:{};for(y in i){t=i[y];if(!(y in m)||m[y]!==t&&(!(y in k)||k[y]!==t))m[y]=b.clone(t)}if(e)for(p=0;p<e;++p){y=d[p];t=i[y];if(!(y in m)||m[y]!==t&&(!(y in k)||k[y]!==t))m[y]=t}return m};b.trim=String.prototype.trim?function(i){return i.trim()}:function(i){return i.replace(/^\s\s*/,"").replace(/\s\s*$/,"")};var h=/\{([^\}]+)\}/g;b.replace=function(i,m,p){return i.replace(p||h,b.isFunction(m)?m:function(t,
y){return b.getObject(y,false,m)})}})();return b});
define("dojo/_base/array",["dojo/lib/kernel","dojo/_base/lang"],function(b){(function(){var f=function(c,d,e){return[typeof c=="string"?c.split(""):c,d||b.global,typeof e=="string"?new Function("item","index","array",e):e]},a=function(c,d,e,k){var h=f(d,k,e);d=h[0];e=0;for(k=d.length;e<k;++e){var i=!!h[2].call(h[1],d[e],e,d);if(c^i)return i}return c};b.mixin(b,{indexOf:function(c,d,e,k){var h=1,i=c.length||0,m=0;if(k){m=i-1;h=i=-1}if(e!=undefined)m=e;if(k&&m>i||m<i)for(;m!=i;m+=h)if(c[m]==d)return m;
return-1},lastIndexOf:function(c,d,e){return b.indexOf(c,d,e,true)},forEach:function(c,d,e){if(c&&c.length){var k=f(c,e,d);c=k[0];d=0;for(e=c.length;d<e;++d)k[2].call(k[1],c[d],d,c)}},every:function(c,d,e){return a(true,c,d,e)},some:function(c,d,e){return a(false,c,d,e)},map:function(c,d,e,k){var h=f(c,e,d);c=h[0];d=k?new k:[];e=0;for(k=c.length;e<k;++e)d.push(h[2].call(h[1],c[e],e,c));return d},filter:function(c,d,e){var k=f(c,e,d);c=k[0];d=[];e=0;for(var h=c.length;e<h;++e)k[2].call(k[1],c[e],e,
c)&&d.push(c[e]);return d}})})();return b});
define("dojo/_base/declare",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array"],function(b){(function(){function f(o,r){throw new Error("declare"+(r?" "+r:"")+": "+o);}function a(o,r){for(var v=[],z=[{cls:0,refs:[]}],B={},D=1,E=o.length,F=0,J,K,O,R,X;F<E;++F){if(J=o[F])g.call(J)!="[object Function]"&&f("mixin #"+F+" is not a callable constructor.",r);else f("mixin #"+F+" is unknown. Did you use dojo.require to pull it in?",r);K=J._meta?J._meta.bases:[J];O=0;for(J=K.length-1;J>=0;--J){R=K[J].prototype;
if(!R.hasOwnProperty("declaredClass"))R.declaredClass="uniqName_"+l++;R=R.declaredClass;if(!B.hasOwnProperty(R)){B[R]={count:0,refs:[],cls:K[J]};++D}R=B[R];if(O&&O!==R){R.refs.push(O);++O.count}O=R}++O.count;z[0].refs.push(O)}for(;z.length;){O=z.pop();v.push(O.cls);for(--D;X=O.refs,X.length==1;){O=X[0];if(!O||--O.count){O=0;break}v.push(O.cls);--D}if(O){F=0;for(E=X.length;F<E;++F){O=X[F];--O.count||z.push(O)}}}D&&f("can't build consistent linearization",r);J=o[0];v[0]=J?J._meta&&J===v[v.length-J._meta.bases.length]?
J._meta.bases.length:1:0;return v}function c(o,r,v){var z,B,D,E,F,J,K,O=this._inherited=this._inherited||{};if(typeof o=="string"){z=o;o=r;r=v}v=0;E=o.callee;(z=z||E.nom)||f("can't deduce a name to call inherited()",this.declaredClass);F=this.constructor._meta;D=F.bases;K=O.p;if(z!=n){if(O.c!==E){K=0;J=D[0];F=J._meta;if(F.hidden[z]!==E){(B=F.chains)&&typeof B[z]=="string"&&f("calling chained method with inherited: "+z,this.declaredClass);do{F=J._meta;B=J.prototype;if(F&&(B[z]===E&&B.hasOwnProperty(z)||
F.hidden[z]===E))break}while(J=D[++K]);K=J?K:-1}}if(J=D[++K]){B=J.prototype;if(J._meta&&B.hasOwnProperty(z))v=B[z];else{E=w[z];do{B=J.prototype;if((v=B[z])&&(J._meta?B.hasOwnProperty(z):v!==E))break}while(J=D[++K])}}v=J&&v||w[z]}else{if(O.c!==E){K=0;if((F=D[0]._meta)&&F.ctor!==E){B=F.chains;if(!B||B.constructor!=="manual")f("calling chained constructor with inherited",this.declaredClass);for(;J=D[++K];)if((F=J._meta)&&F.ctor===E)break;K=J?K:-1}}for(;J=D[++K];)if(v=(F=J._meta)?F.ctor:J)break;v=J&&
v}O.c=v;O.p=K;if(v)return r===true?v:v.apply(this,r||o)}function d(o,r){if(typeof o=="string")return this.inherited(o,r,true);return this.inherited(o,true)}function e(o){for(var r=this.constructor._meta.bases,v=0,z=r.length;v<z;++v)if(r[v]===o)return true;return this instanceof o}function k(o,r){var v,z=0,B=q._extraNames.length;for(v in r)if(v!=n&&r.hasOwnProperty(v))o[v]=r[v];for(;z<B;++z){v=q._extraNames[z];if(v!=n&&r.hasOwnProperty(v))o[v]=r[v]}}function h(o,r){var v,z,B=0,D=q._extraNames.length;
for(v in r){z=r[v];if((z!==w[v]||!(v in w))&&v!=n){if(g.call(z)=="[object Function]")z.nom=v;o[v]=z}}for(;B<D;++B){v=q._extraNames[B];z=r[v];if((z!==w[v]||!(v in w))&&v!=n){if(g.call(z)=="[object Function]")z.nom=v;o[v]=z}}return o}function i(o){h(this.prototype,o);return this}function m(o,r){return function(){var v=arguments,z=v,B=v[0],D,E;E=o.length;var F;if(!(this instanceof v.callee))return s(v);if(r&&(B&&B.preamble||this.preamble)){F=new Array(o.length);F[0]=v;for(D=0;;){if(B=v[0])if(B=B.preamble)v=
B.apply(this,v)||v;B=o[D].prototype;if(B=B.hasOwnProperty("preamble")&&B.preamble)v=B.apply(this,v)||v;if(++D==E)break;F[D]=v}}for(D=E-1;D>=0;--D){B=o[D];if(B=(E=B._meta)?E.ctor:B)B.apply(this,F?F[D]:v)}(B=this.postscript)&&B.apply(this,z)}}function p(o,r){return function(){var v=arguments,z=v,B=v[0];if(!(this instanceof v.callee))return s(v);if(r){if(B)if(B=B.preamble)z=B.apply(this,z)||z;(B=this.preamble)&&B.apply(this,z)}o&&o.apply(this,v);(B=this.postscript)&&B.apply(this,v)}}function t(o){return function(){var r=
arguments,v=0,z,B;if(!(this instanceof r.callee))return s(r);for(;z=o[v];++v)if(z=(B=z._meta)?B.ctor:z){z.apply(this,r);break}(z=this.postscript)&&z.apply(this,r)}}function y(o,r,v){return function(){var z,B,D=0,E=1;if(v){D=r.length-1;E=-1}for(;z=r[D];D+=E){B=z._meta;(z=(B?B.hidden:z.prototype)[o])&&z.apply(this,arguments)}}}function u(o){j.prototype=o.prototype;o=new j;j.prototype=null;return o}function s(o){var r=o.callee,v=u(r);r.apply(v,o);return v}var q=b,x=q._mixin,w=Object.prototype,g=w.toString,
j=new Function,l=0,n="constructor";q.declare=function(o,r,v){if(typeof o!="string"){v=r;r=o;o=""}v=v||{};var z,B,D,E,F,J,K,O=1,R=r;if(g.call(r)=="[object Array]"){J=a(r,o);D=J[0];O=J.length-D;r=J[O]}else{J=[0];if(r)if(g.call(r)=="[object Function]"){D=r._meta;J=J.concat(D?D.bases:r)}else f("base class is not a callable constructor.",o);else r!==null&&f("unknown base class. Did you use dojo.require to pull it in?",o)}if(r)for(B=O-1;;--B){z=u(r);if(!B)break;D=J[B];(D._meta?k:x)(z,D.prototype);E=new Function;
E.superclass=r;E.prototype=z;r=z.constructor=E}else z={};h(z,v);D=v.constructor;if(D!==w.constructor){D.nom=n;z.constructor=D}for(B=O-1;B;--B)if((D=J[B]._meta)&&D.chains)K=x(K||{},D.chains);if(z["-chains-"])K=x(K||{},z["-chains-"]);D=!K||!K.hasOwnProperty(n);J[0]=E=K&&K.constructor==="manual"?t(J):J.length==1?p(v.constructor,D):m(J,D);E._meta={bases:J,hidden:v,chains:K,parents:R,ctor:v.constructor};E.superclass=r&&r.prototype;E.extend=i;E.prototype=z;z.constructor=E;z.getInherited=d;z.inherited=c;
z.isInstanceOf=e;if(o){z.declaredClass=o;q.setObject(o,E)}if(K)for(F in K)if(z[F]&&typeof K[F]=="string"&&F!=n){D=z[F]=y(F,J,K[F]==="after");D.nom=F}return E};q.safeMixin=h})();return b.declare});
define("dojo/_base/connect",["dojo/lib/kernel","dojo/_base/lang"],function(b){b._listener={getDispatcher:function(){return function(){var f=Array.prototype,a=arguments.callee,c=a._listeners;a=(a=a.target)&&a.apply(this,arguments);var d;c=[].concat(c);for(d in c)d in f||c[d].apply(this,arguments);return a}},add:function(f,a,c){f=f||b.global;var d=f[a];if(!d||!d._listeners){var e=b._listener.getDispatcher();e.target=d;e._listeners=[];d=f[a]=e}return d._listeners.push(c)},remove:function(f,a,c){(f=(f||
b.global)[a])&&f._listeners&&c--&&delete f._listeners[c]}};b.connect=function(){var f=arguments,a=[],c=0;a.push(b.isString(f[0])?null:f[c++],f[c++]);var d=f[c+1];a.push(b.isString(d)||b.isFunction(d)?f[c++]:null,f[c++]);for(d=f.length;c<d;c++)a.push(f[c]);return b._connect.apply(this,a)};b._connect=function(f,a,c,d){var e=b._listener;c=e.add(f,a,b.hitch(c,d));return[f,a,c,e]};b.disconnect=function(f){if(f&&f[0]!==undefined){b._disconnect.apply(this,f);delete f[0]}};b._disconnect=function(f,a,c,d){d.remove(f,
a,c)};b._topics={};b.subscribe=function(f,a,c){return[f,b._listener.add(b._topics,f,b.hitch(a,c))]};b.unsubscribe=function(f){f&&b._listener.remove(b._topics,f[0],f[1])};b.publish=function(f,a){if(f=b._topics[f])f.apply(this,a||[])};b.connectPublisher=function(f,a,c){var d=function(){b.publish(f,arguments)};return c?b.connect(a,c,d):b.connect(a,d)};return b.connect});
define("dojo/_base/Deferred",["dojo/lib/kernel","dojo/_base/lang"],function(b){(function(){var f=function(){},a=Object.freeze||function(){};b.Deferred=function(c){function d(u){if(h)throw new Error("This deferred has already been resolved");k=u;h=true;e()}function e(){for(var u;!u&&p;){var s=p;p=p.next;if(u=s.progress==f)h=false;var q=i?s.error:s.resolved;if(q)try{var x=q(k);if(x&&typeof x.then==="function")x.then(b.hitch(s.deferred,"resolve"),b.hitch(s.deferred,"reject"));else{q=u&&x===undefined;
if(u&&!q)i=x instanceof Error;s.deferred[q&&i?"reject":"resolve"](q?k:x)}}catch(w){s.deferred.reject(w)}else i?s.deferred.reject(k):s.deferred.resolve(k)}}var k,h,i,m,p,t=this.promise={};this.resolve=this.callback=function(u){this.fired=0;this.results=[u,null];d(u)};this.reject=this.errback=function(u){i=true;this.fired=1;d(u);this.results=[null,u];if(!u||u.log!==false)(b.config.deferredOnError||function(s){console.error(s)})(u)};this.progress=function(u){for(var s=p;s;){var q=s.progress;q&&q(u);
s=s.next}};this.addCallbacks=function(u,s){this.then(u,s,f);return this};this.then=t.then=function(u,s,q){var x=q==f?this:new b.Deferred(t.cancel);u={resolved:u,error:s,progress:q,deferred:x};if(p)m=m.next=u;else p=m=u;h&&e();return x.promise};var y=this;this.cancel=t.cancel=function(){if(!h){var u=c&&c(y);if(!h){u instanceof Error||(u=new Error(u));u.log=false;y.reject(u)}}};a(t)};b.extend(b.Deferred,{addCallback:function(){return this.addCallbacks(b.hitch.apply(b,arguments))},addErrback:function(){return this.addCallbacks(null,
b.hitch.apply(b,arguments))},addBoth:function(){var c=b.hitch.apply(b,arguments);return this.addCallbacks(c,c)},fired:-1})})();b.when=function(f,a,c,d){if(f&&typeof f.then==="function")return f.then(a,c,d);return a(f)};return b.Deferred});
define("dojo/_base/json",["dojo/lib/kernel"],function(b){b.fromJson=function(f){return eval("("+f+")")};b._escapeString=function(f){return('"'+f.replace(/(["\\])/g,"\\$1")+'"').replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")};b.toJsonIndentStr="\t";b.toJson=function(f,a,c){if(f===undefined)return"undefined";var d=typeof f;if(d=="number"||d=="boolean")return f+"";if(f===null)return"null";if(b.isString(f))return b._escapeString(f);var e=
arguments.callee,k;c=c||"";var h=a?c+b.toJsonIndentStr:"";k=f.__json__||f.json;if(b.isFunction(k)){k=k.call(f);if(f!==k)return e(k,a,h)}if(f.nodeType&&f.cloneNode)throw new Error("Can't serialize DOM nodes");k=a?" ":"";var i=a?"\n":"";if(b.isArray(f))return"["+b.map(f,function(y){y=e(y,a,h);if(typeof y!="string")y="undefined";return i+h+y}).join(","+k)+i+c+"]";if(d=="function")return null;d=[];var m;for(m in f){var p,t;if(typeof m=="number")p='"'+m+'"';else if(typeof m=="string")p=b._escapeString(m);
else continue;t=e(f[m],a,h);typeof t=="string"&&d.push(i+h+p+":"+k+t)}return"{"+d.join(","+k)+i+c+"}"};return b});
define("dojo/_base/Color",["dojo/lib/kernel","dojo/_base/array","dojo/_base/lang"],function(b){(function(){b.Color=function(f){f&&this.setColor(f)};b.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:b.config.transparentColor||[255,255,255]};b.extend(b.Color,
{r:255,g:255,b:255,a:1,_set:function(f,a,c,d){this.r=f;this.g=a;this.b=c;this.a=d},setColor:function(f){if(b.isString(f))b.colorFromString(f,this);else if(b.isArray(f))b.colorFromArray(f,this);else{this._set(f.r,f.g,f.b,f.a);f instanceof b.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"#"+b.map(["r","g","b"],function(f){f=this[f].toString(16);return f.length<
2?"0"+f:f},this).join("")},toCss:function(f){var a=this.r+", "+this.g+", "+this.b;return(f?"rgba("+a+", "+this.a:"rgb("+a)+")"},toString:function(){return this.toCss(true)}});b.blendColors=function(f,a,c,d){var e=d||new b.Color;b.forEach(["r","g","b","a"],function(k){e[k]=f[k]+(a[k]-f[k])*c;if(k!="a")e[k]=Math.round(e[k])});return e.sanitize()};b.colorFromRgb=function(f,a){return(f=f.toLowerCase().match(/^rgba?\(([\s\.,0-9]+)\)/))&&b.colorFromArray(f[1].split(/\s*,\s*/),a)};b.colorFromHex=function(f,
a){var c=a||new b.Color,d=f.length==4?4:8,e=(1<<d)-1;f=Number("0x"+f.substr(1));if(isNaN(f))return null;b.forEach(["b","g","r"],function(k){var h=f&e;f>>=d;c[k]=d==4?17*h:h});c.a=1;return c};b.colorFromArray=function(f,a){a=a||new b.Color;a._set(Number(f[0]),Number(f[1]),Number(f[2]),Number(f[3]));if(isNaN(a.a))a.a=1;return a.sanitize()};b.colorFromString=function(f,a){var c=b.Color.named[f];return c&&b.colorFromArray(c,a)||b.colorFromRgb(f,a)||b.colorFromHex(f,a)}})();return b.Color});
define("dojo/_base/window",["dojo/lib/kernel"],function(b){b.doc=window.document||null;b.body=function(){return b.doc.body||b.doc.getElementsByTagName("body")[0]};b.setContext=function(f,a){b.global=f;b.doc=a};b.withGlobal=function(f,a,c,d){var e=b.global;try{b.global=f;return b.withDoc.call(null,f.document,a,c,d)}finally{b.global=e}};b.withDoc=function(f,a,c,d){var e=b.doc,k=b._bodyLtr,h=b.isQuirks;try{b.doc=f;delete b._bodyLtr;b.isQuirks=b.doc.compatMode=="BackCompat";if(c&&typeof a=="string")a=
c[a];return a.apply(c,d||[])}finally{b.doc=e;delete b._bodyLtr;if(k!==undefined)b._bodyLtr=k;b.isQuirks=h}};return b});
define("dojo/_base/event",["dojo/lib/kernel","dojo/_base/connect"],function(b){(function(){var f=b._event_listener={add:function(i,m,p){if(i){m=f._normalizeEventName(m);p=f._fixCallback(m,p);if(!b.isIE&&(m=="mouseenter"||m=="mouseleave")){var t=p;m=m=="mouseenter"?"mouseover":"mouseout";p=function(y){if(!b.isDescendant(y.relatedTarget,i))return t.call(this,y)}}i.addEventListener(m,p,false);return p}},remove:function(i,m,p){if(i){m=f._normalizeEventName(m);if(!b.isIE&&(m=="mouseenter"||m=="mouseleave"))m=
m=="mouseenter"?"mouseover":"mouseout";i.removeEventListener(m,p,false)}},_normalizeEventName:function(i){return i.slice(0,2)=="on"?i.slice(2):i},_fixCallback:function(i,m){return i!="keypress"?m:function(p){return m.call(this,f._fixEvent(p,this))}},_fixEvent:function(i){switch(i.type){case "keypress":f._setKeyChar(i);break}return i},_setKeyChar:function(i){i.keyChar=i.charCode>=32?String.fromCharCode(i.charCode):"";i.charOrCode=i.keyChar||i.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}};b.fixEvent=function(i,m){return f._fixEvent(i,m)};b.stopEvent=function(i){i.preventDefault();i.stopPropagation()};var a=b._listener;b._connect=function(i,m,p,t,y){y=i&&(i.nodeType||i.attachEvent||i.addEventListener)?y?2:1:0;p=[b._listener,f,a][y].add(i,m,b.hitch(p,t));return[i,m,p,y]};b._disconnect=function(i,m,p,t){[b._listener,f,a][t].remove(i,m,p)};b.keys={BACKSPACE:8,TAB:9,CLEAR:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,META:b.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:b.isMac&&!b.isAIR?b.isSafari?91:224:17};var c=b.isMac?"metaKey":"ctrlKey";b.isCopyKey=function(i){return i[c]};b.mouseButtons=b.isIE<9||b.isIE&&b.isQuirks?{LEFT:1,MIDDLE:4,RIGHT:2,isButton:function(i,m){return i.button&m},isLeft:function(i){return i.button&1},isMiddle:function(i){return i.button&4},isRight:function(i){return i.button&2}}:{LEFT:0,MIDDLE:1,RIGHT:2,isButton:function(i,m){return i.button==m},isLeft:function(i){return i.button==
0},isMiddle:function(i){return i.button==1},isRight:function(i){return i.button==2}};if(b.isIE){var d=function(i,m){try{return i.keyCode=m}catch(p){return 0}},e=b._listener,k=b._ieListenersName="_"+b._scopeName+"_listeners";if(!b.config._allow_leaks){a=e=b._ie_listener={handlers:[],add:function(i,m,p){i=i||b.global;var t=i[m];if(!t||!t[k]){var y=b._getIeDispatcher();y.target=t&&h.push(t)-1;y[k]=[];t=i[m]=y}return t[k].push(h.push(p)-1)},remove:function(i,m,p){m=(i=(i||b.global)[m])&&i[k];if(i&&m&&
p--){delete h[m[p]];delete m[p]}}};var h=e.handlers}b.mixin(f,{add:function(i,m,p){if(i){m=f._normalizeEventName(m);if(m=="onkeypress"){var t=i.onkeydown;if(!t||!t[k]||!t._stealthKeydownHandle){var y=f.add(i,"onkeydown",f._stealthKeyDown);t=i.onkeydown;t._stealthKeydownHandle=y;t._stealthKeydownRefs=1}else t._stealthKeydownRefs++}return e.add(i,m,f._fixCallback(p))}},remove:function(i,m,p){m=f._normalizeEventName(m);e.remove(i,m,p);if(m=="onkeypress"){m=i.onkeydown;if(--m._stealthKeydownRefs<=0){e.remove(i,
"onkeydown",m._stealthKeydownHandle);delete m._stealthKeydownHandle}}},_normalizeEventName:function(i){return i.slice(0,2)!="on"?"on"+i:i},_nop:function(){},_fixEvent:function(i,m){if(!i)i=(m&&(m.ownerDocument||m.document||m).parentWindow||window).event;if(!i)return i;i.target=i.srcElement;i.currentTarget=m||i.srcElement;i.layerX=i.offsetX;i.layerY=i.offsetY;m=(m=i.srcElement)&&m.ownerDocument||document;m=b.isIE<6||m.compatMode=="BackCompat"?m.body:m.documentElement;var p=b._getIeDocumentElementOffset();
i.pageX=i.clientX+b._fixIeBiDiScrollLeft(m.scrollLeft||0)-p.x;i.pageY=i.clientY+(m.scrollTop||0)-p.y;if(i.type=="mouseover")i.relatedTarget=i.fromElement;if(i.type=="mouseout")i.relatedTarget=i.toElement;if(b.isIE<9||b.isQuirks){i.stopPropagation=f._stopPropagation;i.preventDefault=f._preventDefault}return f._fixKeys(i)},_fixKeys:function(i){switch(i.type){case "keypress":var m="charCode"in i?i.charCode:i.keyCode;if(m==10){m=0;i.keyCode=13}else if(m==13||m==27)m=0;else if(m==3)m=99;i.charCode=m;f._setKeyChar(i);
break}return i},_stealthKeyDown:function(i){var m=i.currentTarget.onkeypress;if(m&&m[k]){var p=i.keyCode,t=(p!=13||b.isIE>=9&&!b.isQuirks)&&p!=32&&p!=27&&(p<48||p>90)&&(p<96||p>111)&&(p<186||p>192)&&(p<219||p>222);if(t||i.ctrlKey){t=t?0:p;if(i.ctrlKey)if(p==3||p==13)return;else if(t>95&&t<106)t-=48;else if(!i.shiftKey&&t>=65&&t<=90)t+=32;else t=f._punctMap[t]||t;p=f._synthesizeEvent(i,{type:"keypress",faux:true,charCode:t});m.call(i.currentTarget,p);if(b.isIE<9||b.isIE&&b.isQuirks)i.cancelBubble=
p.cancelBubble;i.returnValue=p.returnValue;d(i,p.keyCode)}}},_stopPropagation:function(){this.cancelBubble=true},_preventDefault:function(){this.bubbledKeyCode=this.keyCode;this.ctrlKey&&d(this,0);this.returnValue=false}});b.stopEvent=b.isIE<9||b.isQuirks?function(i){i=i||window.event;f._stopPropagation.call(i);f._preventDefault.call(i)}:b.stopEvent}f._synthesizeEvent=function(i,m){m=b.mixin({},i,m);f._setKeyChar(m);m.preventDefault=function(){i.preventDefault()};m.stopPropagation=function(){i.stopPropagation()};
return m};b.isOpera&&b.mixin(f,{_fixEvent:function(i){switch(i.type){case "keypress":var m=i.which;if(m==3)m=99;m=m<41&&!i.shiftKey?0:m;if(i.ctrlKey&&!i.shiftKey&&m>=65&&m<=90)m+=32;return f._synthesizeEvent(i,{charCode:m})}return i}});if(b.isWebKit){f._add=f.add;f._remove=f.remove;b.mixin(f,{add:function(i,m,p){if(i){var t=f._add(i,m,p);if(f._normalizeEventName(m)=="keypress")t._stealthKeyDownHandle=f._add(i,"keydown",function(y){var u=y.keyCode,s=u!=13&&u!=32&&(u<48||u>90)&&(u<96||u>111)&&(u<186||
u>192)&&(u<219||u>222);if(s||y.ctrlKey){s=s?0:u;if(y.ctrlKey)if(u==3||u==13)return;else if(s>95&&s<106)s-=48;else if(!y.shiftKey&&s>=65&&s<=90)s+=32;else s=f._punctMap[s]||s;u=f._synthesizeEvent(y,{type:"keypress",faux:true,charCode:s});p.call(y.currentTarget,u)}});return t}},remove:function(i,m,p){if(i){p._stealthKeyDownHandle&&f._remove(i,"keydown",p._stealthKeyDownHandle);f._remove(i,m,p)}},_fixEvent:function(i){switch(i.type){case "keypress":if(i.faux)return i;var m=i.charCode;m=m>=32?m:0;return f._synthesizeEvent(i,
{charCode:m,faux:true})}return i}})}})();if(b.isIE){b._ieDispatcher=function(f,a){var c=Array.prototype,d=b._ie_listener.handlers,e=f.callee,k=e[b._ieListenersName];e=(e=d[e.target])&&e.apply(a,f);k=[].concat(k);for(var h in k){var i=d[k[h]];!(h in c)&&i&&i.apply(a,f)}return e};b._getIeDispatcher=function(){return new Function(b._scopeName+"._ieDispatcher(arguments, this)")};b._event_listener._fixCallback=function(f){var a=b._event_listener._fixEvent;return function(c){return f.call(this,a(c,this))}}}return b.connect});
define("dojo/_base/html",["dojo/lib/kernel","dojo/_base/lang"],function(b){try{document.execCommand("BackgroundImageCache",false,true)}catch(f){}b.byId=b.isIE?function(a,c){if(typeof a!="string")return a;var d=c||b.doc;if((c=d.getElementById(a))&&(c.attributes.id.value==a||c.id==a))return c;else{var e=d.all[a];if(!e||e.nodeName)e=[e];for(var k=0;c=e[k++];)if(c.attributes&&c.attributes.id&&c.attributes.id.value==a||c.id==a)return c}}:function(a,c){return(typeof a=="string"?(c||b.doc).getElementById(a):
a)||null};(function(){var a=b.byId,c=null,d;b.addOnWindowUnload(function(){c=null});b._destroyElement=b.destroy=function(A){A=a(A);try{var C=A.ownerDocument;if(!c||d!=C){c=C.createElement("div");d=C}c.appendChild(A.parentNode?A.parentNode.removeChild(A):A);c.innerHTML=""}catch(H){}};b.isDescendant=function(A,C){try{A=a(A);for(C=a(C);A;){if(A==C)return true;A=A.parentNode}}catch(H){}return false};b.setSelectable=function(A,C){A=a(A);if(b.isMozilla)A.style.MozUserSelect=C?"":"none";else if(b.isKhtml||
b.isWebKit)A.style.KhtmlUserSelect=C?"auto":"none";else if(b.isIE){C=A.unselectable=C?"":"on";b.query("*",A).forEach("item.unselectable = '"+C+"'")}};var e=function(A,C){var H=C.parentNode;H&&H.insertBefore(A,C)},k=function(A,C){var H=C.parentNode;if(H)H.lastChild==C?H.appendChild(A):H.insertBefore(A,C.nextSibling)};b.place=function(A,C,H){C=a(C);if(typeof A=="string")A=/^\s*</.test(A)?b._toDom(A,C.ownerDocument):a(A);if(typeof H=="number"){var N=C.childNodes;!N.length||N.length<=H?C.appendChild(A):
e(A,N[H<0?0:H])}else switch(H){case "before":e(A,C);break;case "after":k(A,C);break;case "replace":C.parentNode.replaceChild(A,C);break;case "only":b.empty(C);C.appendChild(A);break;case "first":if(C.firstChild){e(A,C.firstChild);break}default:C.appendChild(A)}return A};b.boxModel="content-box";if(b.isIE)b.boxModel=document.compatMode=="BackCompat"?"border-box":"content-box";var h;h=b.isWebKit?function(A){var C;if(A.nodeType==1){var H=A.ownerDocument.defaultView;C=H.getComputedStyle(A,null);if(!C&&
A.style){A.style.display="";C=H.getComputedStyle(A,null)}}return C||{}}:b.isIE?function(A){return A.nodeType==1?A.currentStyle:{}}:function(A){return A.nodeType==1?A.ownerDocument.defaultView.getComputedStyle(A,null):{}};b.getComputedStyle=h;b._toPixelValue=b.isIE?function(A,C){if(!C)return 0;if(C=="medium")return 4;if(C.slice&&C.slice(-2)=="px")return parseFloat(C);with(A){A=style.left;var H=runtimeStyle.left;runtimeStyle.left=currentStyle.left;try{style.left=C;C=style.pixelLeft}catch(N){C=0}style.left=
A;runtimeStyle.left=H}return C}:function(A,C){return parseFloat(C)||0};var i=b._toPixelValue,m=function(A,C){try{return A.filters.item("DXImageTransform.Microsoft.Alpha")}catch(H){return C?{}:null}};b._getOpacity=b.isIE<9?function(A){try{return m(A).Opacity/100}catch(C){return 1}}:function(A){return h(A).opacity};b._setOpacity=b.isIE<9?function(A,C){var H=C*100,N=C==1;A.style.zoom=N?"":1;if(m(A))m(A,1).Opacity=H;else{if(N)return C;A.style.filter+=" progid:DXImageTransform.Microsoft.Alpha(Opacity="+
H+")"}m(A,1).Enabled=!N;A.nodeName.toLowerCase()=="tr"&&b.query("> td",A).forEach(function(Q){b._setOpacity(Q,C)});return C}:function(A,C){return A.style.opacity=C};var p={left:true,top:true},t=/margin|padding|width|height|max|min|offset/,y=function(A,C,H){C=C.toLowerCase();if(b.isIE){if(H=="auto"){if(C=="height")return A.offsetHeight;if(C=="width")return A.offsetWidth}if(C=="fontweight")switch(H){case 700:return"bold";case 400:default:return"normal"}}C in p||(p[C]=t.test(C));return p[C]?i(A,H):H},
u=b.isIE?"styleFloat":"cssFloat",s={cssFloat:u,styleFloat:u,"float":u};b.style=function(A,C,H){var N=a(A),Q=arguments.length,S=C=="opacity";C=s[C]||C;if(Q==3)return S?b._setOpacity(N,H):(N.style[C]=H);if(Q==2&&S)return b._getOpacity(N);S=h(N);if(Q==2&&typeof C!="string"){for(var W in C)b.style(A,W,C[W]);return S}return Q==1?S:y(N,C,S[C]||N.style[C])};b._getPadExtents=function(A,C){C=C||h(A);var H=i(A,C.paddingLeft),N=i(A,C.paddingTop);return{l:H,t:N,w:H+i(A,C.paddingRight),h:N+i(A,C.paddingBottom)}};
b._getBorderExtents=function(A,C){C=C||h(A);var H=C.borderLeftStyle!="none"?i(A,C.borderLeftWidth):0,N=C.borderTopStyle!="none"?i(A,C.borderTopWidth):0;return{l:H,t:N,w:H+(C.borderRightStyle!="none"?i(A,C.borderRightWidth):0),h:N+(C.borderBottomStyle!="none"?i(A,C.borderBottomWidth):0)}};b._getPadBorderExtents=function(A,C){var H=C||h(A);C=b._getPadExtents(A,H);A=b._getBorderExtents(A,H);return{l:C.l+A.l,t:C.t+A.t,w:C.w+A.w,h:C.h+A.h}};b._getMarginExtents=function(A,C){C=C||h(A);var H=i(A,C.marginLeft),
N=i(A,C.marginTop),Q=i(A,C.marginRight);A=i(A,C.marginBottom);if(b.isWebKit&&C.position!="absolute")Q=H;return{l:H,t:N,w:H+Q,h:N+A}};b._getMarginBox=function(A,C){var H=C||h(A);C=b._getMarginExtents(A,H);var N=A.offsetLeft-C.l,Q=A.offsetTop-C.t,S=A.parentNode;if(b.isMoz){var W=parseFloat(H.left);H=parseFloat(H.top);if(!isNaN(W)&&!isNaN(H)){N=W;Q=H}else if(S&&S.style){W=h(S);if(W.overflow!="visible"){S=b._getBorderExtents(S,W);N+=S.l;Q+=S.t}}}else if(b.isOpera||b.isIE>7&&!b.isQuirks)if(S){S=b._getBorderExtents(S);
N-=S.l;Q-=S.t}return{l:N,t:Q,w:A.offsetWidth+C.w,h:A.offsetHeight+C.h}};b._getMarginSize=function(A,C){A=a(A);C=b._getMarginExtents(A,C||h(A));A=A.getBoundingClientRect();return{w:A.right-A.left+C.w,h:A.bottom-A.top+C.h}};b._getContentBox=function(A,C){var H=C||h(A);C=b._getPadExtents(A,H);H=b._getBorderExtents(A,H);var N=A.clientWidth;if(N){A=A.clientHeight;H.w=H.h=0}else{N=A.offsetWidth;A=A.offsetHeight}if(b.isOpera){C.l+=H.l;C.t+=H.t}return{l:C.l,t:C.t,w:N-C.w-H.w,h:A-C.h-H.h}};b._getBorderBox=
function(A,C){var H=C||h(A);C=b._getPadExtents(A,H);A=b._getContentBox(A,H);return{l:A.l-C.l,t:A.t-C.t,w:A.w+C.w,h:A.h+C.h}};b._setBox=function(A,C,H,N,Q,S){S=S||"px";A=A.style;if(!isNaN(C))A.left=C+S;if(!isNaN(H))A.top=H+S;if(N>=0)A.width=N+S;if(Q>=0)A.height=Q+S};b._isButtonTag=function(A){return A.tagName=="BUTTON"||A.tagName=="INPUT"&&(A.getAttribute("type")||"").toUpperCase()=="BUTTON"};b._usesBorderBox=function(A){var C=A.tagName;return b.boxModel=="border-box"||C=="TABLE"||b._isButtonTag(A)};
b._setContentSize=function(A,C,H,N){if(b._usesBorderBox(A)){N=b._getPadBorderExtents(A,N);if(C>=0)C+=N.w;if(H>=0)H+=N.h}b._setBox(A,NaN,NaN,C,H)};b._setMarginBox=function(A,C,H,N,Q,S){var W=S||h(A);S=b._usesBorderBox(A)?q:b._getPadBorderExtents(A,W);if(b.isWebKit)if(b._isButtonTag(A)){var ca=A.style;if(N>=0&&!ca.width)ca.width="4px";if(Q>=0&&!ca.height)ca.height="4px"}W=b._getMarginExtents(A,W);if(N>=0)N=Math.max(N-S.w-W.w,0);if(Q>=0)Q=Math.max(Q-S.h-W.h,0);b._setBox(A,C,H,N,Q)};var q={l:0,t:0,w:0,
h:0};b.marginBox=function(A,C){A=a(A);var H=h(A);return!C?b._getMarginBox(A,H):b._setMarginBox(A,C.l,C.t,C.w,C.h,H)};b.contentBox=function(A,C){A=a(A);var H=h(A);return!C?b._getContentBox(A,H):b._setContentSize(A,C.w,C.h,H)};b._docScroll=function(){var A=b.global;return"pageXOffset"in A?{x:A.pageXOffset,y:A.pageYOffset}:(A=b.isQuirks?b.doc.body:b.doc.documentElement,{x:b._fixIeBiDiScrollLeft(A.scrollLeft||0),y:A.scrollTop||0})};b._isBodyLtr=function(){return"_bodyLtr"in b?b._bodyLtr:(b._bodyLtr=(b.body().dir||
b.doc.documentElement.dir||"ltr").toLowerCase()=="ltr")};b._getIeDocumentElementOffset=function(){var A=b.doc.documentElement;if(b.isIE<8){var C=A.getBoundingClientRect(),H=C.left;C=C.top;if(b.isIE<7){H+=A.clientLeft;C+=A.clientTop}return{x:H<0?0:H,y:C<0?0:C}}else return{x:0,y:0}};b._fixIeBiDiScrollLeft=function(A){var C=b.isIE;if(C&&!b._isBodyLtr()){var H=b.isQuirks,N=H?b.doc.body:b.doc.documentElement;if(C==6&&!H&&b.global.frameElement&&N.scrollHeight>N.clientHeight)A+=N.clientLeft;return C<8||
H?A+N.clientWidth-N.scrollWidth:-A}return A};b._abs=b.position=function(A,C){A=a(A);var H=b.body(),N=H.parentNode;A=A.getBoundingClientRect();A={x:A.left,y:A.top,w:A.right-A.left,h:A.bottom-A.top};if(b.isIE){N=b._getIeDocumentElementOffset();A.x-=N.x+(b.isQuirks?H.clientLeft+H.offsetLeft:0);A.y-=N.y+(b.isQuirks?H.clientTop+H.offsetTop:0)}else if(b.isFF==3){H=h(N);A.x-=i(N,H.marginLeft)+i(N,H.borderLeftWidth);A.y-=i(N,H.marginTop)+i(N,H.borderTopWidth)}if(C){C=b._docScroll();A.x+=C.x;A.y+=C.y}return A};
b.coords=function(A,C){A=a(A);var H=h(A);H=b._getMarginBox(A,H);C=b.position(A,C);H.x=C.x;H.y=C.y;return H};var x={"class":"className","for":"htmlFor",tabindex:"tabIndex",readonly:"readOnly",colspan:"colSpan",frameborder:"frameBorder",rowspan:"rowSpan",valuetype:"valueType"},w={classname:"class",htmlfor:"for",tabindex:"tabIndex",readonly:"readOnly"},g={innerHTML:1,className:1,htmlFor:b.isIE,value:1},j=function(A){return w[A.toLowerCase()]||A},l=function(A,C){return(A=A.getAttributeNode&&A.getAttributeNode(C))&&
A.specified};b.hasAttr=function(A,C){var H=C.toLowerCase();return g[x[H]||C]||l(a(A),w[H]||C)};var n={},o=0,r=b._scopeName+"attrid",v={col:1,colgroup:1,table:1,tbody:1,tfoot:1,thead:1,tr:1,title:1};b.attr=function(A,C,H){A=a(A);var N=arguments.length;if(N==2&&typeof C!="string"){for(var Q in C)b.attr(A,Q,C[Q]);return A}var S=C.toLowerCase();Q=x[S]||C;var W=g[Q];S=w[S]||C;if(N==3){if(Q=="style"&&typeof H!="string")b.style(A,H);else if(Q=="innerHTML")if(b.isIE&&A.tagName.toLowerCase()in v){b.empty(A);
A.appendChild(b._toDom(H,A.ownerDocument))}else A[Q]=H;else if(b.isFunction(H)){N=b.attr(A,r);if(!N){N=o++;b.attr(A,r,N)}n[N]||(n[N]={});if(W=n[N][Q])b.disconnect(W);else try{delete A[Q]}catch(ca){}n[N][Q]=b.connect(A,Q,H)}else if(W||typeof H=="boolean")A[Q]=H;else A.setAttribute(S,H);return A}H=A[Q];if(W&&typeof H!="undefined")return H;if(Q!="href"&&(typeof H=="boolean"||b.isFunction(H)))return H;return l(A,S)?A.getAttribute(S):null};b.removeAttr=function(A,C){a(A).removeAttribute(j(C))};b.getNodeProp=
function(A,C){A=a(A);var H=C.toLowerCase(),N=x[H]||C;if(N in A&&N!="href")return A[N];C=w[H]||C;return l(A,C)?A.getAttribute(C):null};b.create=function(A,C,H,N){var Q=b.doc;if(H){H=a(H);Q=H.ownerDocument}if(typeof A=="string")A=Q.createElement(A);C&&b.attr(A,C);H&&b.place(A,H,N);return A};b.empty=b.isIE?function(A){A=a(A);for(var C;C=A.lastChild;)b.destroy(C)}:function(A){a(A).innerHTML=""};var z={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\:]+)/,D={},E=0,F="__"+b._scopeName+"ToDomId";for(var J in z)if(z.hasOwnProperty(J)){var K=z[J];K.pre=J=="option"?'<select multiple="multiple">':"<"+K.join("><")+">";K.post="</"+K.reverse().join("></")+">"}b._toDom=function(A,C){C=C||b.doc;var H=C[F];if(!H){C[F]=H=++E+"";D[H]=C.createElement("div")}A+="";var N=A.match(B),Q=N?N[1].toLowerCase():"";H=D[H];if(N&&z[Q]){N=
z[Q];H.innerHTML=N.pre+A+N.post;for(A=N.length;A;--A)H=H.firstChild}else H.innerHTML=A;if(H.childNodes.length==1)return H.removeChild(H.firstChild);for(A=C.createDocumentFragment();C=H.firstChild;)A.appendChild(C);return A};var O="className";b.hasClass=function(A,C){return(" "+a(A)[O]+" ").indexOf(" "+C+" ")>=0};var R=/\s+/,X=[""],P={},da=function(A){if(typeof A=="string"||A instanceof String)if(A.indexOf(" ")<0){X[0]=A;return X}else return A.split(R);return A||""};b.addClass=function(A,C){A=a(A);
C=da(C);var H=A[O],N;H=H?" "+H+" ":" ";N=H.length;for(var Q=0,S=C.length,W;Q<S;++Q)if((W=C[Q])&&H.indexOf(" "+W+" ")<0)H+=W+" ";if(N<H.length)A[O]=H.substr(1,H.length-2)};b.removeClass=function(A,C){A=a(A);var H;if(C!==undefined){C=da(C);H=" "+A[O]+" ";for(var N=0,Q=C.length;N<Q;++N)H=H.replace(" "+C[N]+" "," ");H=b.trim(H)}else H="";if(A[O]!=H)A[O]=H};b.replaceClass=function(A,C,H){A=a(A);P.className=A.className;b.removeClass(P,H);b.addClass(P,C);if(A.className!==P.className)A.className=P.className};
b.toggleClass=function(A,C,H){if(H===undefined)H=!b.hasClass(A,C);b[H?"addClass":"removeClass"](A,C)}})();return b});
define("dojo/_base/NodeList",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array","dojo/_base/connect","dojo/_base/html"],function(b){(function(){var f=Array.prototype,a=f.slice,c=f.concat,d=function(u,s,q){u.sort||(u=a.call(u,0));q=q||this._NodeListCtor||b._NodeListCtor;u.constructor=q;b._mixin(u,q.prototype);u._NodeListCtor=q;return s?u._stash(s):u},e=function(u,s,q){s=[0].concat(a.call(s,0));q=q||b.global;return function(x){s[0]=x;return u.apply(q,s)}},k=function(u,s){return function(){this.forEach(e(u,
arguments,s));return this}},h=function(u,s){return function(){return this.map(e(u,arguments,s))}},i=function(u,s,q){return function(){var x=arguments,w=e(u,x,q);if(s.call(q||b.global,x))return this.map(w);this.forEach(w);return this}},m=function(u){return u.length==1&&typeof u[0]=="string"},p=function(u){var s=u.parentNode;s&&s.removeChild(u)};b.NodeList=function(){return d(Array.apply(null,arguments))};var t=b._NodeListCtor=b.NodeList,y=t.prototype;t._wrap=y._wrap=d;t._adaptAsMap=h;t._adaptAsForEach=
k;t._adaptAsFilter=function(u,s){return function(){return this.filter(e(u,arguments,s))}};t._adaptWithCondition=i;b.forEach(["slice","splice"],function(u){var s=f[u];y[u]=function(){return this._wrap(s.apply(this,arguments),u=="slice"?this:null)}});b.forEach(["indexOf","lastIndexOf","every","some"],function(u){var s=b[u];y[u]=function(){return s.apply(b,[this].concat(a.call(arguments,0)))}});b.forEach(["attr","style"],function(u){y[u]=i(b[u],m)});b.forEach(["connect","addClass","removeClass","replaceClass",
"toggleClass","empty","removeAttr"],function(u){y[u]=k(b[u])});b.extend(b.NodeList,{_normalize:function(u,s){var q=u.parse===true?true:false;if(typeof u.template=="string"){var x=u.templateFunc||b.string&&b.string.substitute;u=x?x(u.template,u):u}x=typeof u;if(x=="string"||x=="number"){u=b._toDom(u,s&&s.ownerDocument);u=u.nodeType==11?b._toArray(u.childNodes):[u]}else if(b.isArrayLike(u))b.isArray(u)||(u=b._toArray(u));else u=[u];if(q)u._runParse=true;return u},_cloneNode:function(u){return u.cloneNode(true)},
_place:function(u,s,q,x){if(!(s.nodeType!=1&&q=="only")){s=s;for(var w,g=u.length,j=g-1;j>=0;j--){var l=x?this._cloneNode(u[j]):u[j];if(u._runParse&&b.parser&&b.parser.parse){w||(w=s.ownerDocument.createElement("div"));w.appendChild(l);b.parser.parse(w);for(l=w.firstChild;w.firstChild;)w.removeChild(w.firstChild)}j==g-1?b.place(l,s,q):s.parentNode.insertBefore(l,s);s=l}}},_stash:function(u){this._parent=u;return this},end:function(){return this._parent?this._parent:new this._NodeListCtor},concat:function(){var u=
b.isArray(this)?this:a.call(this,0),s=b.map(arguments,function(q){return q&&!b.isArray(q)&&(typeof NodeList!="undefined"&&q.constructor===NodeList||q.constructor===this._NodeListCtor)?a.call(q,0):q});return this._wrap(c.apply(u,s),this)},map:function(u,s){return this._wrap(b.map(this,u,s),this)},forEach:function(u,s){b.forEach(this,u,s);return this},coords:h(b.coords),position:h(b.position),place:function(u,s){var q=b.query(u)[0];return this.forEach(function(x){b.place(x,q,s)})},orphan:function(u){return(u?
b._filterQueryResult(this,u):this).forEach(p)},adopt:function(u,s){return b.query(u).place(this[0],s)._stash(this)},query:function(u){if(!u)return this;var s=this.map(function(q){return b.query(u,q).filter(function(x){return x!==undefined})});return this._wrap(c.apply([],s),this)},filter:function(u){var s=arguments,q=this,x=0;if(typeof u=="string"){q=b._filterQueryResult(this,s[0]);if(s.length==1)return q._stash(this);x=1}return this._wrap(b.filter(q,s[x],s[x+1]),this)},addContent:function(u,s){u=
this._normalize(u,this[0]);for(var q=0,x;x=this[q];q++)this._place(u,x,s,q>0);return this},instantiate:function(u,s){var q=b.isFunction(u)?u:b.getObject(u);s=s||{};return this.forEach(function(x){new q(s,x)})},at:function(){var u=new this._NodeListCtor;b.forEach(arguments,function(s){if(s<0)s=this.length+s;this[s]&&u.push(this[s])},this);return u._stash(this)}});t.events=["blur","focus","change","click","error","keydown","keypress","keyup","load","mousedown","mouseenter","mouseleave","mousemove",
"mouseout","mouseover","mouseup","submit"];b.forEach(t.events,function(u){var s="on"+u;y[s]=function(q,x){return this.connect(s,q,x)}})})();return b.NodeList});
(function(){var b=function(a){var c=a.trim,d=a.forEach,e=a._NodeListCtor=a.NodeList,k=function(){return a.doc},h=(a.isWebKit||a.isMozilla)&&k().compatMode=="BackCompat",i=k().firstChild.children?"children":"childNodes",m=false,p=function(){return true},t=function(G){G+=">~+".indexOf(G.slice(-1))>=0?" * ":" ";for(var I=function(ma,na){return c(G.slice(ma,na))},L=[],M=-1,T=-1,V=-1,Y=-1,U=-1,Z=-1,ba=-1,ga="",ea="",ia,aa=0,oa=G.length,$=null,ha=null,pa=function(){if(ba>=0){var ma=ba==aa?null:I(ba,aa);
$[">~+".indexOf(ma)<0?"tag":"oper"]=ma;ba=-1}},qa=function(){if(Z>=0){$.id=I(Z,aa).replace(/\\/g,"");Z=-1}},ra=function(){if(U>=0){$.classes.push(I(U+1,aa).replace(/\\/g,""));U=-1}},la=function(){qa();pa();ra()},sa=function(){la();Y>=0&&$.pseudos.push({name:I(Y+1,aa)});$.loops=$.pseudos.length||$.attrs.length||$.classes.length;$.oquery=$.query=I(ia,aa);$.otag=$.tag=$.oper?null:$.tag||"*";if($.tag)$.tag=$.tag.toUpperCase();if(L.length&&L[L.length-1].oper){$.infixOper=L.pop();$.query=$.infixOper.query+
" "+$.query}L.push($);$=null};ga=ea,ea=G.charAt(aa),aa<oa;aa++)if(ga!="\\"){if(!$){ia=aa;$={query:null,pseudos:[],attrs:[],classes:[],tag:null,oper:null,id:null,getTag:function(){return m?this.otag:this.tag}};ba=aa}if(M>=0)if(ea=="]"){if(ha.attr)ha.matchFor=I(V||M+1,aa);else ha.attr=I(M+1,aa);if(M=ha.matchFor)if(M.charAt(0)=='"'||M.charAt(0)=="'")ha.matchFor=M.slice(1,-1);$.attrs.push(ha);ha=null;M=V=-1}else{if(ea=="="){V="|~^$*".indexOf(ga)>=0?ga:"";ha.type=V+ea;ha.attr=I(M+1,aa-V.length);V=aa+1}}else if(T>=
0){if(ea==")"){if(Y>=0)ha.value=I(T+1,aa);Y=T=-1}}else if(ea=="#"){la();Z=aa+1}else if(ea=="."){la();U=aa}else if(ea==":"){la();Y=aa}else if(ea=="["){la();M=aa;ha={}}else if(ea=="("){if(Y>=0){ha={name:I(Y+1,aa),value:null};$.pseudos.push(ha)}T=aa}else ea==" "&&ga!=ea&&sa()}return L},y=function(G,I){if(!G)return I;if(!I)return G;return function(){return G.apply(window,arguments)&&I.apply(window,arguments)}},u=function(G,I){I=I||[];G&&I.push(G);return I},s=function(G){return 1==G.nodeType},q=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(m?G.getAttribute(I):G.getAttribute(I,2))||""},x={"*=":function(G,I){return function(L){return q(L,G).indexOf(I)>=0}},"^=":function(G,I){return function(L){return q(L,G).indexOf(I)==0}},"$=":function(G,I){return function(L){L=" "+q(L,G);return L.lastIndexOf(I)==L.length-I.length}},"~=":function(G,I){var L=" "+I+" ";return function(M){return(" "+q(M,G)+" ").indexOf(L)>=
0}},"|=":function(G,I){var L=" "+I+"-";return function(M){M=" "+q(M,G);return M==I||M.indexOf(L)==0}},"=":function(G,I){return function(L){return q(L,G)==I}}},w=typeof k().firstChild.nextElementSibling=="undefined",g=!w?"nextElementSibling":"nextSibling",j=!w?"previousElementSibling":"previousSibling",l=w?s:p,n=function(G){for(;G=G[j];)if(l(G))return false;return true},o=function(G){for(;G=G[g];)if(l(G))return false;return true},r=function(G){var I=G.parentNode,L=0,M=I[i],T=G._i||-1,V=I._l||-1;if(!M)return-1;
M=M.length;if(V==M&&T>=0&&V>=0)return T;I._l=M;T=-1;for(I=I.firstElementChild||I.firstChild;I;I=I[g])if(l(I)){I._i=++L;if(G===I)T=L}return T},v=function(G){return!(r(G)%2)},z=function(G){return r(G)%2},B={checked:function(){return function(G){return!!("checked"in G?G.checked:G.selected)}},"first-child":function(){return n},"last-child":function(){return o},"only-child":function(){return function(G){if(!n(G))return false;if(!o(G))return false;return true}},empty:function(){return function(G){var I=
G.childNodes;for(G=G.childNodes.length-1;G>=0;G--){var L=I[G].nodeType;if(L===1||L==3)return false}return true}},contains:function(G,I){G=I.charAt(0);if(G=='"'||G=="'")I=I.slice(1,-1);return function(L){return L.innerHTML.indexOf(I)>=0}},not:function(G,I){G=t(I)[0];I={el:1};if(G.tag!="*")I.tag=1;if(!G.classes.length)I.classes=1;var L=E(G,I);return function(M){return!L(M)}},"nth-child":function(G,I){G=parseInt;if(I=="odd")return z;else if(I=="even")return v;if(I.indexOf("n")!=-1){I=I.split("n",2);
var L=I[0]?I[0]=="-"?-1:G(I[0]):1,M=I[1]?G(I[1]):0,T=0,V=-1;if(L>0)if(M<0)M=M%L&&L+M%L;else{if(M>0){if(M>=L)T=M-M%L;M%=L}}else if(L<0){L*=-1;if(M>0){V=M;M%=L}}if(L>0)return function(U){U=r(U);return U>=T&&(V<0||U<=V)&&U%L==M};else I=M}var Y=G(I);return function(U){return r(U)==Y}}},D=a.isIE<9||dojo.isIE&&dojo.isQuirks?function(G){var I=G.toLowerCase();if(I=="class")G="className";return function(L){return m?L.getAttribute(G):L[G]||L[I]}}:function(G){return function(I){return I&&I.getAttribute&&I.hasAttribute(G)}},
E=function(G,I){if(!G)return p;I=I||{};var L=null;"el"in I||(L=y(L,s));if(!("tag"in I))if(G.tag!="*")L=y(L,function(M){return M&&M.tagName==G.getTag()});"classes"in I||d(G.classes,function(M,T){var V=new RegExp("(?:^|\\s)"+M+"(?:\\s|$)");L=y(L,function(Y){return V.test(Y.className)});L.count=T});"pseudos"in I||d(G.pseudos,function(M){var T=M.name;if(B[T])L=y(L,B[T](T,M.value))});"attrs"in I||d(G.attrs,function(M){var T,V=M.attr;if(M.type&&x[M.type])T=x[M.type](V,M.matchFor);else if(V.length)T=D(V);
if(T)L=y(L,T)});if(!("id"in I))if(G.id)L=y(L,function(M){return!!M&&M.id==G.id});L||"default"in I||(L=p);return L},F=function(G){return function(I,L,M){for(;I=I[g];)if(!(w&&!s(I))){if((!M||ja(I,M))&&G(I))L.push(I);break}return L}},J=function(G){return function(I,L,M){for(I=I[g];I;){if(l(I)){if(M&&!ja(I,M))break;G(I)&&L.push(I)}I=I[g]}return L}},K=function(G){G=G||p;return function(I,L,M){for(var T=0,V=I[i];I=V[T++];)if(l(I)&&(!M||ja(I,M))&&G(I,T))L.push(I);return L}},O=function(G,I){for(G=G.parentNode;G;){if(G==
I)break;G=G.parentNode}return!!G},R={},X=function(G){var I=R[G.query];if(I)return I;var L=G.infixOper;L=L?L.oper:"";var M=E(G,{el:1}),T="*"==G.tag,V=k().getElementsByClassName;if(L){V={el:1};if(T)V.tag=1;M=E(G,V);if("+"==L)I=F(M);else if("~"==L)I=J(M);else if(">"==L)I=K(M)}else if(G.id){M=!G.loops&&T?p:E(G,{el:1,id:1});I=function(U,Z){var ba=a.byId(G.id,U.ownerDocument||U);if(ba&&M(ba))if(9==U.nodeType)return u(ba,Z);else if(O(ba,U))return u(ba,Z)}}else if(V&&/\{\s*\[native code\]\s*\}/.test(String(V))&&
G.classes.length&&!h){M=E(G,{el:1,classes:1,id:1});var Y=G.classes.join(" ");I=function(U,Z,ba){Z=u(0,Z);for(var ga,ea=0,ia=U.getElementsByClassName(Y);ga=ia[ea++];)M(ga,U)&&ja(ga,ba)&&Z.push(ga);return Z}}else if(!T&&!G.loops)I=function(U,Z,ba){Z=u(0,Z);for(var ga=0,ea=U.getElementsByTagName(G.getTag());U=ea[ga++];)ja(U,ba)&&Z.push(U);return Z};else{M=E(G,{el:1,tag:1,id:1});I=function(U,Z,ba){Z=u(0,Z);for(var ga,ea=0,ia=U.getElementsByTagName(G.getTag());ga=ia[ea++];)M(ga,U)&&ja(ga,ba)&&Z.push(ga);
return Z}}return R[G.query]=I},P=function(G,I){G=u(G);for(var L,M,T=I.length,V,Y,U=0;U<T;U++){Y=[];L=I[U];M=G.length-1;if(M>0){V={};Y.nozip=true}M=X(L);for(var Z=0;L=G[Z];Z++)M(L,Y,V);if(!Y.length)break;G=Y}return Y},da={},A={},C=function(G){var I=t(c(G));if(I.length==1){var L=X(I[0]);return function(M){if(M=L(M,new e))M.nozip=true;return M}}return function(M){return P(M,I)}},H=navigator.userAgent;H=a.isWebKit&&H.indexOf("WebKit/")>0&&parseFloat(H.split("WebKit/")[1])>528;var N=a.isIE?"commentStrip":
"nozip",Q=!!k().querySelectorAll&&(!a.isSafari||a.isSafari>3.1||H),S=/n\+\d|([^ ])?([>~+])([^ =])?/g,W=function(G,I,L,M){return L?(I?I+" ":"")+L+(M?" "+M:""):G},ca=function(G,I){G=G.replace(S,W);if(Q){var L=A[G];if(L&&!I)return L}if(L=da[G])return L;L=G.charAt(0);var M=-1==G.indexOf(" ");if(G.indexOf("#")>=0&&M)I=true;if(Q&&!I&&">~+".indexOf(L)==-1&&(!a.isIE||G.indexOf(":")==-1)&&!(h&&G.indexOf(".")>=0)&&G.indexOf(":contains")==-1&&G.indexOf(":checked")==-1&&G.indexOf("|=")==-1){var T=">~+".indexOf(G.charAt(G.length-
1))>=0?G+" *":G;return A[G]=function(Y){try{if(!(9==Y.nodeType||M))throw"";var U=Y.querySelectorAll(T);U[N]=true;return U}catch(Z){return ca(G,true)(Y)}}}else{var V=G.split(/\s*,\s*/);return da[G]=V.length<2?C(G):function(Y){for(var U=0,Z=[],ba;ba=V[U++];)Z=Z.concat(C(ba)(Y));return Z}}},fa=0,ta=a.isIE?function(G){return m?G.getAttribute("_uid")||G.setAttribute("_uid",++fa)||fa:G.uniqueID}:function(G){return G._uid||(G._uid=++fa)},ja=function(G,I){if(!I)return 1;G=ta(G);if(!I[G])return I[G]=1;return 0},
ka="_zipIdx",ua=function(G){if(G&&G.nozip)return e._wrap?e._wrap(G):G;var I=new e;if(!G||!G.length)return I;G[0]&&I.push(G[0]);if(G.length<2)return I;fa++;if(a.isIE&&m){var L=fa+"";G[0].setAttribute(ka,L);for(var M=1,T;T=G[M];M++){G[M].getAttribute(ka)!=L&&I.push(T);T.setAttribute(ka,L)}}else if(a.isIE&&G.commentStrip)try{for(M=1;T=G[M];M++)s(T)&&I.push(T)}catch(V){}else{if(G[0])G[0][ka]=fa;for(M=1;T=G[M];M++){G[M][ka]!=fa&&I.push(T);T[ka]=fa}}return I};a.query=function(G,I){e=a._NodeListCtor;if(!G)return new e;
if(G.constructor==e)return G;if(typeof G!="string")return new e(G);if(typeof I=="string"){I=a.byId(I);if(!I)return new e}I=I||k();var L=I.ownerDocument||I.documentElement;m=I.contentType&&I.contentType=="application/xml"||a.isOpera&&(I.doctype||L.toString()=="[object XMLDocument]")||!!L&&(a.isIE?L.xml:I.xmlVersion||L.xmlVersion);if((G=ca(G)(I))&&G.nozip&&!e._wrap)return G;return ua(G)};a.query.pseudos=B;a._filterQueryResult=function(G,I,L){var M=new a._NodeListCtor,T=t(I);T=T.length==1&&!/[^\w#\.]/.test(I)?
E(T[0]):function(U){return dojo.query(I,L).indexOf(U)!=-1};for(var V=0,Y;Y=G[V];V++)T(Y)&&M.push(Y);return M}},f=function(){acme={trim:function(e){e=e.replace(/^\s+/,"");for(var k=e.length-1;k>=0;k--)if(/\S/.test(e.charAt(k))){e=e.substring(0,k+1);break}return e},forEach:function(e,k,h){if(e&&e.length)for(var i=0,m=e.length;i<m;++i)k.call(h||window,e[i],i,e)},byId:function(e,k){return typeof e=="string"?(k||document).getElementById(e):e},doc:document,NodeList:Array};var a=navigator,c=a.userAgent;
a=a.appVersion;var d=parseFloat(a);acme.isOpera=c.indexOf("Opera")>=0?d:undefined;acme.isKhtml=a.indexOf("Konqueror")>=0?d: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(e){return e};return acme};typeof define=="function"&&define("dojo/_base/query",["dojo/lib/kernel","dojo/_base/NodeList","dojo/_base/lang","dojo/_base/window"],function(a){b(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");b(this.queryPortability||this.acme||dojo)}else b(this.queryPortability||this.acme||f())})();
define("dojo/_base/xhr",["dojo/lib/kernel","dojo/_base/Deferred","dojo/_base/json","dojo/_base/lang","dojo/_base/query"],function(b){(function(){function f(w,g,j){if(j!==null){var l=w[g];if(typeof l=="string")w[g]=[l,j];else if(a.isArray(l))l.push(j);else w[g]=j}}var a=b,c=a.config;b.fieldToObject=function(w){var g=null;if(w=a.byId(w)){var j=w.name,l=(w.type||"").toLowerCase();if(j&&l&&!w.disabled)if(l=="radio"||l=="checkbox"){if(w.checked)g=w.value}else if(w.multiple){g=[];a.query("option",w).forEach(function(n){n.selected&&
g.push(n.value)})}else g=w.value}return g};b.formToObject=function(w){var g={};a.forEach(b.byId(w).elements,function(j){var l=j.name,n=(j.type||"").toLowerCase();if(l&&n&&"file|submit|image|reset|button|".indexOf(n)==-1&&!j.disabled){f(g,l,a.fieldToObject(j));if(n=="image")g[l+".x"]=g[l+".y"]=g[l].x=g[l].y=0}});return g};b.objectToQuery=function(w){var g=encodeURIComponent,j=[],l={};for(var n in w){var o=w[n];if(o!=l[n]){var r=g(n)+"=";if(a.isArray(o))for(var v=0;v<o.length;v++)j.push(r+g(o[v]));
else j.push(r+g(o))}}return j.join("&")};b.formToQuery=function(w){return a.objectToQuery(a.formToObject(w))};b.formToJson=function(w,g){return a.toJson(a.formToObject(w),g)};b.queryToObject=function(w){var g={};w=w.split("&");var j=decodeURIComponent;a.forEach(w,function(l){if(l.length){var n=l.split("=");l=j(n.shift());n=j(n.join("="));if(typeof g[l]=="string")g[l]=[g[l]];if(a.isArray(g[l]))g[l].push(n);else g[l]=n}});return g};b._blockAsync=false;var d=a._contentHandlers=b.contentHandlers={text:function(w){return w.responseText},
json:function(w){return a.fromJson(w.responseText||null)},"json-comment-filtered":function(w){b.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.");w=w.responseText;var g=w.indexOf("/*"),j=w.lastIndexOf("*/");if(g==-1||j==-1)throw new Error("JSON was not comment filtered");
return a.fromJson(w.substring(g+2,j))},javascript:function(w){return a.eval(w.responseText)},xml:function(w){var g=w.responseXML;if(a.isIE&&(!g||!g.documentElement)){var j=function(l){return"MSXML"+l+".DOMDocument"};j=["Microsoft.XMLDOM",j(6),j(4),j(3),j(2)];a.some(j,function(l){try{var n=new ActiveXObject(l);n.async=false;n.loadXML(w.responseText);g=n}catch(o){return false}return true})}return g},"json-comment-optional":function(w){return w.responseText&&/^[^{\[]*\/\*/.test(w.responseText)?d["json-comment-filtered"](w):
d.json(w)}};b._ioSetArgs=function(w,g,j,l){var n={args:w,url:w.url},o=null;if(w.form){o=a.byId(w.form);var r=o.getAttributeNode("action");n.url=n.url||(r?r.value:null);o=a.formToObject(o)}r=[{}];o&&r.push(o);w.content&&r.push(w.content);w.preventCache&&r.push({"dojo.preventCache":(new Date).valueOf()});n.query=a.objectToQuery(a.mixin.apply(null,r));n.handleAs=w.handleAs||"text";var v=new a.Deferred(g);v.addCallbacks(j,function(E){return l(E,v)});var z=w.load;z&&a.isFunction(z)&&v.addCallback(function(E){return z.call(w,
E,n)});var B=w.error;B&&a.isFunction(B)&&v.addErrback(function(E){return B.call(w,E,n)});var D=w.handle;D&&a.isFunction(D)&&v.addBoth(function(E){return D.call(w,E,n)});if(c.ioPublish&&a.publish&&n.args.ioPublish!==false){v.addCallbacks(function(E){a.publish("/dojo/io/load",[v,E]);return E},function(E){a.publish("/dojo/io/error",[v,E]);return E});v.addBoth(function(E){a.publish("/dojo/io/done",[v,E]);return E})}v.ioArgs=n;return v};var e=function(w){w.canceled=true;var g=w.ioArgs.xhr,j=typeof g.abort;
if(j=="function"||j=="object"||j=="unknown")g.abort();w=w.ioArgs.error;if(!w){w=new Error("xhr cancelled");w.dojoType="cancel"}return w},k=function(w){w=d[w.ioArgs.handleAs](w.ioArgs.xhr);return w===undefined?null:w},h=function(w,g){g.ioArgs.args.failOk||console.error(w);return w},i=null,m=[],p=0,t=function(w){if(p<=0){p=0;if(c.ioPublish&&a.publish&&(!w||w&&w.ioArgs.args.ioPublish!==false))a.publish("/dojo/io/stop")}},y=function(){var w=(new Date).getTime();if(!a._blockAsync)for(var g=0,j;g<m.length&&
(j=m[g]);g++){var l=j.dfd,n=function(){if(!l||l.canceled||!j.validCheck(l)){m.splice(g--,1);p-=1}else if(j.ioCheck(l)){m.splice(g--,1);j.resHandle(l);p-=1}else if(l.startTime)if(l.startTime+(l.ioArgs.args.timeout||0)<w){m.splice(g--,1);var r=new Error("timeout exceeded");r.dojoType="timeout";l.errback(r);l.cancel();p-=1}};if(b.config.debugAtAllCosts)n.call(this);else try{n.call(this)}catch(o){l.errback(o)}}t(l);if(!m.length){clearInterval(i);i=null}};b._ioCancelAll=function(){try{a.forEach(m,function(g){try{g.dfd.cancel()}catch(j){}})}catch(w){}};
a.isIE&&a.addOnWindowUnload(a._ioCancelAll);a._ioNotifyStart=function(w){if(c.ioPublish&&a.publish&&w.ioArgs.args.ioPublish!==false){p||a.publish("/dojo/io/start");p+=1;a.publish("/dojo/io/send",[w])}};a._ioWatch=function(w,g,j,l){var n=w.ioArgs.args;if(n.timeout)w.startTime=(new Date).getTime();m.push({dfd:w,validCheck:g,ioCheck:j,resHandle:l});i||(i=setInterval(y,50));n.sync&&y()};var u="application/x-www-form-urlencoded",s=function(w){return w.ioArgs.xhr.readyState},q=function(w){return 4==w.ioArgs.xhr.readyState},
x=function(w){var g=w.ioArgs.xhr;if(a._isDocumentOk(g))w.callback(w);else{var j=new Error("Unable to load "+w.ioArgs.url+" status:"+g.status);j.status=g.status;j.responseText=g.responseText;w.errback(j)}};b._ioAddQueryToUrl=function(w){if(w.query.length){w.url+=(w.url.indexOf("?")==-1?"?":"&")+w.query;w.query=null}};b.xhr=function(w,g,j){var l=a._ioSetArgs(g,e,k,h),n=l.ioArgs,o=n.xhr=a._xhrObj(n.args);if(!o){l.cancel();return l}if("postData"in g)n.query=g.postData;else if("putData"in g)n.query=g.putData;
else if("rawBody"in g)n.query=g.rawBody;else if(arguments.length>2&&!j||"POST|PUT".indexOf(w.toUpperCase())==-1)a._ioAddQueryToUrl(n);o.open(w,n.url,g.sync!==true,g.user||undefined,g.password||undefined);if(g.headers)for(var r in g.headers)if(r.toLowerCase()==="content-type"&&!g.contentType)g.contentType=g.headers[r];else g.headers[r]&&o.setRequestHeader(r,g.headers[r]);o.setRequestHeader("Content-Type",g.contentType||u);if(!g.headers||!("X-Requested-With"in g.headers))o.setRequestHeader("X-Requested-With",
"XMLHttpRequest");a._ioNotifyStart(l);if(b.config.debugAtAllCosts)o.send(n.query);else try{o.send(n.query)}catch(v){n.error=v;l.cancel()}a._ioWatch(l,s,q,x);return l};b.xhrGet=function(w){return a.xhr("GET",w)};b.rawXhrPost=b.xhrPost=function(w){return a.xhr("POST",w,true)};b.rawXhrPut=b.xhrPut=function(w){return a.xhr("PUT",w,true)};b.xhrDelete=function(w){return a.xhr("DELETE",w)}})();return b.xhr});
define("dojo/_base/fx",["dojo/lib/kernel","dojo/_base/Color","dojo/_base/connect","dojo/_base/lang","dojo/_base/html"],function(b){(function(){var f=b._mixin;b._Line=function(h,i){this.start=h;this.end=i};b._Line.prototype.getValue=function(h){return(this.end-this.start)*h+this.start};b.Animation=function(h){f(this,h);if(b.isArray(this.curve))this.curve=new b._Line(this.curve[0],this.curve[1])};b._Animation=b.Animation;b.extend(b.Animation,{duration:350,repeat:0,rate:20,_percent:0,_startRepeatCount:0,
_getStep:function(){var h=this._percent,i=this.easing;return i?i(h):h},_fire:function(h,i){i=i||[];if(this[h])if(b.config.debugAtAllCosts)this[h].apply(this,i);else try{this[h].apply(this,i)}catch(m){console.error("exception in animation handler for:",h);console.error(m)}return this},play:function(h,i){var m=this;m._delayTimer&&m._clearTimer();if(i){m._stopTimer();m._active=m._paused=false;m._percent=0}else if(m._active&&!m._paused)return m;m._fire("beforeBegin",[m.node]);h=h||m.delay;var p=b.hitch(m,
"_play",i);if(h>0){m._delayTimer=setTimeout(p,h);return m}p();return m},_play:function(){var h=this;h._delayTimer&&h._clearTimer();h._startTime=(new Date).valueOf();if(h._paused)h._startTime-=h.duration*h._percent;h._active=true;h._paused=false;var i=h.curve.getValue(h._getStep());if(!h._percent){if(!h._startRepeatCount)h._startRepeatCount=h.repeat;h._fire("onBegin",[i])}h._fire("onPlay",[i]);h._cycle();return h},pause:function(){var h=this;h._delayTimer&&h._clearTimer();h._stopTimer();if(!h._active)return h;
h._paused=true;h._fire("onPause",[h.curve.getValue(h._getStep())]);return h},gotoPercent:function(h,i){var m=this;m._stopTimer();m._active=m._paused=true;m._percent=h;i&&m.play();return m},stop:function(h){var i=this;i._delayTimer&&i._clearTimer();if(!i._timer)return i;i._stopTimer();if(h)i._percent=1;i._fire("onStop",[i.curve.getValue(i._getStep())]);i._active=i._paused=false;return i},status:function(){if(this._active)return this._paused?"paused":"playing";return"stopped"},_cycle:function(){var h=
this;if(h._active){var i=((new Date).valueOf()-h._startTime)/h.duration;if(i>=1)i=1;h._percent=i;if(h.easing)i=h.easing(i);h._fire("onAnimate",[h.curve.getValue(i)]);if(h._percent<1)h._startTimer();else{h._active=false;if(h.repeat>0){h.repeat--;h.play(null,true)}else if(h.repeat==-1)h.play(null,true);else if(h._startRepeatCount){h.repeat=h._startRepeatCount;h._startRepeatCount=0}h._percent=0;h._fire("onEnd",[h.node]);!h.repeat&&h._stopTimer()}}return h},_clearTimer:function(){clearTimeout(this._delayTimer);
delete this._delayTimer}});var a=0,c=null,d={run:function(){}};b.extend(b.Animation,{_startTimer:function(){if(!this._timer){this._timer=b.connect(d,"run",this,"_cycle");a++}c||(c=setInterval(b.hitch(d,"run"),this.rate))},_stopTimer:function(){if(this._timer){b.disconnect(this._timer);this._timer=null;a--}if(a<=0){clearInterval(c);c=null;a=0}}});var e=b.isIE?function(h){var i=h.style;if(!i.width.length&&b.style(h,"width")=="auto")i.width="auto"}:function(){};b._fade=function(h){h.node=b.byId(h.node);
var i=f({properties:{}},h);h=i.properties.opacity={};h.start=!("start"in i)?function(){return+b.style(i.node,"opacity")||0}:i.start;h.end=i.end;h=b.animateProperty(i);b.connect(h,"beforeBegin",b.partial(e,i.node));return h};b.fadeIn=function(h){return b._fade(f({end:1},h))};b.fadeOut=function(h){return b._fade(f({end:0},h))};b._defaultEasing=function(h){return 0.5+Math.sin((h+1.5)*Math.PI)/2};var k=function(h){this._properties=h;for(var i in h){var m=h[i];if(m.start instanceof b.Color)m.tempColor=
new b.Color}};k.prototype.getValue=function(h){var i={};for(var m in this._properties){var p=this._properties[m],t=p.start;if(t instanceof b.Color)i[m]=b.blendColors(t,p.end,h,p.tempColor).toCss();else b.isArray(t)||(i[m]=(p.end-t)*h+t+(m!="opacity"?p.units||"px":0))}return i};b.animateProperty=function(h){var i=h.node=b.byId(h.node);if(!h.easing)h.easing=b._defaultEasing;h=new b.Animation(h);b.connect(h,"beforeBegin",h,function(){var m={};for(var p in this.properties){if(p=="width"||p=="height")this.node.display=
"block";var t=this.properties[p];if(b.isFunction(t))t=t(i);t=m[p]=f({},b.isObject(t)?t:{end:t});if(b.isFunction(t.start))t.start=t.start(i);if(b.isFunction(t.end))t.end=t.end(i);var y=p.toLowerCase().indexOf("color")>=0,u=function(s,q){var x={height:s.offsetHeight,width:s.offsetWidth}[q];if(x!==undefined)return x;x=b.style(s,q);return q=="opacity"?+x:y?x:parseFloat(x)};if("end"in t){if(!("start"in t))t.start=u(i,p)}else t.end=u(i,p);if(y){t.start=new b.Color(t.start);t.end=new b.Color(t.end)}else t.start=
p=="opacity"?+t.start:parseFloat(t.start)}this.curve=new k(m)});b.connect(h,"onAnimate",b.hitch(b,"style",h.node));return h};b.anim=function(h,i,m,p,t,y){return b.animateProperty({node:h,duration:m||b.Animation.prototype.duration,properties:i,easing:p,onEnd:t}).play(y||0)}})();return b.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(b){return b});
define("orion/serviceregistry",["dojo"],function(b){function f(k,h,i){this.serviceId=k;this.name=h;this.properties=i}function a(k,h,i){this.serviceId=k;this.serviceReference=h;this.internalRegistry=i}function c(k,h,i){this.serviceId=k;this.implementation=h;this.internalRegistry=i;var m;for(m in h)if(typeof h[m]==="function")this[m]=function(p){return function(){if(i.isRegistered(k)){var t=new b.Deferred;try{var y=h[p].apply(h,Array.prototype.slice.call(arguments));b.when(y,b.hitch(t,t.resolve),b.hitch(t,
t.reject))}catch(u){t.reject(u)}return t.promise}throw new Error("Service was unregistered");}}(m)}function d(){this._namedlisteners={}}function e(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new d;var k=this;this.internalRegistry={isRegistered:function(h){return k._entries[h]?true:false},unregisterService:function(h){var i=k._entries[h];if(i){for(var m=i.reference,p=k._namedReferences[m.getName()],t=0;t<p.length;t++)if(p[t]===m){if(p.length===1)delete k._namedReferences[m.getName()];
else p.splice(t,1);break}k._entries[h]=null;k._serviceEventTarget.dispatchEvent("serviceRemoved",m,i.service)}},dispatchEvent:function(h,i){var m=k._entries[h];m&&m.eventTarget.dispatchEvent.apply(m.eventTarget,[i].concat(Array.prototype.slice.call(arguments,2)))},addEventListener:function(h,i,m){(h=k._entries[h])&&h.eventTarget.addEventListener(i,m)},removeEventListener:function(h,i,m){(h=k._entries[h])&&h.eventTarget.removeEventListener(i,m)}}}f.prototype={getServiceId:function(){return this.serviceId},
getName:function(){return this.name},getPropertyNames:function(){var k=[],h;for(h in this.properties)this.properties.hasOwnProperty(h)&&k.push(h);return k},getProperty:function(k){return this.properties[k]}};f.prototype.constructor=f;a.prototype={unregister:function(){this.internalRegistry.unregisterService(this.serviceId)},dispatchEvent:function(k){this.internalRegistry.dispatchEvent.apply(this.internalRegistry,[this.serviceId,k].concat(Array.prototype.slice.call(arguments,1)))},getServiceReference:function(){return this.serviceReference}};
a.prototype.constructor=a;c.prototype={addEventListener:function(k,h){this.internalRegistry.addEventListener(this.serviceId,k,h)},removeEventListener:function(k,h){this.internalRegistry.removeEventListener(this.serviceId,k,h)}};c.prototype.constructor=c;d.prototype={dispatchEvent:function(k){var h=this._namedlisteners[k];if(h)for(var i=0;i<h.length;i++)try{var m=Array.prototype.slice.call(arguments,1);h[i].apply(null,m)}catch(p){console.log(p)}},addEventListener:function(k,h){this._namedlisteners[k]=
this._namedlisteners[k]||[];this._namedlisteners[k].push(h)},removeEventListener:function(k,h){var i=this._namedlisteners[k];if(i)for(var m=0;m<i.length;m++)if(i[m]===h){if(i.length===1)delete this._namedlisteners[k];else i.splice(m,1);break}}};d.prototype.constructor=d;e.prototype={getService:function(k,h){var i,m=new b.Deferred;if(typeof k==="string"){if(this._namedReferences[k])for(var p=0;p<this._namedReferences[k].length;p++)if(i=this._entries[this._namedReferences[k][p].getServiceId()].service)break}else i=
this._entries[k.getServiceId()].service;if(i)m.resolve(i);else if(h===0)m.reject(new Error("timeout: getService"));else{var t=this,y=function(u,s){if(k===u||k===u.getName()){m.resolve(s);t._serviceEventTarget.removeEventListener("serviceAdded",y)}};this._serviceEventTarget.addEventListener("serviceAdded",y)}return m.promise},getServiceReferences:function(k){if(k)return this._namedReferences[k]?this._namedReferences[k]:[];k=[];for(var h=0;h<this._entries.length;h++)this._entries[h]&&k.push(this._entries[h].reference);
return k},registerService:function(k,h,i){var m=this._entries.length;i=new f(m,k,i);h=new c(m,h,this.internalRegistry);this._namedReferences[k]=this._namedReferences[k]||[];this._namedReferences[k].push(i);this._entries.push({reference:i,service:h,eventTarget:new d});this._serviceEventTarget.dispatchEvent("serviceAdded",i,h);return new a(m,i,this.internalRegistry)},addEventListener:function(k,h){this._serviceEventTarget.addEventListener(k,h)},removeEventListener:function(k,h){this._serviceEventTarget.removeEventListener(k,
h)}};e.prototype.constructor=e;return{ServiceReference:f,ServiceRegistration:a,Service:c,EventTarget:d,ServiceRegistry:e}});define("dijit",["dojo"],function(b){return dijit=b._dijit||{}});
define("dojo/hash",["dojo"],function(b){(function(){function f(t,y){y=t.indexOf(y);return y>=0?t.substring(y+1):""}function a(){return f(location.href,"#")}function c(){b.publish("/dojo/hashchange",[a()])}function d(){if(a()!==h){h=a();c()}}function e(t){if(i)if(i.isTransitioning())setTimeout(b.hitch(null,e,t),p);else{var y=i.iframe.location.href,u=y.indexOf("?");i.iframe.location.replace(y.substring(0,u)+"?"+t)}else{location.replace("#"+t);!m&&d()}}function k(){function t(){h=a();s=g?h:f(j.href,
"?");q=false;x=null}var y=document.createElement("iframe"),u=b.config.dojoBlankHtmlUrl||b.moduleUrl("dojo","resources/blank.html");b.config.useXDomain&&!b.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");y.id="dojo-hash-iframe";y.src=u+"?"+a();y.style.display="none";document.body.appendChild(y);this.iframe=b.global["dojo-hash-iframe"];
var s,q,x,w,g,j=this.iframe.location;this.isTransitioning=function(){return q};this.pollLocation=function(){if(!g)try{var l=f(j.href,"?");if(document.title!=w)w=this.iframe.document.title=document.title}catch(n){g=true;console.error("dojo.hash: Error adding history entry. Server unreachable.")}var o=a();if(q&&h===o)if(g||l===x){t();c()}else{setTimeout(b.hitch(this,this.pollLocation),0);return}else if(!(h===o&&(g||s===l)))if(h!==o){h=o;q=true;x=o;y.src=u+"?"+x;g=false;setTimeout(b.hitch(this,this.pollLocation),
0);return}else if(!g){location.href="#"+j.search.substring(1);t();c()}setTimeout(b.hitch(this,this.pollLocation),p)};t();setTimeout(b.hitch(this,this.pollLocation),p)}b.hash=function(t,y){if(!arguments.length)return a();if(t.charAt(0)=="#")t=t.substring(1);if(y)e(t);else location.href="#"+t;return t};var h,i,m,p=b.config.hashPollFrequency||100;b.addOnLoad(function(){if("onhashchange"in b.global&&(!b.isIE||b.isIE>=8&&document.compatMode!="BackCompat"))m=b.connect(b.global,"onhashchange",c);else if(document.addEventListener){h=
a();setInterval(d,p)}else if(document.attachEvent)i=new k})})();return b.hash});
(function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],f=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,a=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,c=[];define("text",["require","exports","module"],function(){var d,e,k;if(typeof window!=="undefined"&&window.navigator&&window.document)e=function(h,i){var m=d.createXhr();m.open("GET",h,true);m.onreadystatechange=function(){m.readyState===4&&i(m.responseText)};m.send(null)};else if(typeof process!=="undefined"&&process.versions&&
process.versions.node){k=require.nodeRequire("fs");e=function(h,i){i(k.readFileSync(h,"utf8"))}}else if(typeof Packages!=="undefined")e=function(h,i){var m=new java.io.File(h);h=java.lang.System.getProperty("line.separator");m=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(m),"utf-8"));var p,t,y="";try{p=new java.lang.StringBuffer;if((t=m.readLine())&&t.length()&&t.charAt(0)===65279)t=t.substring(1);for(p.append(t);(t=m.readLine())!==null;){p.append(h);p.append(t)}y=
String(p.toString())}finally{m.close()}i(y)};return d={version:"0.24.0",strip:function(h){if(h){h=h.replace(f,"");var i=h.match(a);if(i)h=i[1]}else h="";return h},jsEscape:function(h){return h.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 h,i,m;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else for(i=0;i<3;i++){m=b[i];try{h=new ActiveXObject(m)}catch(p){}if(h){b=
[m];break}}if(!h)throw new Error("require.getXhr(): XMLHttpRequest not available");return h},get:e,load:function(h,i,m,p){var t=false,y=h.indexOf("."),u=h.substring(0,y),s=h.substring(y+1,h.length);y=s.indexOf("!");if(y!==-1){t=s.substring(y+1,s.length);t=t==="strip";s=s.substring(0,y)}i=i.nameToUrl(u,"."+s);d.get(i,function(q){q=t?d.strip(q):q;if(p.isBuild&&p.inlineText)c[h]=q;m(q)})},write:function(h,i,m){if(i in c){var p=d.jsEscape(c[i]);m("define('"+h+"!"+i+"', function () { return '"+p+"';});\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(b,f){f.getObject("i18n",true,f);f.i18n.getLocalization=f.i18n.getLocalization||function(a,c,d){d=f.i18n.normalizeLocale(d);var e=d.split("-"),k=[a,"nls",c].join(".");if(typeof f.global.require!=="undefined"){var h=b("i18n!"+[a.replace(/\./g,"/"),"nls",c].join("/"));(f._loadedModules[k]=f._loadedModules[k]||{})[e.join("_")]=h.root||h}if(k=f._loadedModules[k]){var i;for(h=e.length;h>0;h--){var m=e.slice(0,h).join("_");if(k[m]){i=k[m];break}}if(!i)i=k.ROOT;
if(i){a=function(){};a.prototype=i;return new a}}throw new Error("Bundle not found: "+c+" in "+a+" , locale="+d);};f.i18n.normalizeLocale=function(a){a=a?a.toLowerCase():f.locale;if(a=="root")a="ROOT";return a};f.i18n._requireLocalization=function(a,c,d,e){d=f.i18n.normalizeLocale(d);var k=[a,"nls",c].join("."),h="";if(e){for(var i=e.split(","),m=0;m<i.length;m++)if(d.indexOf(i[m])==0)if(i[m].length>h.length)h=i[m];h||(h="ROOT")}i=e?h:d;var p=f._loadedModules[k];m=null;if(p){if(f.config.localizationComplete&&
p._built)return;m=i.replace(/-/g,"_");m=f._loadedModules[k+"."+m]}if(!m){p=f.provide(k);var t=f._getModuleSymbols(a).concat("nls").join("/"),y;f.i18n._searchLocalePath(i,e,function(u){var s=u.replace(/-/g,"_"),q=k+"."+s,x=false;if(f._loadedModules[q])x=true;else{f.provide(q);q=[t];u!="ROOT"&&q.push(u);q.push(c);u=q.join("/")+".js";x=f._loadPath(u,null,function(w){w=w.root||w;var g=function(){};g.prototype=y;p[s]=new g;for(var j in w)p[s][j]=w[j]})}if(x&&p[s])y=p[s];else p[s]=y;if(e)return true})}if(e&&
d!=h)p[d.replace(/-/g,"_")]=p[h.replace(/-/g,"_")]};(function(){var a=f.config.extraLocale;if(a){if(!a instanceof Array)a=[a];var c=f.i18n._requireLocalization;f.i18n._requireLocalization=function(d,e,k,h){c(d,e,k,h);if(!k)for(k=0;k<a.length;k++)c(d,e,a[k],h)}}})();f.i18n._searchLocalePath=function(a,c,d){a=f.i18n.normalizeLocale(a);var e=a.split("-");a=[];for(var k=e.length;k>0;k--)a.push(e.slice(0,k).join("-"));a.push(false);c&&a.reverse();for(c=a.length-1;c>=0;c--)if(d(a[c]||"ROOT"))break};f.i18n._preloadLocalizations=
function(a,c){function d(h){h=f.i18n.normalizeLocale(h);f.i18n._searchLocalePath(h,true,function(i){for(var m=0;m<c.length;m++)if(c[m]==i){f.require(a+"_"+i);return true}return false})}d();for(var e=f.config.extraLocale||[],k=0;k<e.length;k++)d(e[k])};return f.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(b){b.getObject("window",true,b);b.window.getBox=function(){var f=b.doc.compatMode=="BackCompat"?b.body():b.doc.documentElement,a=b._docScroll();return{w:f.clientWidth,h:f.clientHeight,l:a.x,t:a.y}};b.window.get=function(f){if(b.isIE&&window!==document.parentWindow){f.parentWindow.execScript("document._parentWindow = window;","Javascript");var a=f._parentWindow;f._parentWindow=null;return a}return f.parentWindow||f.defaultView};b.window.scrollIntoView=function(f,
a){try{f=b.byId(f);var c=f.ownerDocument||b.doc,d=c.body||b.body(),e=c.documentElement||d.parentNode,k=b.isIE,h=b.isWebKit;if((!(b.isMoz||k||h||b.isOpera)||f==d||f==e)&&typeof f.scrollIntoView!="undefined")f.scrollIntoView(false);else{var i=c.compatMode=="BackCompat",m=k>=9&&f.ownerDocument.parentWindow.frameElement?e.clientHeight>0&&e.clientWidth>0&&(d.clientHeight==0||d.clientWidth==0||d.clientHeight>e.clientHeight||d.clientWidth>e.clientWidth)?e:d:i?d:e;c=h?d:m;var p=m.clientWidth,t=m.clientHeight,
y=!b._isBodyLtr(),u=a||b.position(f),s=f.parentNode;a=function(B){return k<=6||k&&i?false:b.style(B,"position").toLowerCase()=="fixed"};if(!a(f))for(;s;){if(s==d)s=c;var q=b.position(s),x=a(s);if(s==c){q.w=p;q.h=t;if(c==e&&k&&y)q.x+=c.offsetWidth-q.w;if(q.x<0||!k)q.x=0;if(q.y<0||!k)q.y=0}else{var w=b._getPadBorderExtents(s);q.w-=w.w;q.h-=w.h;q.x+=w.l;q.y+=w.t;var g=s.clientWidth,j=q.w-g;if(g>0&&j>0){q.w=g;q.x+=y&&(k||s.clientLeft>w.l)?j:0}g=s.clientHeight;j=q.h-g;if(g>0&&j>0)q.h=g}if(x){if(q.y<0){q.h+=
q.y;q.y=0}if(q.x<0){q.w+=q.x;q.x=0}if(q.y+q.h>t)q.h=t-q.y;if(q.x+q.w>p)q.w=p-q.x}var l=u.x-q.x,n=u.y-Math.max(q.y,0),o=l+u.w-q.w,r=n+u.h-q.h;if(o*l>0){var v=Math[l<0?"max":"min"](l,o);if(y&&(k==8&&!i||k>=9))v=-v;u.x+=s.scrollLeft;s.scrollLeft+=v;u.x-=s.scrollLeft}if(r*n>0){u.y+=s.scrollTop;s.scrollTop+=Math[n<0?"max":"min"](n,r);u.y-=s.scrollTop}s=s!=c&&!x&&s.parentNode}}}catch(z){console.error("scrollIntoView: "+z);f.scrollIntoView(false)}};return b.window});
define("dijit/_base/manager",["dojo","dijit"],function(b,f){b.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||b.global;var d=0,e;for(e in this._hash)a.call(c,this._hash[e],d++,this._hash);return this},
filter:function(a,c){c=c||b.global;var d=new f.WidgetSet,e=0,k;for(k in this._hash){var h=this._hash[k];a.call(c,h,e++,this._hash)&&d.add(h)}return d},byId:function(a){return this._hash[a]},byClass:function(a){var c=new f.WidgetSet,d,e;for(d in this._hash){e=this._hash[d];e.declaredClass==a&&c.add(e)}return c},toArray:function(){var a=[];for(var c in this._hash)a.push(this._hash[c]);return a},map:function(a,c){return b.map(this.toArray(),a,c)},every:function(a,c){c=c||b.global;var d=0,e;for(e in this._hash)if(!a.call(c,
this._hash[e],d++,this._hash))return false;return true},some:function(a,c){c=c||b.global;var d=0,e;for(e in this._hash)if(a.call(c,this._hash[e],d++,this._hash))return true;return false}});(function(){f.registry=new f.WidgetSet;var a=f.registry._hash,c=b.attr,d=b.hasAttr,e=b.style;f.byId=function(m){return typeof m=="string"?a[m]:m};var k={};f.getUniqueId=function(m){var p;do p=m+"_"+(m in k?++k[m]:(k[m]=0));while(a[p]);return f._scopeName=="dijit"?p:f._scopeName+"_"+p};f.findWidgets=function(m){function p(y){for(y=
y.firstChild;y;y=y.nextSibling)if(y.nodeType==1){var u=y.getAttribute("widgetId");if(u)(u=a[u])&&t.push(u);else p(y)}}var t=[];p(m);return t};f._destroyAll=function(){f._curFocus=null;f._prevFocus=null;f._activeStack=[];b.forEach(f.findWidgets(b.body()),function(m){if(!m._destroyed)if(m.destroyRecursive)m.destroyRecursive();else m.destroy&&m.destroy()})};b.isIE&&b.addOnWindowUnload(function(){f._destroyAll()});f.byNode=function(m){return a[m.getAttribute("widgetId")]};f.getEnclosingWidget=function(m){for(;m;){var p=
m.getAttribute&&m.getAttribute("widgetId");if(p)return a[p];m=m.parentNode}return null};var h=f._isElementShown=function(m){var p=e(m);return p.visibility!="hidden"&&p.visibility!="collapsed"&&p.display!="none"&&c(m,"type")!="hidden"};f.hasDefaultTabStop=function(m){switch(m.nodeName.toLowerCase()){case "a":return d(m,"href");case "area":case "button":case "input":case "object":case "select":case "textarea":return true;case "iframe":var p;try{var t=m.contentDocument;if("designMode"in t&&t.designMode==
"on")return true;p=t.body}catch(y){try{p=m.contentWindow.document.body}catch(u){return false}}return p.contentEditable=="true"||p.firstChild&&p.firstChild.contentEditable=="true";default:return m.contentEditable=="true"}};var i=f.isTabNavigable=function(m){return c(m,"disabled")?false:d(m,"tabIndex")?c(m,"tabIndex")>=0:f.hasDefaultTabStop(m)};f._getTabNavigable=function(m){function p(l){return l&&l.tagName.toLowerCase()=="input"&&l.type&&l.type.toLowerCase()=="radio"&&l.name&&l.name.toLowerCase()}
function t(l){return g[p(l)]||l}var y,u,s,q,x,w,g={},j=function(l){b.query("> *",l).forEach(function(n){if(!(b.isIE&&n.scopeName!=="HTML"||!h(n))){if(i(n)){var o=c(n,"tabIndex");if(!d(n,"tabIndex")||o==0){y||(y=n);u=n}else if(o>0){if(!s||o<q){q=o;s=n}if(!x||o>=w){w=o;x=n}}o=p(n);if(b.attr(n,"checked")&&o)g[o]=n}n.nodeName.toUpperCase()!="SELECT"&&j(n)}})};h(m)&&j(m);return{first:t(y),last:t(u),lowest:t(s),highest:t(x)}};f.getFirstInTabbingOrder=function(m){m=f._getTabNavigable(b.byId(m));return m.lowest?
m.lowest:m.first};f.getLastInTabbingOrder=function(m){m=f._getTabNavigable(b.byId(m));return m.last?m.last:m.highest};f.defaultDuration=b.config.defaultDuration||200})();return f});
define("dojo/Stateful",["dojo"],function(b){b.declare("dojo.Stateful",null,{postscript:function(f){f&&b.mixin(this,f)},get:function(f){return this[f]},set:function(f,a){if(typeof f==="object"){for(var c in f)this.set(c,f[c]);return this}c=this[f];this[f]=a;this._watchCallbacks&&this._watchCallbacks(f,c,a);return this},watch:function(f,a){var c=this._watchCallbacks;if(!c){var d=this;c=this._watchCallbacks=function(k,h,i,m){var p=function(t){if(t){t=t.slice();for(var y=0,u=t.length;y<u;y++)try{t[y].call(d,
k,h,i)}catch(s){console.error(s)}}};p(c["_"+k]);m||p(c["*"])}}if(!a&&typeof f==="function"){a=f;f="*"}else f="_"+f;var e=c[f];if(typeof e!=="object")e=c[f]=[];e.push(a);return{unwatch:function(){e.splice(b.indexOf(e,a),1)}}}});return b.Stateful});
define("dijit/_WidgetBase",["dojo","dijit","dijit/_base/manager","dojo/Stateful"],function(b,f){(function(){b.declare("dijit._WidgetBase",b.Stateful,{id:"",lang:"",dir:"","class":"",style:"",title:"",tooltip:"",baseClass:"",srcNodeRef:null,domNode:null,containerNode:null,attributeMap:{id:"",dir:"",lang:"","class":"",style:"",title:""},_blankGif:(b.config.blankGif||b.moduleUrl("dojo","resources/blank.gif")).toString(),postscript:function(a,c){this.create(a,c)},create:function(a,c){this.srcNodeRef=
b.byId(c);this._connects=[];this._subscribes=[];if(this.srcNodeRef&&typeof this.srcNodeRef.id=="string")this.id=this.srcNodeRef.id;if(a){this.params=a;b._mixin(this,a)}this.postMixInProperties();if(!this.id)this.id=f.getUniqueId(this.declaredClass.replace(/\./g,"_"));f.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(d,e){if(e.params&&d in e.params||e[d])e.set(d,e[d])};for(var c in this.attributeMap)a(c,this);b.forEach(this._getSetterAttributes(),function(d){d in this.attributeMap||a(d,this)},this)},_getSetterAttributes:function(){var a=this.constructor;if(!a._setterAttrs){var c=a._setterAttrs=[],d,e=a.prototype;for(var k in e)if(b.isFunction(e[k])&&(d=k.match(/^_set([a-zA-Z]*)Attr$/))&&
d[1])c.push(d[1].charAt(0).toLowerCase()+d[1].substr(1))}return a._setterAttrs},postMixInProperties:function(){},buildRendering:function(){if(!this.domNode)this.domNode=this.srcNodeRef||b.create("div");if(this.baseClass){var a=this.baseClass.split(" ");this.isLeftToRight()||(a=a.concat(b.map(a,function(c){return c+"Rtl"})));b.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=b.forEach,d=b.unsubscribe;c(this._connects,function(e){c(e,b.disconnect)});c(this._subscribes,function(e){d(e)});c(this._supportingWidgets||[],function(e){if(e.destroyRecursive)e.destroyRecursive();else e.destroy&&e.destroy()});this.destroyRendering(a);f.registry.remove(this.id);this._destroyed=true},destroyRendering:function(a){if(this.bgIframe){this.bgIframe.destroy(a);delete this.bgIframe}if(this.domNode){a?b.removeAttr(this.domNode,
"widgetId"):b.destroy(this.domNode);delete this.domNode}if(this.srcNodeRef){a||b.destroy(this.srcNodeRef);delete this.srcNodeRef}},destroyDescendants:function(a){b.forEach(this.getChildren(),function(c){c.destroyRecursive&&c.destroyRecursive(a)})},uninitialize:function(){return false},_setClassAttr:function(a){b.replaceClass(this[this.attributeMap["class"]||"domNode"],a,this["class"]);this._set("class",a)},_setStyleAttr:function(a){var c=this[this.attributeMap.style||"domNode"];if(b.isObject(a))b.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 d=this.attributeMap[a];b.forEach(b.isArray(d)?d:[d],function(e){var k=this[e.node||e||"domNode"];switch(e.type||"attribute"){case "attribute":if(b.isFunction(c))c=b.hitch(this,c);e=e.attribute?e.attribute:/^on[A-Z][a-zA-Z]*$/.test(a)?a.toLowerCase():a;b.attr(k,e,c);break;case "innerText":k.innerHTML="";k.appendChild(b.doc.createTextNode(c));break;case "innerHTML":k.innerHTML=
c;break;case "class":b.replaceClass(k,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 d in a)this.set(d,a[d]);return this}d=this._getAttrNames(a);if(this[d.s])var e=this[d.s].apply(this,Array.prototype.slice.call(arguments,1));else{a in this.attributeMap&&this._attrToDom(a,c);this._set(a,c)}return e||this},_attrPairNames:{},_getAttrNames:function(a){var c=this._attrPairNames;if(c[a])return c[a];
var d=a.charAt(0).toUpperCase()+a.substr(1);return c[a]={n:a+"Node",s:"_set"+d+"Attr",g:"_get"+d+"Attr"}},_set:function(a,c){var d=this[a];this[a]=c;this._watchCallbacks&&this._created&&c!==d&&this._watchCallbacks(a,d,c)},toString:function(){return"[Widget "+this.declaredClass+", "+(this.id||"NO ID")+"]"},getDescendants:function(){return this.containerNode?b.query("[widgetId]",this.containerNode).map(f.byNode):[]},getChildren:function(){return this.containerNode?f.findWidgets(this.containerNode):
[]},connect:function(a,c,d){a=[b._connect(a,c,this,d)];this._connects.push(a);return a},disconnect:function(a){for(var c=0;c<this._connects.length;c++)if(this._connects[c]==a){b.forEach(a,b.disconnect);this._connects.splice(c,1);return}},subscribe:function(a,c){a=b.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){b.unsubscribe(a);this._subscribes.splice(c,1);return}},isLeftToRight:function(){return this.dir?
this.dir=="ltr":b._isBodyLtr()},placeAt:function(a,c){a.declaredClass&&a.addChild?a.addChild(this,c):b.place(this.domNode,a,c);return this}})})();return f._WidgetBase});
define("dijit/_base/focus",["dojo","dijit","dojo/window","dijit/_base/manager"],function(b,f){b.mixin(f,{_curFocus:null,_prevFocus:null,isCollapsed:function(){return f.getBookmark().isCollapsed},getBookmark:function(){var a,c,d=b.doc.selection,e=f._curFocus;if(b.global.getSelection){if(d=b.global.getSelection())if(d.isCollapsed){if(a=e?e.tagName:""){a=a.toLowerCase();if(a=="textarea"||a=="input"&&(!e.type||e.type.toLowerCase()=="text")){d={start:e.selectionStart,end:e.selectionEnd,node:e,pRange:true};
return{isCollapsed:d.end<=d.start,mark:d}}}a={isCollapsed:true};if(d.rangeCount)a.mark=d.getRangeAt(0).cloneRange()}else{c=d.getRangeAt(0);a={isCollapsed:false,mark:c.cloneRange()}}}else if(d){a=e?e.tagName:"";a=a.toLowerCase();if(e&&a&&(a=="button"||a=="textarea"||a=="input"))if(d.type&&d.type.toLowerCase()=="none")return{isCollapsed:true,mark:null};else{c=d.createRange();return{isCollapsed:c.text&&c.text.length?false:true,mark:{range:c,pRange:true}}}a={};try{c=d.createRange();a.isCollapsed=!(d.type==
"Text"?c.htmlText.length:c.length)}catch(k){a.isCollapsed=true;return a}if(d.type.toUpperCase()=="CONTROL")if(c.length){a.mark=[];d=0;for(e=c.length;d<e;)a.mark.push(c.item(d++))}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=b.doc;if(a=a.mark)if(b.global.getSelection){var d=b.global.getSelection();if(d&&d.removeAllRanges)if(a.pRange){d=a.node;d.selectionStart=
a.start;d.selectionEnd=a.end}else{d.removeAllRanges();d.addRange(a)}else console.warn("No idea how to restore selection for this browser!")}else if(c.selection&&a){var e;if(a.pRange)e=a.range;else if(b.isArray(a)){e=c.body.createControlRange();b.forEach(a,function(k){e.addElement(k)})}else{e=c.body.createTextRange();e.moveToBookmark(a)}e.select()}},getFocus:function(a,c){a=!f._curFocus||a&&b.isDescendant(f._curFocus,a.domNode)?f._prevFocus:f._curFocus;return{node:a,bookmark:a==f._curFocus&&b.withGlobal(c||
b.global,f.getBookmark),openedForWindow:c}},focus:function(a){if(a){var c="node"in a?a.node:a,d=a.bookmark;a=a.openedForWindow;var e=d?d.isCollapsed:false;if(c){var k=c.tagName.toLowerCase()=="iframe"?c.contentWindow:c;if(k&&k.focus)try{k.focus()}catch(h){}f._onFocusNode(c)}if(d&&b.withGlobal(a||b.global,f.isCollapsed)&&!e){a&&a.focus();try{b.withGlobal(a||b.global,f.moveToBookmark,null,[d])}catch(i){}}}},_activeStack:[],registerIframe:function(a){return f.registerWin(a.contentWindow,a)},unregisterIframe:function(a){f.unregisterWin(a)},
registerWin:function(a,c){var d=function(p){f._justMouseDowned=true;setTimeout(function(){f._justMouseDowned=false},0);b.isIE&&p&&p.srcElement&&p.srcElement.parentNode==null||f._onTouchNode(c||p.target||p.srcElement,"mouse")},e=b.isIE?a.document.documentElement:a.document;if(e)if(b.isIE){a.document.body.attachEvent("onmousedown",d);var k=function(p){p.srcElement.tagName.toLowerCase()!="#document"&&f.isTabNavigable(p.srcElement)?f._onFocusNode(c||p.srcElement):f._onTouchNode(c||p.srcElement)};e.attachEvent("onactivate",
k);var h=function(p){f._onBlurNode(c||p.srcElement)};e.attachEvent("ondeactivate",h);return function(){a.document.detachEvent("onmousedown",d);e.detachEvent("onactivate",k);e.detachEvent("ondeactivate",h);e=null}}else{e.body.addEventListener("mousedown",d,true);var i=function(p){f._onFocusNode(c||p.target)};e.addEventListener("focus",i,true);var m=function(p){f._onBlurNode(c||p.target)};e.addEventListener("blur",m,true);return function(){e.body.removeEventListener("mousedown",d,true);e.removeEventListener("focus",
i,true);e.removeEventListener("blur",m,true);e=null}}},unregisterWin:function(a){a&&a()},_onBlurNode:function(){f._prevFocus=f._curFocus;f._curFocus=null;if(!f._justMouseDowned){f._clearActiveWidgetsTimer&&clearTimeout(f._clearActiveWidgetsTimer);f._clearActiveWidgetsTimer=setTimeout(function(){delete f._clearActiveWidgetsTimer;f._setStack([]);f._prevFocus=null},100)}},_onTouchNode:function(a,c){if(f._clearActiveWidgetsTimer){clearTimeout(f._clearActiveWidgetsTimer);delete f._clearActiveWidgetsTimer}var d=
[];try{for(;a;){var e=b.attr(a,"dijitPopupParent");if(e)a=f.byId(e).domNode;else if(a.tagName&&a.tagName.toLowerCase()=="body"){if(a===b.body())break;a=b.window.get(a.ownerDocument).frameElement}else{var k=a.getAttribute&&a.getAttribute("widgetId"),h=k&&f.byId(k);h&&!(c=="mouse"&&h.get("disabled"))&&d.unshift(k);a=a.parentNode}}}catch(i){}f._setStack(d,c)},_onFocusNode:function(a){if(a)if(a.nodeType!=9){f._onTouchNode(a);if(a!=f._curFocus){if(f._curFocus)f._prevFocus=f._curFocus;f._curFocus=a;b.publish("focusNode",
[a])}}},_setStack:function(a,c){var d=f._activeStack;f._activeStack=a;for(var e=0;e<Math.min(d.length,a.length);e++)if(d[e]!=a[e])break;for(var k,h=d.length-1;h>=e;h--)if(k=f.byId(d[h])){k._focused=false;k.set("focused",false);k._hasBeenBlurred=true;k._onBlur&&k._onBlur(c);b.publish("widgetBlur",[k,c])}for(h=e;h<a.length;h++)if(k=f.byId(a[h])){k._focused=true;k.set("focused",true);k._onFocus&&k._onFocus(c);b.publish("widgetFocus",[k,c])}}});b.addOnLoad(function(){var a=f.registerWin(window);b.isIE&&
b.addOnWindowUnload(function(){f.unregisterWin(a);a=null})});return f});
define("dojo/AdapterRegistry",["dojo"],function(b){b.AdapterRegistry=function(f){this.pairs=[];this.returnWrappers=f||false};b.extend(b.AdapterRegistry,{register:function(f,a,c,d,e){this.pairs[e?"unshift":"push"]([f,a,c,d])},match:function(){for(var f=0;f<this.pairs.length;f++){var a=this.pairs[f];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(f){for(var a=0;a<this.pairs.length;a++)if(this.pairs[a][0]==
f){this.pairs.splice(a,1);return true}return false}});return b.AdapterRegistry});
define("dijit/_base/place",["dojo","dijit","dojo/window","dojo/AdapterRegistry"],function(b,f){f.getViewport=function(){return b.window.getBox()};f.placeOnScreen=function(a,c,d,e){d=b.map(d,function(k){var h={corner:k,pos:{x:c.x,y:c.y}};if(e){h.pos.x+=k.charAt(1)=="L"?e.x:-e.x;h.pos.y+=k.charAt(0)=="T"?e.y:-e.y}return h});return f._place(a,d)};f._place=function(a,c,d,e){var k=b.window.getBox();if(!a.parentNode||String(a.parentNode.tagName).toLowerCase()!="body")b.body().appendChild(a);var h=null;
b.some(c,function(m){var p=m.corner,t=m.pos,y=0,u={w:p.charAt(1)=="L"?k.l+k.w-t.x:t.x-k.l,h:p.charAt(1)=="T"?k.t+k.h-t.y:t.y-k.t};if(d){y=d(a,m.aroundCorner,p,u,e);y=typeof y=="undefined"?0:y}var s=a.style,q=s.display,x=s.visibility;s.visibility="hidden";s.display="";var w=b.marginBox(a);s.display=q;s.visibility=x;s=Math.max(k.l,p.charAt(1)=="L"?t.x:t.x-w.w);q=Math.max(k.t,p.charAt(0)=="T"?t.y:t.y-w.h);x=Math.min(k.l+k.w,p.charAt(1)=="L"?s+w.w:t.x);t=Math.min(k.t+k.h,p.charAt(0)=="T"?q+w.h:t.y);x=
x-s;t=t-q;y+=w.w-x+(w.h-t);if(h==null||y<h.overflow)h={corner:p,aroundCorner:m.aroundCorner,x:s,y:q,w:x,h:t,overflow:y,spaceAvailable:u};return!y});h.overflow&&d&&d(a,h.aroundCorner,h.corner,h.spaceAvailable,e);c=b._isBodyLtr();var i=a.style;i.top=h.y+"px";i[c?"left":"right"]=(c?h.x:k.w-h.x-h.w)+"px";return h};f.placeOnScreenAroundNode=function(a,c,d,e){c=b.byId(c);c=b.position(c,true);return f._placeOnScreenAroundRect(a,c.x,c.y,c.w,c.h,d,e)};f.placeOnScreenAroundRectangle=function(a,c,d,e){return f._placeOnScreenAroundRect(a,
c.x,c.y,c.width,c.height,d,e)};f._placeOnScreenAroundRect=function(a,c,d,e,k,h,i){var m=[];for(var p in h)m.push({aroundCorner:p,corner:h[p],pos:{x:c+(p.charAt(1)=="L"?0:e),y:d+(p.charAt(0)=="T"?0:k)}});return f._place(a,m,i,{w:e,h:k})};f.placementRegistry=new b.AdapterRegistry;f.placementRegistry.register("node",function(a,c){return typeof c=="object"&&typeof c.offsetWidth!="undefined"&&typeof c.offsetHeight!="undefined"},f.placeOnScreenAroundNode);f.placementRegistry.register("rect",function(a,
c){return typeof c=="object"&&"x"in c&&"y"in c&&"width"in c&&"height"in c},f.placeOnScreenAroundRectangle);f.placeOnScreenAroundElement=function(){return f.placementRegistry.match.apply(f.placementRegistry,arguments)};f.getPopupAroundAlignment=function(a,c){var d={};b.forEach(a,function(e){switch(e){case "after":d[c?"BR":"BL"]=c?"BL":"BR";break;case "before":d[c?"BL":"BR"]=c?"BR":"BL";break;case "below-alt":c=!c;case "below":d[c?"BL":"BR"]=c?"TL":"TR";d[c?"BR":"BL"]=c?"TR":"TL";break;case "above-alt":c=
!c;case "above":default:d[c?"TL":"TR"]=c?"BL":"BR";d[c?"TR":"TL"]=c?"BR":"BL";break}});return d};return f});define("dijit/_base/window",["dojo","dijit","dojo/window"],function(b,f){f.getDocumentWindow=function(a){return b.window.get(a)};return f});
define("dijit/_base/popup",["dojo","dijit","dijit/_base/focus","dijit/_base/place","dijit/_base/window"],function(b,f){f.popup={_stack:[],_beginZIndex:1E3,_idGen:1,_createWrapper:function(a){var c=a.declaredClass?a._popupWrapper:a.parentNode&&b.hasClass(a.parentNode,"dijitPopup"),d=a.domNode||a;if(!c){c=b.create("div",{"class":"dijitPopup",style:{display:"none"},role:"presentation"},b.body());c.appendChild(d);d=d.style;d.display="";d.visibility="";d.position="";d.top="0px";if(a.declaredClass){a._popupWrapper=
c;b.connect(a,"destroy",function(){b.destroy(c);delete a._popupWrapper})}}return c},moveOffScreen:function(a){a=this._createWrapper(a);b.style(a,{visibility:"hidden",top:"-9999px",display:""})},hide:function(a){a=this._createWrapper(a);b.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,d=a.popup,e=a.orient||((a.parent?a.parent.isLeftToRight():b._isBodyLtr())?{BL:"TL",BR:"TR",
TL:"BL",TR:"BR"}:{BR:"TR",BL:"TL",TR:"BR",TL:"BL"}),k=a.around,h=a.around&&a.around.id?a.around.id+"_dropdown":"popup_"+this._idGen++;c.length&&(!a.parent||!b.isDescendant(a.parent.domNode,c[c.length-1].widget.domNode));)f.popup.close(c[c.length-1].widget);var i=this._createWrapper(d);b.attr(i,{id:h,style:{zIndex:this._beginZIndex+c.length},"class":"dijitPopup "+(d.baseClass||d["class"]||"").split(" ")[0]+"Popup",dijitPopupParent:a.parent?a.parent.id:""});if(b.isIE||b.isMoz)if(!d.bgIframe)d.bgIframe=
new f.BackgroundIframe(i);e=k?f.placeOnScreenAroundElement(i,k,e,d.orient?b.hitch(d,"orient"):null):f.placeOnScreen(i,a,e=="R"?["TR","BR","TL","BL"]:["TL","BL","TR","BR"],a.padding);i.style.display="";i.style.visibility="visible";d.domNode.style.visibility="visible";k=[];k.push(b.connect(i,"onkeypress",this,function(m){if(m.charOrCode==b.keys.ESCAPE&&a.onCancel){b.stopEvent(m);a.onCancel()}else if(m.charOrCode===b.keys.TAB){b.stopEvent(m);(m=this.getTopPopup())&&m.onCancel&&m.onCancel()}}));d.onCancel&&
k.push(b.connect(d,"onCancel",a.onCancel));k.push(b.connect(d,d.onExecute?"onExecute":"onChange",this,function(){var m=this.getTopPopup();m&&m.onExecute&&m.onExecute()}));c.push({widget:d,parent:a.parent,onExecute:a.onExecute,onCancel:a.onCancel,onClose:a.onClose,handlers:k});d.onOpen&&d.onOpen(e);return e},close:function(a){for(var c=this._stack;a&&b.some(c,function(h){return h.widget==a})||!a&&c.length;){var d=c.pop(),e=d.widget,k=d.onClose;e.onClose&&e.onClose();b.forEach(d.handlers,b.disconnect);
e&&e.domNode&&this.hide(e);k&&k()}}};f._frames=new (function(){var a=[];this.pop=function(){var c;if(a.length){c=a.pop();c.style.display=""}else{if(b.isIE<9){c="<iframe src='"+(b.config.dojoBlankHtmlUrl||b.moduleUrl("dojo","resources/blank.html")+""||'javascript:""')+"' style='position: absolute; left: 0px; top: 0px;z-index: -1; filter:Alpha(Opacity=\"0\");'>";c=b.doc.createElement(c)}else{c=b.create("iframe");c.src='javascript:""';c.className="dijitBackgroundIframe";b.style(c,"opacity",0.1)}c.tabIndex=
-1;f.setWaiRole(c,"presentation")}return c};this.push=function(c){c.style.display="none";a.push(c)}});f.BackgroundIframe=function(a){if(!a.id)throw new Error("no id");if(b.isIE||b.isMoz){var c=this.iframe=f._frames.pop();a.appendChild(c);if(b.isIE<7||b.isQuirks){this.resize(a);this._conn=b.connect(a,"onresize",this,function(){this.resize(a)})}else b.style(c,{width:"100%",height:"100%"})}};b.extend(f.BackgroundIframe,{resize:function(a){this.iframe&&b.style(this.iframe,{width:a.offsetWidth+"px",height:a.offsetHeight+
"px"})},destroy:function(){if(this._conn){b.disconnect(this._conn);this._conn=null}if(this.iframe){f._frames.push(this.iframe);delete this.iframe}}});return f.popup});define("dijit/_base/scroll",["dojo","dijit","dojo/window"],function(b,f){f.scrollIntoView=function(a,c){b.window.scrollIntoView(a,c)};return f.scrollIntoView});
define("dojo/uacss",["dojo"],function(b){(function(){var f=b.doc.documentElement,a=b.isIE,c=b.isOpera,d=Math.floor,e=b.isFF,k=b.boxModel.replace(/-/,"");a={dj_ie:a,dj_ie6:d(a)==6,dj_ie7:d(a)==7,dj_ie8:d(a)==8,dj_ie9:d(a)==9,dj_quirks:b.isQuirks,dj_iequirks:a&&b.isQuirks,dj_opera:c,dj_khtml:b.isKhtml,dj_webkit:b.isWebKit,dj_safari:b.isSafari,dj_chrome:b.isChrome,dj_gecko:b.isMozilla,dj_ff3:d(e)==3};a["dj_"+k]=true;var h="";for(var i in a)if(a[i])h+=i+" ";f.className=b.trim(f.className+" "+h);b._loaders.unshift(function(){if(!b._isBodyLtr()){var m=
"dj_rtl dijitRtl "+h.replace(/ /g,"-rtl ");f.className=b.trim(f.className+" "+m)}})})();return b});define("dijit/_base/sniff",["dojo","dijit","dojo/uacss"],function(b,f){return f});
define("dijit/_base/typematic",["dojo","dijit"],function(b,f){f.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(b.hitch(this,"_fireEventAndReload"),this._currentTimeout)},trigger:function(a,c,d,e,k,h,i,m){if(k!=this._obj){this.stop();
this._initialDelay=i||500;this._subsequentDelay=h||0.9;this._minDelay=m||10;this._obj=k;this._evt=a;this._node=d;this._count=this._currentTimeout=-1;this._callback=b.hitch(c,e);this._fireEventAndReload();this._evt=b.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,d,e,k,h,i){if(c.keyCode){c.charOrCode=c.keyCode;b.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);b.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0")}return[b.connect(a,"onkeypress",this,function(m){if(m.charOrCode==c.charOrCode&&(c.ctrlKey===undefined||c.ctrlKey==m.ctrlKey)&&(c.altKey===undefined||c.altKey==m.altKey)&&(c.metaKey===undefined||c.metaKey==(m.metaKey||false))&&(c.shiftKey===undefined||c.shiftKey==m.shiftKey)){b.stopEvent(m);f.typematic.trigger(m,
d,a,e,c,k,h,i)}else f.typematic._obj==c&&f.typematic.stop()}),b.connect(a,"onkeyup",this,function(){f.typematic._obj==c&&f.typematic.stop()})]},addMouseListener:function(a,c,d,e,k,h){var i=b.connect;return[i(a,"mousedown",this,function(m){b.stopEvent(m);f.typematic.trigger(m,c,a,d,a,e,k,h)}),i(a,"mouseup",this,function(m){b.stopEvent(m);f.typematic.stop()}),i(a,"mouseout",this,function(m){b.stopEvent(m);f.typematic.stop()}),i(a,"mousemove",this,function(m){m.preventDefault()}),i(a,"dblclick",this,
function(m){b.stopEvent(m);if(b.isIE){f.typematic.trigger(m,c,a,d,a,e,k,h);setTimeout(b.hitch(this,f.typematic.stop),50)}})]},addListener:function(a,c,d,e,k,h,i,m){return this.addKeyListener(c,d,e,k,h,i,m).concat(this.addMouseListener(a,e,k,h,i,m))}};return f.typematic});
define("dijit/_base/wai",["dojo","dijit"],function(b,f){f.wai={onload:function(){var a=b.create("div",{id:"a11yTestNode",style:{cssText:'border: 1px solid;border-color:red green;position: absolute;height: 5px;top: -999px;background-image: url("'+(b.config.blankGif||b.moduleUrl("dojo","resources/blank.gif"))+'");'}},b.body()),c=b.getComputedStyle(a);if(c){var d=c.backgroundImage;b[c.borderTopColor==c.borderRightColor||d!=null&&(d=="none"||d=="url(invalid-url:)")?"addClass":"removeClass"](b.body(),
"dijit_a11y");if(b.isIE)a.outerHTML="";else b.body().removeChild(a)}}};if(b.isIE||b.isMoz)b._loaders.unshift(f.wai.onload);b.mixin(f,{hasWaiRole:function(a,c){a=this.getWaiRole(a);return c?a.indexOf(c)>-1:a.length>0},getWaiRole:function(a){return b.trim((b.attr(a,"role")||"").replace("wairole:",""))},setWaiRole:function(a,c){b.attr(a,"role",c)},removeWaiRole:function(a,c){var d=b.attr(a,"role");if(d)if(c){c=b.trim((" "+d+" ").replace(" "+c+" "," "));b.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,d){a.setAttribute("aria-"+c,d)},removeWaiState:function(a,c){a.removeAttribute("aria-"+c)}});return f});
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(b,f){return f._base});
define("dijit/_Widget",["dojo","dijit","dijit/_WidgetBase","dijit/_base"],function(b,f){b.connect(b,"_connect",function(a,c){a&&b.isFunction(a._onConnect)&&a._onConnect(c)});f._connectOnUseEventHandler=function(){};f._lastKeyDownNode=null;b.isIE?function(){var a=function(c){f._lastKeyDownNode=c.srcElement};b.doc.attachEvent("onkeydown",a);b.addOnWindowUnload(function(){b.doc.detachEvent("onkeydown",a)})}():b.doc.addEventListener("keydown",function(a){f._lastKeyDownNode=a.target},true);(function(){b.declare("dijit._Widget",
f._WidgetBase,{_deferredConnects:{onClick:"",onDblClick:"",onKeyDown:"",onKeyPress:"",onKeyUp:"",onMouseMove:"",onMouseDown:"",onMouseOut:"",onMouseOver:"",onMouseLeave:"",onMouseEnter:"",onMouseUp:""},onClick:f._connectOnUseEventHandler,onDblClick:f._connectOnUseEventHandler,onKeyDown:f._connectOnUseEventHandler,onKeyPress:f._connectOnUseEventHandler,onKeyUp:f._connectOnUseEventHandler,onMouseDown:f._connectOnUseEventHandler,onMouseMove:f._connectOnUseEventHandler,onMouseOut:f._connectOnUseEventHandler,
onMouseOver:f._connectOnUseEventHandler,onMouseLeave:f._connectOnUseEventHandler,onMouseEnter:f._connectOnUseEventHandler,onMouseUp:f._connectOnUseEventHandler,create:function(){this._deferredConnects=b.clone(this._deferredConnects);for(var a in this.attributeMap)delete this._deferredConnects[a];for(a in this._deferredConnects)this[a]!==f._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&&b.style(this.domNode,"display")!="none"},onFocus:function(){},onBlur:function(){},_onFocus:function(){this.onFocus()},_onBlur:function(){this.onBlur()},setAttribute:function(a,c){b.deprecated(this.declaredClass+"::setAttribute(attr, value) is deprecated. Use set() instead.","","2.0");this.set(a,c)},attr:function(a){if(b.config.isDebug){var c=
arguments.callee._ach||(arguments.callee._ach={}),d=(arguments.callee.caller||"unknown caller").toString();if(!c[d]){b.deprecated(this.declaredClass+"::attr() is deprecated. Use get() or set() instead, called from "+d,"","2.0");c[d]=true}}return arguments.length>=2||typeof a==="object"?this.set.apply(this,arguments):this.get(a)},nodesWithKeyClick:["input","button"],connect:function(a,c,d){var e=b._connect,k=this.inherited(arguments,[a,c=="ondijitclick"?"onclick":c,d]);if(c=="ondijitclick")if(b.indexOf(this.nodesWithKeyClick,
a.nodeName.toLowerCase())==-1){var h=b.hitch(this,d);k.push(e(a,"onkeydown",this,function(i){if((i.keyCode==b.keys.ENTER||i.keyCode==b.keys.SPACE)&&!i.ctrlKey&&!i.shiftKey&&!i.altKey&&!i.metaKey){f._lastKeyDownNode=i.target;"openDropDown"in this&&a==this._buttonNode||i.preventDefault()}}),e(a,"onkeyup",this,function(i){if((i.keyCode==b.keys.ENTER||i.keyCode==b.keys.SPACE)&&i.target==f._lastKeyDownNode&&!i.ctrlKey&&!i.shiftKey&&!i.altKey&&!i.metaKey){f._lastKeyDownNode=null;return h(i)}}))}return k},
_onShow:function(){this.onShow()},onShow:function(){},onHide:function(){},onClose:function(){return true}})})();return f._Widget});
define("dojo/string",["dojo"],function(b){b.getObject("string",true,b);b.string.rep=function(f,a){if(a<=0||!f)return"";for(var c=[];;){a&1&&c.push(f);if(!(a>>=1))break;f+=f}return c.join("")};b.string.pad=function(f,a,c,d){c||(c="0");f=String(f);a=b.string.rep(c,Math.ceil((a-f.length)/c.length));return d?f+a:a+f};b.string.substitute=function(f,a,c,d){d=d||b.global;c=c?b.hitch(d,c):function(e){return e};return f.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g,function(e,k,h){e=b.getObject(k,false,
a);if(h)e=b.getObject(h,false,d).call(d,e,k);return c(e,k).toString()})};b.string.trim=String.prototype.trim?b.trim:function(f){f=f.replace(/^\s+/,"");for(var a=f.length-1;a>=0;a--)if(/\S/.test(f.charAt(a))){f=f.substring(0,a+1);break}return f};return b.string});
define("dojo/date/stamp",["dojo"],function(b){b.getObject("date.stamp",true,b);b.date.stamp.fromISOString=function(f,a){if(!b.date.stamp._isoRegExp)b.date.stamp._isoRegExp=/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/;var c=b.date.stamp._isoRegExp.exec(f);f=null;if(c){c.shift();c[1]&&c[1]--;if(c[6])c[6]*=1E3;if(a){a=new Date(a);b.forEach(b.map(["FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds"],function(k){return a["get"+
k]()}),function(k,h){c[h]=c[h]||k})}f=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)f.setFullYear(c[0]||1970);var d=0,e=c[7]&&c[7].charAt(0);if(e!="Z"){d=(c[8]||0)*60+(Number(c[9])||0);if(e!="-")d*=-1}if(e)d-=f.getTimezoneOffset();d&&f.setTime(f.getTime()+d*6E4)}return f};b.date.stamp.toISOString=function(f,a){var c=function(h){return h<10?"0"+h:h};a=a||{};var d=[],e=a.zulu?"getUTC":"get",k="";if(a.selector!="time"){k=f[e+"FullYear"]();k=["0000".substr((k+"").length)+
k,c(f[e+"Month"]()+1),c(f[e+"Date"]())].join("-")}d.push(k);if(a.selector!="date"){k=[c(f[e+"Hours"]()),c(f[e+"Minutes"]()),c(f[e+"Seconds"]())].join(":");e=f[e+"Milliseconds"]();if(a.milliseconds)k+="."+(e<100?"0":"")+c(e);if(a.zulu)k+="Z";else if(a.selector!="time"){f=f.getTimezoneOffset();a=Math.abs(f);k+=(f>0?"-":"+")+c(Math.floor(a/60))+":"+c(a%60)}d.push(k)}return d.join("T")};return b.date.stamp});
define("dojo/parser",["dojo","dojo/date/stamp"],function(b){b.parser=new (function(){function f(i){if(e.isString(i))return"string";if(typeof i=="number")return"number";if(typeof i=="boolean")return"boolean";if(e.isFunction(i))return"function";if(e.isArray(i))return"array";if(i instanceof Date)return"date";if(i instanceof e._Url)return"url";return"object"}function a(i,m){switch(m){case "string":return i;case "number":return i.length?Number(i):NaN;case "boolean":return typeof i=="boolean"?i:i.toLowerCase()!=
"false";case "function":if(e.isFunction(i)){i=i.toString();i=e.trim(i.substring(i.indexOf("{")+1,i.length-1))}try{return i===""||i.search(/[^\w\.]+/i)!=-1?new Function(i):e.getObject(i,false)||new Function(i)}catch(p){return new Function}case "array":return i?i.split(/\s*,\s*/):[];case "date":switch(i){case "":return new Date("");case "now":return new Date;default:return e.date.stamp.fromISOString(i)}case "url":return e.baseUrl+i;default:return e.fromJson(i)}}function c(i,m){for(var p in i)if(p.charAt(0)!=
"_")p in k||(m[p]=f(i[p]));return m}function d(i,m){var p=h[i];if(p){if(!m&&!p.params)p.params=c(p.cls.prototype,{})}else{i=e.getObject(i);p=null;if(!i)return null;m||(p=c(i.prototype,{}));p={cls:i,params:p}}return p}var e=b,k={},h={};e.connect(e,"extend",function(){h={}});this._functionFromScript=function(i,m){var p="",t="";(m=i.getAttribute(m+"args")||i.getAttribute("args"))&&e.forEach(m.split(/\s*,\s*/),function(y,u){p+="var "+y+" = arguments["+u+"]; "});(m=i.getAttribute("with"))&&m.length&&e.forEach(m.split(/\s*,\s*/),
function(y){p+="with("+y+"){";t+="}"});return new Function(p+i.innerHTML+t)};this.instantiate=function(i,m,p){var t=[];m=m||{};p=p||{};var y=(p.scope||e._scopeName)+"Type",u="data-"+(p.scope||e._scopeName)+"-";e.forEach(i,function(s){if(s){var q,x,w,g,j,l;if(s.node){q=s.node;x=s.type;l=s.fastpath;g=(w=s.clsInfo||x&&d(x,l))&&w.cls;j=s.scripts}else{q=s;j=(g=(w=(x=y in m?m[y]:q.getAttribute(y))&&d(x))&&w.cls)&&(g._noScript||g.prototype._noScript)?[]:e.query("> script[type^='dojo/']",q)}if(!w)throw new Error("Could not load class '"+
x);var n={};p.defaults&&e._mixin(n,p.defaults);s.inherited&&e._mixin(n,s.inherited);if(l){if((w=q.getAttribute(u+"props"))&&w.length)try{w=e.fromJson.call(p.propsThis,"{"+w+"}");e._mixin(n,w)}catch(o){throw new Error(o.toString()+" in data-dojo-props='"+w+"'");}if(w=q.getAttribute(u+"attach-point"))n.dojoAttachPoint=w;if(w=q.getAttribute(u+"attach-event"))n.dojoAttachEvent=w;b.mixin(n,m)}else{s=q.attributes;for(var r in w.params){x=r in m?{value:m[r],specified:true}:s.getNamedItem(r);if(!(!x||!x.specified&&
(!b.isIE||r.toLowerCase()!="value"))){x=x.value;switch(r){case "class":x="className"in m?m.className:q.className;break;case "style":x="style"in m?m.style:q.style&&q.style.cssText}var v=w.params[r];n[r]=typeof x=="string"?a(x,v):x}}}var z=[],B=[];e.forEach(j,function(E){q.removeChild(E);var F=E.getAttribute(u+"event")||E.getAttribute("event"),J=E.getAttribute("type");E=e.parser._functionFromScript(E,u);if(F)if(J=="dojo/connect")z.push({event:F,func:E});else n[F]=E;else B.push(E)});var D=(j=g.markupFactory||
g.prototype&&g.prototype.markupFactory)?j(n,q,g):new g(n,q);t.push(D);(g=q.getAttribute(u+"id")||q.getAttribute("jsId"))&&e.setObject(g,D);e.forEach(z,function(E){e.connect(D,E.event,null,E.func)});e.forEach(B,function(E){E.call(D)})}});m._started||e.forEach(t,function(s){if(!p.noStart&&s&&b.isFunction(s.startup)&&!s._started&&(!s.getParent||!s.getParent()))s.startup()});return t};this.parse=function(i,m){function p(q,x){var w=b.clone(q.inherited);b.forEach(["dir","lang"],function(r){var v=q.node.getAttribute(r);
if(v)w[r]=v});for(var g=q.clsInfo&&!q.clsInfo.cls.prototype._noScript?q.scripts:null,j=!q.clsInfo||!q.clsInfo.cls.prototype.stopParser||m&&m.template,l=q.node.firstChild;l;l=l.nextSibling)if(l.nodeType==1){var n,o=j&&l.getAttribute(y+"type");n=o?o:j&&l.getAttribute(t);o=o==n;if(n){n={type:n,fastpath:o,clsInfo:d(n,o),node:l,scripts:[],inherited:w};x.push(n);p(n,x)}else if(g&&l.nodeName.toLowerCase()=="script")(n=l.getAttribute("type"))&&/^dojo\/\w/i.test(n)&&g.push(l);else j&&p({node:l,inherited:w},
x)}}if(!m&&i&&i.rootNode){m=i;i=m.rootNode}else i=i;i=i?b.byId(i):b.body();m=m||{};var t=(m.scope||e._scopeName)+"Type",y="data-"+(m.scope||e._scopeName)+"-",u={};if(m&&m.inherited)for(var s in m.inherited)if(m.inherited[s])u[s]=m.inherited[s];s=[];p({node:i,inherited:u},s);return this.instantiate(s,m&&m.template?{template:true}:null,m)}});(function(){var f=function(){b.config.parseOnLoad&&b.parser.parse()};b.getObject("dijit.wai.onload")===b._loaders[0]?b._loaders.splice(1,0,f):b._loaders.unshift(f)})();
return b.parser});
define("dojo/cache",["dojo"],function(b){var f={};b.cache=function(a,c,d){if(typeof a=="string")var e=b.moduleUrl(a,c);else{e=a;d=c}e=e.toString();var k=d;if(d!=undefined&&!b.isString(d))k="value"in d?d.value:undefined;d=d&&d.sanitize?true:false;if(typeof k=="string")k=f[e]=d?b.cache._sanitize(k):k;else if(k===null)delete f[e];else{if(!(e in f)){k=undefined;if(b.isFunction(require)&&b.isString(a))try{var h=(a?a.replace(/\./g,"/")+"/":"")+c;k=require("text!"+h)}catch(i){}if(typeof k==="undefined")k=
b._getText(e);f[e]=d?b.cache._sanitize(k):k}k=f[e]}return k};b.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 b.cache});
define("dijit/_Templated",["dojo","dijit","dijit/_Widget","dojo/string","dojo/parser","dojo/cache"],function(b,f){b.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,d=this;return b.string.substitute(a,this,function(e,k){if(k.charAt(0)=="!")e=b.getObject(k.substr(1),false,d);if(typeof e==
"undefined")throw new Error(c+" template:"+k);if(e==null)return"";return k.charAt(0)=="!"?e:e.toString().replace(/"/g,"&quot;")},this)},buildRendering:function(){var a=f._Templated.getCachedTemplate(this.templatePath,this.templateString,this._skipNodeCache),c;if(b.isString(a)){c=b._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=
b.parser.parse(c,{noStart:!this._earlyTemplatedStartup,template:true,inherited:{dir:this.dir,lang:this.lang},propsThis:this,scope:"dojo"});this._supportingWidgets=f.findWidgets(c);this._attachTemplateNodes(a,function(d,e){return d[e]})}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(t,y){return t.getAttribute(y)};for(var d=b.isArray(a)?a:a.all||a.getElementsByTagName("*"),
e=b.isArray(a)?0:-1;e<d.length;e++){var k=e==-1?a:d[e];if(!(this.widgetsInTemplate&&(c(k,"dojoType")||c(k,"data-dojo-type")))){var h=c(k,"dojoAttachPoint")||c(k,"data-dojo-attach-point");if(h)for(var i=h.split(/\s*,\s*/);h=i.shift();){if(b.isArray(this[h]))this[h].push(k);else this[h]=k;this._attachPoints.push(h)}if(h=c(k,"dojoAttachEvent")||c(k,"data-dojo-attach-event")){i=h.split(/\s*,\s*/);for(var m=b.trim;h=i.shift();)if(h){var p=null;if(h.indexOf(":")!=-1){p=h.split(":");h=m(p[0]);p=m(p[1])}else h=
m(h);p||(p=h);this._attachEvents.push(this.connect(k,h,p))}}(h=c(k,"waiRole"))&&f.setWaiRole(k,h);(h=c(k,"waiState"))&&b.forEach(h.split(/\s*,\s*/),function(t){if(t.indexOf("-")!=-1){t=t.split("-");f.setWaiState(k,t[0],t[1])}})}}},startup:function(){b.forEach(this._startupWidgets,function(a){a&&!a._started&&a.startup&&a.startup()});this.inherited(arguments)},destroyRendering:function(){b.forEach(this._attachPoints,function(a){delete this[a]},this);this._attachPoints=[];b.forEach(this._attachEvents,
this.disconnect,this);this._attachEvents=[];this.inherited(arguments)}});f._Templated._templateCache={};f._Templated.getCachedTemplate=function(a,c,d){var e=f._Templated._templateCache,k=c||a,h=e[k];if(h){try{if(!h.ownerDocument||h.ownerDocument==b.doc)return h}catch(i){}b.destroy(h)}c||(c=b.cache(a,{sanitize:true}));c=b.string.trim(c);if(d||c.match(/\$\{([^\}]+)\}/g))return e[k]=c;else{a=b._toDom(c);if(a.nodeType!=1)throw new Error("Invalid template: "+c);return e[k]=a}};b.isIE&&b.addOnWindowUnload(function(){var a=
f._Templated._templateCache;for(var c in a){var d=a[c];typeof d=="object"&&b.destroy(d);delete a[c]}});b.extend(f._Widget,{dojoAttachEvent:"",dojoAttachPoint:"",waiRole:"",waiState:""});return f._Templated});
define("dijit/_CssStateMixin",["dojo","dijit"],function(b,f){b.declare("dijit._CssStateMixin",[],{cssStateNodes:{},hovering:false,active:false,_applyAttributes:function(){this.inherited(arguments);b.forEach(["onmouseenter","onmouseleave","onmousedown"],function(c){this.connect(this.domNode,c,"_cssMouseEvent")},this);b.forEach(["disabled","readOnly","checked","selected","focused","state","hovering","active"],function(c){this.watch(c,b.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(b.body(),"onmouseup",function(){this._mouseDown=false;this._set("active",false);this.disconnect(c)});break}},_setStateClass:function(){function a(i){c=
c.concat(b.map(c,function(m){return m+i}),"dijit"+i)}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 d=this.stateNode||this.domNode,e={};b.forEach(d.className.split(" "),function(i){e[i]=true});"_stateClasses"in this&&b.forEach(this._stateClasses,
function(i){delete e[i]});b.forEach(c,function(i){e[i]=true});var k=[];for(var h in e)k.push(h);d.className=k.join(" ");this._stateClasses=c},_trackMouseState:function(a,c){function d(){var p="disabled"in i&&i.disabled||"readonly"in i&&i.readonly;b.toggleClass(a,c+"Hover",e&&!k&&!p);b.toggleClass(a,c+"Active",k&&!p);b.toggleClass(a,c+"Focused",h&&!p)}var e=false,k=false,h=false,i=this,m=b.hitch(this,"connect",a);m("onmouseenter",function(){e=true;d()});m("onmouseleave",function(){k=e=false;d()});
m("onmousedown",function(){k=true;d()});m("onmouseup",function(){k=false;d()});m("onfocus",function(){h=true;d()});m("onblur",function(){h=false;d()});this.watch("disabled",d);this.watch("readOnly",d)}});return f._CssStateMixin});
define("dijit/form/_FormWidget",["dojo","dijit","dojo/window","dijit/_Widget","dijit/_Templated","dijit/_CssStateMixin"],function(b,f){b.declare("dijit.form._FormWidget",[f._Widget,f._Templated,f._CssStateMixin],{name:"",alt:"",value:"",type:"text",tabIndex:"0",disabled:false,intermediateChanges:false,scrollOnFocus:true,attributeMap:b.delegate(f._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);b.attr(this.focusNode,"disabled",a);this.valueNode&&b.attr(this.valueNode,"disabled",a);f.setWaiState(this.focusNode,"disabled",a);if(a){this._set("hovering",false);this._set("active",false);a="tabIndex"in this.attributeMap?this.attributeMap.tabIndex:"focusNode";
b.forEach(b.isArray(a)?a:[a],function(c){c=this[c];b.isWebKit||f.hasDefaultTabStop(c)?c.setAttribute("tabIndex","-1"):c.removeAttribute("tabIndex")},this)}else this.tabIndex!=""&&this.focusNode.setAttribute("tabIndex",this.tabIndex)},setDisabled:function(a){b.deprecated("setDisabled("+a+") is deprecated. Use set('disabled',"+a+") instead.","","2.0");this.set("disabled",a)},_onFocus:function(){this.scrollOnFocus&&b.window.scrollIntoView(this.domNode);this.inherited(arguments)},isFocusable:function(){return!this.disabled&&
this.focusNode&&b.style(this.domNode,"display")!="none"},focus:function(){this.disabled||f.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(b.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){b.deprecated("dijit.form._FormWidget:setValue("+a+") is deprecated.  Use set('value',"+a+") instead.","","2.0");this.set("value",a)},getValue:function(){b.deprecated(this.declaredClass+"::getValue() is deprecated. Use get('value') instead.","","2.0");return this.get("value")},_onMouseDown:function(a){if(!a.ctrlKey&&b.mouseButtons.isLeft(a)&&this.isFocusable())var c=this.connect(b.body(),"onmouseup",function(){this.isFocusable()&&this.focus();this.disconnect(c)})}});b.declare("dijit.form._FormValueWidget",
f.form._FormWidget,{readOnly:false,attributeMap:b.delegate(f.form._FormWidget.prototype.attributeMap,{value:"",readOnly:"focusNode"}),_setReadOnlyAttr:function(a){b.attr(this.focusNode,"readOnly",a);f.setWaiState(this.focusNode,"readonly",a);this._set("readOnly",a)},postCreate:function(){this.inherited(arguments);if(b.isIE<9||b.isIE&&b.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==b.keys.ESCAPE&&!(a.ctrlKey||a.altKey||a.metaKey)){var c;if(b.isIE){a.preventDefault();c=document.createEventObject();c.keyCode=b.keys.ESCAPE;c.shiftKey=a.shiftKey;a.srcElement.fireEvent("onkeypress",
c)}}},_layoutHackIE7:function(){if(b.isIE==7)for(var a=this.domNode,c=a.parentNode,d=a.firstChild||a,e=d.style.filter,k=this;c&&c.clientHeight==0;){(function(){var h=k.connect(c,"onscroll",function(){k.disconnect(h);d.style.filter=(new Date).getMilliseconds();setTimeout(function(){d.style.filter=e},0)})})();c=c.parentNode}}});return f.form._FormWidget});
define("dijit/form/TextBox",["dojo","dijit","text!dijit/form/templates/TextBox.html","dijit/form/_FormWidget"],function(b,f){b.declare("dijit.form.TextBox",f.form._FormValueWidget,{trim:false,uppercase:false,lowercase:false,propercase:false,maxLength:"",selectOnClick:false,placeHolder:"",templateString:b.cache("dijit.form","templates/TextBox.html"),_singleNodeTemplate:'<input class="dijit dijitReset dijitLeft dijitInputField" dojoAttachPoint="textbox,focusNode" autocomplete="off" type="${type}" ${!nameAttrSetting} />',
_buttonInputDisabled:b.isIE?"disabled":"",baseClass:"dijitTextBox",attributeMap:b.delegate(f.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==f.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=b.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,d){var e;if(a!==undefined){e=this.filter(a);if(typeof d!="string")d=e!==null&&(typeof e!="number"||!isNaN(e))?this.filter(this.format(e,this.constraints)):""}if(d!=null&&d!=undefined&&(typeof d!="number"||!isNaN(d))&&this.textbox.value!=d){this.textbox.value=d;this._set("displayedValue",this.get("displayedValue"))}this._updatePlaceHolder();this.inherited(arguments,[e,c])},displayedValue:"",getDisplayedValue:function(){b.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){b.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 b.keys.SHIFT:case b.keys.ALT:case b.keys.CTRL:case b.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(){b.isIE&&setTimeout(b.hitch(this,function(){var a=b.getComputedStyle(this.domNode);if(a)if(a=a.fontFamily){var c=this.domNode.getElementsByTagName("INPUT");if(c)for(var d=0;d<c.length;d++)c[d].style.fontFamily=a}}),0);this.textbox.setAttribute("value",this.textbox.value);this.inherited(arguments);if(b.isMoz||b.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=b.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&&b.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(b.isIE){c=b.doc.selection.createRange();c=c.parentElement()==this.textbox&&
c.text.length==0}else c=this.textbox.selectionStart==this.textbox.selectionEnd;c&&f.selectInputText(this.textbox)});this._updatePlaceHolder();this.inherited(arguments);this._refreshState()}},reset:function(){this.textbox.value="";this.inherited(arguments)}});f.selectInputText=function(a,c,d){var e=b.global,k=b.doc;a=b.byId(a);if(isNaN(c))c=0;if(isNaN(d))d=a.value?a.value.length:0;f.focus(a);if(k.selection&&b.body().createTextRange){if(a.createTextRange){a=a.createTextRange();a.collapse(true);a.moveStart("character",
-99999);a.moveStart("character",c);a.moveEnd("character",d-c);a.select()}}else e.getSelection&&a.setSelectionRange&&a.setSelectionRange(c,d)};return f.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(b,f){b.declare("dijit._MasterTooltip",[f._Widget,f._Templated],{duration:f.defaultDuration,templateString:b.cache("dijit","templates/Tooltip.html"),postCreate:function(){b.body().appendChild(this.domNode);this.bgIframe=new f.BackgroundIframe(this.domNode);this.fadeIn=b.fadeIn({node:this.domNode,duration:this.duration,onEnd:b.hitch(this,"_onShow")});this.fadeOut=b.fadeOut({node:this.domNode,
duration:this.duration,onEnd:b.hitch(this,"_onHide")})},show:function(a,c,d,e){if(!(this.aroundNode&&this.aroundNode===c)){this.domNode.width="auto";if(this.fadeOut.status()=="playing")this._onDeck=arguments;else{this.containerNode.innerHTML=a;f.placeOnScreenAroundElement(this.domNode,c,f.getPopupAroundAlignment(d&&d.length?d:f.Tooltip.defaultPosition,!e),b.hitch(this,"orient"));b.style(this.domNode,"opacity",0);this.fadeIn.play();this.isShowingNow=true;this.aroundNode=c}}},orient:function(a,c,d,
e,k){this.connectorNode.style.top="";var h=e.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+"-"+d];this.domNode.style.width="auto";var i=b.contentBox(this.domNode),m=Math.min(Math.max(h,1),i.w),p=m<i.w;this.domNode.style.width=m+"px";if(p){this.containerNode.style.overflow=
"auto";p=this.containerNode.scrollWidth;this.containerNode.style.overflow="visible";if(p>m){p=p+b.style(this.domNode,"paddingLeft")+b.style(this.domNode,"paddingRight");this.domNode.style.width=p+"px"}}if(d.charAt(0)=="B"&&c.charAt(0)=="B"){a=b.marginBox(a);c=this.connectorNode.offsetHeight;if(a.h>e.h){this.connectorNode.style.top=e.h-k.h/2-c/2+"px";this.connectorNode.style.bottom=""}else{this.connectorNode.style.bottom=Math.min(Math.max(k.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,i.w-h)},_onShow:function(){if(b.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}}});f.showTooltip=function(a,c,d,e){if(!f._masterTT)f._masterTT=
new f._MasterTooltip;return f._masterTT.show(a,c,d,e)};f.hideTooltip=function(a){if(!f._masterTT)f._masterTT=new f._MasterTooltip;return f._masterTT.hide(a)};b.declare("dijit.Tooltip",f._Widget,{label:"",showDelay:400,connectId:[],position:[],_setConnectIdAttr:function(a){b.forEach(this._connections||[],function(d){b.forEach(d,b.hitch(this,"disconnect"))},this);var c=b.isArrayLike(a)?a:a?[a]:[];this._connections=b.map(c,function(d){return(d=b.byId(d))?[this.connect(d,"onmouseenter","_onTargetMouseEnter"),
this.connect(d,"onmouseleave","_onTargetMouseLeave"),this.connect(d,"onfocus","_onTargetFocus"),this.connect(d,"onblur","_onTargetBlur")]:[]},this);this._set("connectId",a);this._connectIds=c},addTarget:function(a){a=a.id||a;b.indexOf(this._connectIds,a)==-1&&this.set("connectId",this._connectIds.concat(a))},removeTarget:function(a){a=b.indexOf(this._connectIds,a.id||a);if(a>=0){this._connectIds.splice(a,1);this.set("connectId",this._connectIds)}},buildRendering:function(){this.inherited(arguments);
b.addClass(this.domNode,"dijitTooltipData")},startup:function(){this.inherited(arguments);var a=this.connectId;b.forEach(b.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(b.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}f.showTooltip(this.label||this.domNode.innerHTML,a,this.position,!this.isLeftToRight());this._connectNode=a;this.onShow(a,this.position)},close:function(){if(this._connectNode){f.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)}});f.Tooltip.defaultPosition=["after","before"];return f.Tooltip});
(function(){function b(c,d,e,k,h,i){if(d[c]){e.push(c);if(d[c]===true||d[c]===1)k.push(h+c+"/"+i)}}function f(c,d,e,k,h){d=k+d+"/"+h;require._fileExists(c.nameToUrl(d,null))&&e.push(d)}var a=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",{version:"0.24.0",load:function(c,d,e,k){k=k||{};var h=a.exec(c),i=h[1],m=h[4],p=h[5],t=m.split("-"),y=[],u={},s,q,x="";if(h[5]){i=h[1];c=i+p}else{c=c;p=h[4];m=k.locale||(k.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||
"root").toLowerCase());t=m.split("-")}if(k.isBuild){y.push(c);f(d,"root",y,i,p);for(s=0;q=t[s];s++){x+=(x?"-":"")+q;f(d,x,y,i,p)}d(y);e()}else d([c],function(w){var g=[];b("root",w,g,y,i,p);for(s=0;q=t[s];s++){x+=(x?"-":"")+q;b(x,w,g,y,i,p)}d(y,function(){var j,l;for(j=g.length-1;j>-1&&(q=g[j]);j--){l=w[q];if(l===true||l===1)l=d(i+q+"/"+p);require.mixin(u,l)}e(u)})})}})})();
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(b,f){b.declare("dijit.form.ValidationTextBox",f.form.TextBox,{templateString:b.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="",d=this.disabled||this.isValid(a);if(d)this._maskValidSubsetError=true;var e=this._isEmpty(this.textbox.value),k=!d&&a&&this._isValidSubset();this._set("state",d?"":((!this._hasBeenBlurred||a)&&e||k)&&this._maskValidSubsetError?
"Incomplete":"Error");f.setWaiState(this.focusNode,"invalid",d?"false":"true");if(this.state=="Error"){this._maskValidSubsetError=a&&k;c=this.getErrorMessage(a)}else if(this.state=="Incomplete"){c=this.getPromptMessage(a);this._maskValidSubsetError=!this._hasBeenBlurred||a}else if(e)c=this.getPromptMessage(a);this.set("message",c);return d},displayMessage:function(a){f.hideTooltip(this.domNode);a&&this._focused&&f.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(e){switch(e.charAt(0)){case "{":case "+":case "?":case "*":case "^":case "$":case "|":case "(":c+=e;break;case ")":c+="|$)";break;
default:c+="(?:"+e+"|$)";break}});try{"".search(c)}catch(d){c=this.regExp;console.warn("RegExp error in "+this.declaredClass+": "+this.regExp)}this._partialre="^(?:"+c+")$"},postMixInProperties:function(){this.inherited(arguments);this.messages=b.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);f.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)}});b.declare("dijit.form.MappedTextBox",f.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=b.place("<input type='hidden'"+(this.name?" name='"+this.name.replace(/'/g,"&quot;")+"'":"")+"/>",this.textbox,"after")},reset:function(){this.valueNode.value="";this.inherited(arguments)}});b.declare("dijit.form.RangeBoundTextBox",f.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,d=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){d=this.constraints.max;d=this.compare(a,typeof d!="number"||d>0?d:0);d=typeof d=="number"&&d>0}return c||d},_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=b.i18n.getLocalization("dijit.form","validate",this.lang);this.rangeMessage=this.messages.rangeMessage}},_setConstraintsAttr:function(){this.inherited(arguments);if(this.focusNode){this.constraints.min!==
undefined?f.setWaiState(this.focusNode,"valuemin",this.constraints.min):f.removeWaiState(this.focusNode,"valuemin");this.constraints.max!==undefined?f.setWaiState(this.focusNode,"valuemax",this.constraints.max):f.removeWaiState(this.focusNode,"valuemax")}},_setValueAttr:function(a){f.setWaiState(this.focusNode,"valuenow",a);this.inherited(arguments)}});return f.form.ValidationTextBox});
define("orion/util",["dojo","dijit","dojo/hash","dijit/form/ValidationTextBox"],function(b,f){function a(l){j=l}function c(){return j}function d(l){var n="",o=navigator.platform.indexOf("Mac")!==-1;if(l.mod1)n+=o?"Cmd+":"Ctrl+";if(l.mod2)n+="Shift+";if(l.mod3)n+="Alt+";if(l.alphaKey)return n+l.alphaKey;for(var r in b.keys)if(typeof(b.keys[r]==="number"))if(b.keys[r]===l.keyCode)return n+r;var v;switch(l.keyCode){case 59:v=l.mod2?":":";";break;case 61:v=l.mod2?"+":"=";break;case 188:v=l.mod2?"<":",";
break;case 190:v=l.mod2?">":".";break;case 191:v=l.mod2?"?":"/";break;case 192:v=l.mod2?"~":"`";break;case 219:v=l.mod2?"{":"[";break;case 220:v=l.mod2?"|":"\\";break;case 221:v=l.mod2?"}":"]";break;case 222:v=l.mod2?'"':"'";break}if(v)return n+v;return n+String.fromCharCode(l.keyCode)}function e(l,n){l.startup();if(typeof n==="string"){var o=b.byId(n);if(!o)if(o=f.byId(n))o=o.domNode;n=o?o:null}if(n){n=b.position(n);l._setStyleAttr("left:"+(n.x+16)+"px !important;");l._setStyleAttr("top:"+(n.y+16)+
"px !important;")}l.show()}function k(l,n,o,r,v,z,B,D){B=function(F){return function(J){var K=f.byId(l),O=K.get("value");if(F&&J.keyCode===b.keys.ESCAPE){o&&b.style(n,"display","inline");K.destroyRecursive();z&&z()}else if(!(F&&J.keyCode!==b.keys.ENTER)){if(!K.isValid()||O===r)o&&b.style(n,"display","inline");else v(O);K.destroyRecursive();z&&z()}}};var E=new f.form.ValidationTextBox({id:l,required:true,value:r||""});b.place(E.domNode,n,"after");b.addClass(E.domNode,"userEditBoxPrompt");o&&b.style(n,
"display","none");b.connect(E,"onKeyDown",B(true));b.connect(E,"onBlur",B(false));window.setTimeout(function(){E.focus();if(r){var F=b.byId(l),J=D?r.indexOf(D):-1;J>0?f.selectInputText(F,0,J):F.select()}},0)}function h(l){var n=window.navigator.platform.indexOf("Mac")!==-1;return n&&l.metaKey||!n&&l.ctrlKey}function i(l,n){if(n&&h(n))window.open(l);else window.location=l}function m(l){if(!l)return l;var n=window.location.href.split("#")[0];n=n.substring(0,n.length-window.location.pathname.length);
if(l.indexOf(n)===0)return l.substring(n.length);return l}function p(l){var n,o,r,v,z;l=l.split("#");var B=l[l.length-1].split(/\?(?=(?:line|char))/);l=m(B[0]);if(B.length>1){B=B[1].split(/\&(?=(?:line|char))/);for(var D=0;D<B.length;D++){var E=B[D].split("=");if(E.length>1)switch(E[0]){case "char":E=E[1].split(",");if(r===undefined){n=window.parseInt(E[0]);if(E.length>1)o=window.parseInt(E[1])}else{v=E[0];if(E.length>1)z=window.parseInt(E[1]-v)}break;case "line":E=E[1].split(",");r=window.parseInt(E[0]);
break;default:break}}}return{filePath:l,start:n,end:o,line:r,offset:v,length:z}}function t(l,n,o,r,v,z){if(typeof n==="number"){l="#"+l+"?char="+n;if(typeof o==="number")l=l+","+o;else if(typeof z==="number")l=l+","+(n+z);return l}if(typeof r==="number"){l="#"+l+"?line="+r;if(typeof v==="number"){l=l+"&char="+v;if(typeof z==="number")l=l+","+(v+z)}return l}return"#"+l}function y(l){if(!l)return l;var n=window.location.href.split("#")[0];return n.substring(0,n.length-window.location.pathname.length)+
l}function u(l){return this.makeRelative(l).indexOf("/workspace")===0}function s(l,n){l.children=n;for(var o in n)n[o].parent=l;l.children.sort(function(r,v){var z=r.Directory;if(z!==v.Directory)return z?-1:1;r=r.Name&&r.Name.toLowerCase();v=v.Name&&v.Name.toLowerCase();if(r<v)return-1;if(r>v)return 1;return 0})}function q(l,n){l.Parents&&l.Parents.length===0&&n.getService("orion.core.preference").then(function(o){return o.getPreferences("/window/recent")}).then(function(o){var r=o.get("projects");
if(typeof r==="string")r=JSON.parse(r);var v=[];if(r&&r.length&&r.length>0)for(var z=0;z<r.length;z++)r[z].location!==l.ChildrenLocation&&r[z].name!==l.Name&&v.push(r[z]);v.push({name:l.Name,location:l.ChildrenLocation});if(v.length>5)v=v.slice(-5,v.length);o.put("projects",v)})}function x(l){return typeof l.textContent!=="undefined"?l.textContent:l.innerText}function w(l){return x(document.createTextNode(l))}function g(l,n){if(typeof l.textContent!=="undefined")l.textContent=n;else l.innerText=n}
var j=null;return{setUserName:a,getUserName:c,getUserKeyString:d,openDialog:e,getUserText:k,openInNewWindow:h,followLink:i,getPositionInfo:p,hashFromPosition:t,makeRelative:m,makeFullPath:y,isAtRoot:u,processNavigatorParent:s,rememberSuccessfulTraversal:q,getText:x,safeText:w,setText:g}});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(b,f){b.declare("dijit._Container",null,{isContainer:true,buildRendering:function(){this.inherited(arguments);if(!this.containerNode)this.containerNode=this.domNode},addChild:function(a,c){var d=this.containerNode;if(c&&typeof c=="number"){var e=this.getChildren();if(e&&e.length>=c){d=e[c-1].domNode;c="after"}}b.place(a.domNode,d,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){b.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||!f.byNode(a)));return a&&f.byNode(a)},getIndexOfChild:function(a){return b.indexOf(this.getChildren(),a)},startup:function(){if(!this._started){b.forEach(this.getChildren(),
function(a){a.startup()});this.inherited(arguments)}}});return f._Container});
define("dijit/_KeyNavContainer",["dojo","dijit","dijit/_Container"],function(b,f){b.declare("dijit._KeyNavContainer",f._Container,{tabIndex:"0",_keyNavCodes:{},connectKeyNavHandlers:function(a,c){var d=this._keyNavCodes={},e=b.hitch(this,this.focusPrev),k=b.hitch(this,this.focusNext);b.forEach(a,function(h){d[h]=e});b.forEach(c,function(h){d[h]=k});d[b.keys.HOME]=b.hitch(this,"focusFirstChild");d[b.keys.END]=b.hitch(this,"focusLastChild");this.connect(this.domNode,"onkeypress","_onContainerKeypress");
this.connect(this.domNode,"onfocus","_onContainerFocus")},startupKeyNavChildren:function(){b.forEach(this.getChildren(),b.hitch(this,"_startupChild"))},addChild:function(a){f._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();b.attr(this.domNode,"tabIndex","-1")}},_onBlur:function(){this.tabIndex&&b.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();b.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 d=this.getChildren(),e=0;e<d.length;e++){a||(a=d[c>0?0:d.length-1]);if(a.isFocusable())return a;a=this._getSiblingOfChild(a,c)}return null}});return f._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(b,f){b.declare("dijit._Contained",null,{getParent:function(){var a=f.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&&f.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 f._Contained});
define("dijit/MenuItem",["dojo","dijit","text!dijit/templates/MenuItem.html","dijit/_Widget","dijit/_Templated","dijit/_Contained","dijit/_CssStateMixin"],function(b,f){b.declare("dijit.MenuItem",[f._Widget,f._Templated,f._Contained,f._CssStateMixin],{templateString:b.cache("dijit","templates/MenuItem.html"),attributeMap:b.delegate(f._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";b.attr(this.containerNode,"id",a);if(this.accelKeyNode){b.attr(this.accelKeyNode,"id",this.id+"_accel");a+=" "+this.id+"_accel"}f.setWaiState(this.domNode,"labelledby",a);b.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);b.stopEvent(a)},onClick:function(){},focus:function(){try{b.isIE==8&&this.containerNode.focus();f.focus(this.focusNode)}catch(a){}},_onFocus:function(){this._setSelected(true);this.getParent()._onItemFocus(this);this.inherited(arguments)},_setSelected:function(a){b.toggleClass(this.domNode,"dijitMenuItemSelected",a)},setLabel:function(a){b.deprecated("dijit.MenuItem.setLabel() is deprecated.  Use set('label', ...) instead.",
"","2.0");this.set("label",a)},setDisabled:function(a){b.deprecated("dijit.Menu.setDisabled() is deprecated.  Use set('disabled', bool) instead.","","2.0");this.set("disabled",a)},_setDisabledAttr:function(a){f.setWaiState(this.focusNode,"disabled",a?"true":"false");this._set("disabled",a)},_setAccelKeyAttr:function(a){this.accelKeyNode.style.display=a?"":"none";this.accelKeyNode.innerHTML=a;b.attr(this.containerNode,"colSpan",a?"1":"2");this._set("accelKey",a)}});return f.MenuItem});
define("dijit/PopupMenuItem",["dojo","dijit","dijit/MenuItem"],function(b,f){b.declare("dijit.PopupMenuItem",f.MenuItem,{_fillContent:function(){if(this.srcNodeRef){var a=b.query("*",this.srcNodeRef);f.PopupMenuItem.superclass._fillContent.call(this,a[0]);this.dropDownContainer=this.srcNodeRef}},startup:function(){if(!this._started){this.inherited(arguments);if(!this.popup){var a=b.query("[widgetId]",this.dropDownContainer)[0];this.popup=f.byNode(a)}b.body().appendChild(this.popup.domNode);this.popup.startup();
this.popup.domNode.style.display="none";this.arrowWrapper&&b.style(this.arrowWrapper,"visibility","");f.setWaiState(this.focusNode,"haspopup","true")}},destroyDescendants:function(){if(this.popup){this.popup._destroyed||this.popup.destroyRecursive();delete this.popup}this.inherited(arguments)}});return f.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(b,f){b.declare("dijit.CheckedMenuItem",f.MenuItem,{templateString:b.cache("dijit","templates/CheckedMenuItem.html"),checked:false,_setCheckedAttr:function(a){b.toggleClass(this.domNode,"dijitCheckedMenuItemChecked",a);f.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 f.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(b,f){b.declare("dijit.MenuSeparator",[f._Widget,f._Templated,f._Contained],{templateString:b.cache("dijit","templates/MenuSeparator.html"),buildRendering:function(){this.inherited(arguments);b.setSelectable(this.domNode,false)},isFocusable:function(){return false}});return f.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(b,f){b.declare("dijit._MenuBase",[f._Widget,f._Templated,f._KeyNavContainer],{parentMenu:null,popupDelay:500,startup:function(){if(!this._started){b.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(b.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;f.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);f.popup.close(this.currentPopup)}c.parentMenu=this;c.from_item=a;var d=this;f.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(){d.focusChild(a);d._cleanUp();a._setSelected(true);d.focusedChild=a},onExecute:b.hitch(this,"_cleanUp")});this.currentPopup=c;c.connect(c.domNode,"onmouseenter",b.hitch(d,"_onPopupHover"));if(c.focus)c._focus_timer=setTimeout(b.hitch(c,function(){this._focus_timer=null;this.focus()}),0)}}},_markActive:function(){this.isActive=true;b.replaceClass(this.domNode,
"dijitMenuActive","dijitMenuPassive")},onOpen:function(){this.isShowingNow=true;this._markActive()},_markInactive:function(){this.isActive=false;b.replaceClass(this.domNode,"dijitMenuPassive","dijitMenuActive")},onClose:function(){this._stopFocusTimer();this._markInactive();this.isShowingNow=false;this.parentMenu=null},_closeChild:function(){this._stopPopupTimer();if(this.currentPopup){f._curFocus&&b.isDescendant(f._curFocus,this.currentPopup.domNode)&&this.focusedChild.focusNode.focus();f.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()}});b.declare("dijit.Menu",f._MenuBase,{constructor:function(){this._bindings=[]},templateString:b.cache("dijit",
"templates/Menu.html"),baseClass:"dijitMenu",targetNodeIds:[],contextMenuForWindow:false,leftClickToOpen:false,refocus:true,postCreate:function(){this.contextMenuForWindow?this.bindDomNode(b.body()):b.forEach(this.targetNodeIds,this.bindDomNode,this);var a=b.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);
b.stopEvent(a);break;case this._closeSubMenuKey:if(this.parentMenu)this.parentMenu._isMenuBar?this.parentMenu.focusPrev():this.onCancel(false);else b.stopEvent(a);break}},_iframeContentWindow:function(a){return b.window.get(this._iframeContentDocument(a))||this._iframeContentDocument(a).__parent__||a.name&&b.doc.frames[a.name]||null},_iframeContentDocument:function(a){return a.contentDocument||a.contentWindow&&a.contentWindow.document||a.name&&b.doc.frames[a.name]&&b.doc.frames[a.name].document||
null},bindDomNode:function(a){a=b.byId(a);var c;if(a.tagName.toLowerCase()=="iframe"){var d=a,e=this._iframeContentWindow(d);c=b.withGlobal(e,b.body)}else c=a==b.body()?b.doc.documentElement:a;var k={node:a,iframe:d};b.attr(a,"_dijitMenu"+this.id,this._bindings.push(k));var h=b.hitch(this,function(i){return[b.connect(i,this.leftClickToOpen?"onclick":"oncontextmenu",this,function(m){b.stopEvent(m);this._scheduleOpen(m.target,d,{x:m.pageX,y:m.pageY})}),b.connect(i,"onkeydown",this,function(m){if(m.shiftKey&&
m.keyCode==b.keys.F10){b.stopEvent(m);this._scheduleOpen(m.target,d)}})]});k.connects=c?h(c):[];if(d){k.onloadHandler=b.hitch(this,function(){var i=this._iframeContentWindow(d);c=b.withGlobal(i,b.body);k.connects=h(c)});d.addEventListener?d.addEventListener("load",k.onloadHandler,false):d.attachEvent("onload",k.onloadHandler)}},unBindDomNode:function(a){var c;try{c=b.byId(a)}catch(d){return}a="_dijitMenu"+this.id;if(c&&b.hasAttr(c,a)){var e=b.attr(c,a)-1,k=this._bindings[e];b.forEach(k.connects,b.disconnect);
var h=k.iframe;if(h)h.removeEventListener?h.removeEventListener("load",k.onloadHandler,false):h.detachEvent("onload",k.onloadHandler);b.removeAttr(c,a);delete this._bindings[e]}},_scheduleOpen:function(a,c,d){if(!this._openTimer)this._openTimer=setTimeout(b.hitch(this,function(){delete this._openTimer;this._openMyself({target:a,iframe:c,coords:d})}),1)},_openMyself:function(a){function c(){p.refocus&&f.focus(t);f.popup.close(p)}var d=a.target,e=a.iframe;if(a=a.coords){if(e){d=b.position(e,true);var k=
this._iframeContentWindow(e);k=b.withGlobal(k,"_docScroll",b);var h=b.getComputedStyle(e),i=b._toPixelValue,m=(b.isIE&&b.isQuirks?0:i(e,h.paddingLeft))+(b.isIE&&b.isQuirks?i(e,h.borderLeftWidth):0);e=(b.isIE&&b.isQuirks?0:i(e,h.paddingTop))+(b.isIE&&b.isQuirks?i(e,h.borderTopWidth):0);a.x+=d.x+m-k.x;a.y+=d.y+e-k.y}}else{a=b.position(d,true);a.x+=10;a.y+=10}var p=this,t=f.getFocus(this);f.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);f.popup.close(this)}},uninitialize:function(){b.forEach(this._bindings,function(a){a&&this.unBindDomNode(a.node)},this);this.inherited(arguments)}});return f.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(b,f){b.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)){b.stopEvent(a);this._docHandler=this.connect(b.doc,"onmouseup","_onDropDownMouseUp");this.toggleDropDown()}},_onDropDownMouseUp:function(a){a&&
this._docHandler&&this.disconnect(this._docHandler);var c=this.dropDown,d=false;if(a&&this._opened){var e=b.position(this._buttonNode,true);if(!(a.pageX>=e.x&&a.pageX<=e.x+e.w)||!(a.pageY>=e.y&&a.pageY<=e.y+e.h)){for(e=a.target;e&&!d;)if(b.hasClass(e,"dijitPopup"))d=true;else e=e.parentNode;if(d){e=a.target;if(c.onItemClick){for(var k;e&&!(k=f.byNode(e));)e=e.parentNode;k&&k.onClick&&k.getParent&&k.getParent().onItemClick(k,a)}return}}}this._opened&&c.focus&&c.autoFocus!==false&&window.setTimeout(b.hitch(c,
"focus"),1)},_onDropDownClick:function(a){this._stopClickEvents&&b.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";b.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,d=a.target;if(c&&this._opened&&c.handleKey)if(c.handleKey(a)===false){b.stopEvent(a);return}if(c&&this._opened&&a.charOrCode==b.keys.ESCAPE){this.closeDropDown();b.stopEvent(a)}else if(!this._opened&&(a.charOrCode==b.keys.DOWN_ARROW||(a.charOrCode==b.keys.ENTER||a.charOrCode==" ")&&((d.tagName||"").toLowerCase()!=="input"||d.type&&d.type.toLowerCase()!=="text"))){this._toggleOnKeyUp=true;b.stopEvent(a)}}},_onKeyUp:function(){if(this._toggleOnKeyUp){delete this._toggleOnKeyUp;
this.toggleDropDown();var a=this.dropDown;a&&a.focus&&setTimeout(b.hitch(a,"focus"),1)}},_onBlur:function(){this.closeDropDown(f._curFocus&&this.dropDown&&b.isDescendant(f._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(b.hitch(this,"openDropDown"))},openDropDown:function(){var a=
this.dropDown,c=a.domNode,d=this._aroundNode||this.domNode,e=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 k={display:"",visibility:"hidden"};if(!this._explicitDDWidth)k.width="";if(!this._explicitDDHeight)k.height="";b.style(c,k);k=this.maxHeight;if(k==-1){k=b.window.getBox();var h=b.position(d,false);k=Math.floor(Math.max(h.y,k.h-(h.y+h.h)))}a.startup&&
!a._started&&a.startup();f.popup.moveOffScreen(a);h=b._getMarginSize(c);var i=k&&h.h>k;b.style(c,{overflowX:"hidden",overflowY:i?"auto":"hidden"});if(i){h.h=k;if("w"in h)h.w+=16}else delete h.h;if(this.forceWidth)h.w=d.offsetWidth;else if(this.autoWidth)h.w=Math.max(h.w,d.offsetWidth);else delete h.w;b.isFunction(a.resize)?a.resize(h):b.marginBox(c,h)}a=f.popup.open({parent:this,popup:a,around:d,orient:f.getPopupAroundAlignment(this.dropDownPosition&&this.dropDownPosition.length?this.dropDownPosition:
["below"],this.isLeftToRight()),onExecute:function(){e.closeDropDown(true)},onCancel:function(){e.closeDropDown(true)},onClose:function(){b.attr(e._popupStateNode,"popupActive",false);b.removeClass(e._popupStateNode,"dijitHasDropDownOpen");e._opened=false}});b.attr(this._popupStateNode,"popupActive","true");b.addClass(e._popupStateNode,"dijitHasDropDownOpen");this._opened=true;return a},closeDropDown:function(a){if(this._opened){a&&this.focus();f.popup.close(this.dropDown);this._opened=false}}});
return f._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(b,f){b.declare("dijit.form.Button",f.form._FormWidget,{label:"",showLabel:true,iconClass:"",type:"button",baseClass:"dijitButton",templateString:b.cache("dijit.form","templates/Button.html"),attributeMap:b.delegate(f.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 d=f.byNode(c);if(d&&typeof d._onSubmit=="function"){d._onSubmit(a);break}}else if(this.valueNode){this.valueNode.click();a.preventDefault()}},buildRendering:function(){this.inherited(arguments);b.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&&b.toggleClass(this.containerNode,"dijitDisplayNone",!a);this._set("showLabel",a)},onClick:function(){return true},_clicked:function(){},setLabel:function(a){b.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=b.trim(this.containerNode.innerText||this.containerNode.textContent||"")},_setIconClassAttr:function(a){b.replaceClass(this.iconNode,a||"dijitNoIcon",this.iconClass||"dijitNoIcon");this._set("iconClass",a)}});b.declare("dijit.form.DropDownButton",[f.form.Button,f._Container,f._HasDropDown],{baseClass:"dijitDropDownButton",templateString:b.cache("dijit.form","templates/DropDownButton.html"),_fillContent:function(){if(this.srcNodeRef){var a=
b.query("*",this.srcNodeRef);f.form.DropDownButton.superclass._fillContent.call(this,a[0]);this.dropDownContainer=this.srcNodeRef}},startup:function(){if(!this._started){if(!this.dropDown&&this.dropDownContainer){var a=b.query("[widgetId]",this.dropDownContainer)[0];this.dropDown=f.byNode(a);delete this.dropDownContainer}this.dropDown&&f.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=b.connect(a,"onLoad",this,function(){b.disconnect(c);this.openDropDown()});a.refresh()}},isFocusable:function(){return this.inherited(arguments)&&!this._mouseDown}});b.declare("dijit.form.ComboButton",f.form.DropDownButton,{templateString:b.cache("dijit.form","templates/ComboButton.html"),attributeMap:b.mixin(b.clone(f.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==b.keys[this.isLeftToRight()?"RIGHT_ARROW":"LEFT_ARROW"]){f.focus(this._popupStateNode);b.stopEvent(a)}},_onArrowKeyPress:function(a){if(a.charOrCode==b.keys[this.isLeftToRight()?"LEFT_ARROW":"RIGHT_ARROW"]){f.focus(this.titleNode);b.stopEvent(a)}},focus:function(a){this.disabled||f.focus(a=="start"?this.titleNode:this._popupStateNode)}});
b.declare("dijit.form.ToggleButton",f.form.Button,{baseClass:"dijitToggleButton",checked:false,attributeMap:b.mixin(b.clone(f.form.Button.prototype.attributeMap),{checked:"focusNode"}),_clicked:function(){this.set("checked",!this.checked)},_setCheckedAttr:function(a,c){this._set("checked",a);b.attr(this.focusNode||this.domNode,"checked",a);f.setWaiState(this.focusNode||this.domNode,"pressed",a);this._handleOnChange(a,c)},setChecked:function(a){b.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 f.form.Button});define("dijit/form/DropDownButton",["dojo","dijit","dijit/form/Button"],function(b,f){return f.form.DropDownButton});
define("orion/commands",["dojo","dijit","orion/util","dijit/Menu","dijit/form/DropDownButton","dijit/MenuItem","dijit/PopupMenuItem","dijit/MenuSeparator"],function(b,f,a){function c(h){this._domScope={};this._objectScope={};this._globalScope={};this._namedGroups={};this._activeBindings={};this._init(h)}function d(h){this._init(h)}function e(h,i,m,p,t){this.keyCode=typeof h==="string"?h.toUpperCase().charCodeAt(0):h;this.mod1=i!==undefined&&i!==null?i:false;this.mod2=m!==undefined&&m!==null?m:false;
this.mod3=p!==undefined&&p!==null?p:false;this.mod4=t!==undefined&&t!==null?t:false}c.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(i){i=i||window.event;var m=i.target.nodeName.toLowerCase();if(m==="input")switch(i.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(m===
"textarea")return;this._processKey(i)}))},_processKey:function(h){function i(y){if(window.document.all)y.keyCode=0;else{y.preventDefault();y.stopPropagation()}}for(var m in this._activeBindings)if(this._activeBindings[m]&&this._activeBindings[m].keyBinding&&this._activeBindings[m].command)if(this._activeBindings[m].keyBinding.match(h)){var p=this._activeBindings[m],t=p.command;if(t.hrefCallback){i(h);h=t.hrefCallback.call(p.handler||window,p.items,m,p.userData);h.then?h.then(function(y){window.open(y)}):
window.open(h);return}else if(t.callback){i(h);window.setTimeout(function(){t.callback.call(p.handler||window,p.items,m,null,p.userData)},0);return}}},getSelectionService:function(){return this._selection},showKeyBindings:function(h){for(var i in this._activeBindings)this._activeBindings[i]&&this._activeBindings[i].keyBinding&&this._activeBindings[i].command&&b.place("<span>"+a.getUserKeyString(this._activeBindings[i].keyBinding)+" = "+this._activeBindings[i].command.name+"<br></span>",h,"last")},
addCommand:function(h,i){switch(i){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 "+i;}},addCommandGroup:function(h,i,m,p,t){var y=this._namedGroups;if(p)y=this._createEntryForPath(p);if(y[h]){if(m)y[h].title=m;if(i)y[h].position=i;if(t)y[h].scopeId=t}else{y[h]={title:m,position:i,children:{},scopeId:t};y.sortedCommands=null}},_createEntryForPath:function(h){var i=this._namedGroups;
if(h){h=h.split("/");for(var m=0;m<h.length;m++)if(h[m].length>1){i[h[m]]||(i[h[m]]={position:0,children:{}});i=i[h[m]].children}}return i},registerCommandContribution:function(h,i,m,p,t,y){p=this._createEntryForPath(p);p[h]={scopeId:m,position:i};if(t)if(i=this._domScope[h]||this._globalScope[h])this._activeBindings[h]={command:i,keyBinding:t,keyOnly:y};p.sortedCommands=null},_isLastChildSeparator:function(h,i){if(i==="image")return h.childNodes.length>0&&b.hasClass(h.childNodes[h.childNodes.length-
1],"commandSeparator");if(i==="menu"){h=h.getChildren();return h.length>0&&h[h.length-1]instanceof f.MenuSeparator}return false},renderCommands:function(h,i,m,p,t,y,u,s){if(typeof h==="string")h=b.byId(h);if(m){var q;if(i==="object")q=this._objectScope;else if(i==="dom")q=this._domScope;else if(i==="global")q=this._globalScope;else throw"Unrecognized command scope "+i;this._render(this._namedGroups,h,i,m,p,t,y,u,q,s);if(t==="image")this._isLastChildSeparator(h,t)&&h.removeChild(h.childNodes[h.childNodes.length-
1]);else if(t==="menu")if(this._isLastChildSeparator(h,t)){m=h.getChildren()[h.getChildren().length-1];h.removeChild(m);m.destroy()}}else{var x=this;this._selection&&this._selection.getSelections(function(w){x.renderCommands(h,i,w,p,t,y,u,s)})}},_render:function(h,i,m,p,t,y,u,s,q,x){var w=h.sortedCommands;if(!w){w=[];for(var g in h){var j=h[g];if(j&&typeof j.position==="number"){j.id=g;w.push(j)}}w.sort(function(z,B){return z.position-B.position});h.sortedCommands=w}for(h=0;h<w.length;h++){var l;
if(w[h].children){g=w[h];if(!(g.scopeId&&i.id!==g.scopeId)){var n;if(y==="image")if(g.title){j=new f.Menu({style:"display: none;"});j.eclipseScopeId=i.eclipseScopeId||i.id;this._render(w[h].children,j,m,p,t,"menu",u,s,q,x);n=j.getChildren();if(this._isLastChildSeparator(j,"menu")){l=n[n.length-1];j.removeChild(l);l.destroy();n=j.getChildren()}if(n.length>0){var o=true;l=n[0].eclipseCommand;if(n.length===1)o=!(l&&l.hasImage());if(o){l=new f.form.DropDownButton({label:g.title,dropDown:j});b.addClass(l.domNode,
"commandLink");u&&b.addClass(l.domNode,u);b.place(l.domNode,i,"last")}else{j="image"+l.id+h;g=l._asImage(j,p,t,s,x);b.place(g,i,"last")}}}else{var r;if(i.childNodes.length>0&&!this._isLastChildSeparator(i,y)){r=this.generateSeparatorImage();b.place(r,i,"last")}this._render(w[h].children,i,m,p,t,y,u,s,q,x);if(i.childNodes.length>0)if(i.childNodes[i.childNodes.length-1]!==r){r=this.generateSeparatorImage();b.place(r,i,"last")}}else if(g.title){j=new f.Menu;this._render(w[h].children,j,m,p,t,y,u,s,q,
x);j.getChildren().length>0&&i.addChild(new f.PopupMenuItem({label:g.title,popup:j}))}else{var v;if(i.getChildren().length>0&&!this._isLastChildSeparator(i,y)){v=new f.MenuSeparator;i.addChild(v)}this._render(w[h].children,i,m,p,t,y,u,s,q,x);g=i.getChildren();if(g[g.length-1]!==v){v=new f.MenuSeparator;i.addChild(v)}}}}else{j=(g=q[w[h].id])?true:false;if(g){if(m==="dom")j=y==="image"?i.id===w[h].scopeId:y==="menu"?i.eclipseScopeId===w[h].scopeId:false;if(this._activeBindings[g.id]&&this._activeBindings[g.id].keyBinding){l=
this._activeBindings[g.id];l.items=p;l.userData=s;l.handler=t;if(l.keyOnly)j=false}if(j&&g.visibleWhen)j=g.visibleWhen(p)}if(j)if(g.choiceCallback){j=new f.Menu({style:"display: none;"});if(y==="image"){l=new f.form.DropDownButton({label:g.name,dropDown:j});if(g.image){b.addClass(l.iconNode,"commandImage");u&&b.addClass(l.iconNode,u);l.iconNode.src=g.image}b.place(l.domNode,i,"last");l.eclipseCommand=g;l.eclipseChoices=j;b.connect(l,"onClick",l,function(){this.eclipseCommand.populateChoicesMenu(this.eclipseChoices,
p,t,s)})}else if(y==="menu"){l=new f.PopupMenuItem({label:g.name,popup:j});i.addChild(l);l.eclipseCommand=g;l.eclipseChoices=j;b.connect(i,"_openPopup",l,function(){this.eclipseCommand.populateChoicesMenu(this.eclipseChoices,p,t,s)})}}else if(y==="image"){j="image"+g.id+h;g=g._asImage(j,p,t,s,u,x);b.place(g,i,"last")}else y==="menu"&&g._addMenuItem(i,p,t,s,u)}}},generateSeparatorImage:function(){var h=new Image;h.src="/images/sep.gif";b.addClass(h,"commandImage");b.addClass(h,"commandSeparator");
return h}};c.prototype.constructor=c;d.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||"/images/none.png";this.visibleWhen=h.visibleWhen;this._deviceSupportsHover=false},_asImage:function(h,i,m,p,t,y){m=m||this;var u=new Image,s=b.create("a");s.id=this.name+"link";u.alt=this.name;u.title=this.name;u.name=h;u.id=h;if(y||!this.hasImage()){h=
window.document.createTextNode(this.name);b.place(h,s,"last")}if(this.hrefCallback){h=this.hrefCallback.call(m,i,this.id,p);if(h.then)h.then(function(q){s.href=q});else s.href=h}else if(this.callback)!y&&this.hasImage()?b.connect(u,"onclick",this,function(){this.callback.call(m,i,this.id,u.id,p)}):b.connect(s,"onclick",this,function(){this.callback.call(m,i,this.id,s.id,p)});if(!y&&this.hasImage()){if(this._deviceSupportsHover){u.src="/images/none.png";b.connect(u,"onmouseover",this,function(){u.src=
this.image});b.connect(u,"onmouseout",this,function(){u.src="/images/none.png"})}else{u.src=this.image;b.connect(u,"onmouseover",this,function(){b.addClass(u,"commandOver")});b.connect(u,"onmouseout",this,function(){u.src=this.image;b.removeClass(u,"commandOver")})}b.addClass(u,"commandImage");t&&b.addClass(u,t);b.place(u,s,"last")}b.addClass(s,"commandLink");t&&b.addClass(s,t);return s},_asLink:function(h,i,m){i=i||this;var p=window.document.createElement("a");b.place(window.document.createTextNode(this.name),
p,"only");p.href="";p.id=this.id+"link";if(this.callback)b.connect(p,"onclick",this,function(){this.callback.call(i,h,this.id,p.id)});else if(this.hrefCallback){var t=this.hrefCallback.call(i,h,this.id);if(t)if(t.then)t.then(function(y){p.href=y});else p.href=t}b.addClass(p,"commandLink");m&&b.addClass(p,m);return p},_addMenuItem:function(h,i,m,p,t){var y=new f.MenuItem({labelType:this.hrefCallback?"html":"text",label:this.name,tooltip:this.tooltip});if(this.hrefCallback){var u=this.hrefCallback.call(m,
i,this.id,h.id,p);if(u)if(u.then)u.then(b.hitch(this,function(s){y.set("label","<a href='"+s+"'>"+this.name+"</a>");y.onClick=function(q){a.followLink(s,q)}}));else{y.set("label","<a href='"+u+"'>"+this.name+"</a>");y.onClick=function(s){a.followLink(u,s)}}}else if(this.callback)y.onClick=b.hitch(this,function(){this.callback.call(m,i,this.id,null,p)});y.eclipseCommand=this;h.addChild(y);if(this.image){b.addClass(y.iconNode,"commandImage");t&&b.addClass(y.iconNode,t);y.iconNode.src=this.image}},populateChoicesMenu:function(h,
i,m,p){h.focusedChild=null;b.forEach(h.getChildren(),function(u){h.removeChild(u);u.destroy()});m=this.getChoices(i,m,p);for(p=0;p<m.length;p++){var t=m[p],y;if(t.name){y=new f.MenuItem({label:t.name,onClick:this.makeChoiceCallback(t,i)});if(t.image){b.addClass(y.iconNode,"commandImage");y.iconNode.src=t.image}}else y=new f.MenuSeparator;h.addChild(y)}},getChoices:function(h,i,m){if(this.choiceCallback)return this.choiceCallback.call(i,h,m);return null},makeChoiceCallback:function(h,i){return function(m){h.callback&&
h.callback.call(h,i,m)}},hasImage:function(){return this.image!=="/images/none.png"}};d.prototype.constructor=d;var k=window.navigator.platform.indexOf("Mac")!==-1;e.prototype={match:function(h){if(this.keyCode===h.keyCode){if(this.mod1!==(k?h.metaKey:h.ctrlKey))return false;if(this.mod2!==h.shiftKey)return false;if(this.mod3!==h.altKey)return false;if(k&&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}};e.prototype.constructor=e;return{CommandService:c,CommandKeyBinding:e,Command:d}});var orion=orion||{};orion.textview=orion.textview||{};
orion.textview.KeyBinding=function(){function b(a,c,d,e,k){this.keyCode=typeof a==="string"?a.toUpperCase().charCodeAt(0):a;this.mod1=c!==undefined&&c!==null?c:false;this.mod2=d!==undefined&&d!==null?d:false;this.mod3=e!==undefined&&e!==null?e:false;this.mod4=k!==undefined&&k!==null?k:false}var f=window.navigator.platform.indexOf("Mac")!==-1;b.prototype={match:function(a){if(this.keyCode===a.keyCode){if(this.mod1!==(f?a.metaKey:a.ctrlKey))return false;if(this.mod2!==a.shiftKey)return false;if(this.mod3!==
a.altKey)return false;if(f&&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 b}();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(b){b.getObject("dnd",true,b);b.dnd.getCopyKeyState=b.isCopyKey;b.dnd._uniqueId=0;b.dnd.getUniqueId=function(){var f;do f=b._scopeName+"Unique"+ ++b.dnd._uniqueId;while(b.byId(f));return f};b.dnd._empty={};b.dnd.isFormElement=function(f){f=f.target;if(f.nodeType==3)f=f.parentNode;return" button textarea input select option ".indexOf(" "+f.tagName.toLowerCase()+" ")>=0};return b.dnd});
define("dojo/dnd/autoscroll",["dojo","dojo/window"],function(b){b.getObject("dnd",true,b);b.dnd.getViewport=b.window.getBox;b.dnd.V_TRIGGER_AUTOSCROLL=32;b.dnd.H_TRIGGER_AUTOSCROLL=32;b.dnd.V_AUTOSCROLL_VALUE=16;b.dnd.H_AUTOSCROLL_VALUE=16;b.dnd.autoScroll=function(f){var a=b.window.getBox(),c=0,d=0;if(f.clientX<b.dnd.H_TRIGGER_AUTOSCROLL)c=-b.dnd.H_AUTOSCROLL_VALUE;else if(f.clientX>a.w-b.dnd.H_TRIGGER_AUTOSCROLL)c=b.dnd.H_AUTOSCROLL_VALUE;if(f.clientY<b.dnd.V_TRIGGER_AUTOSCROLL)d=-b.dnd.V_AUTOSCROLL_VALUE;
else if(f.clientY>a.h-b.dnd.V_TRIGGER_AUTOSCROLL)d=b.dnd.V_AUTOSCROLL_VALUE;window.scrollBy(c,d)};b.dnd._validNodes={div:1,p:1,td:1};b.dnd._validOverflow={auto:1,scroll:1};b.dnd.autoScrollNodes=function(f){for(var a=f.target;a;){if(a.nodeType==1&&a.tagName.toLowerCase()in b.dnd._validNodes){var c=b.getComputedStyle(a);if(c.overflow.toLowerCase()in b.dnd._validOverflow){var d=b._getContentBox(a,c);c=b.position(a,true);var e=Math.min(b.dnd.H_TRIGGER_AUTOSCROLL,d.w/2),k=Math.min(b.dnd.V_TRIGGER_AUTOSCROLL,
d.h/2),h=f.pageX-c.x,i=f.pageY-c.y,m=c=0;if(b.isWebKit||b.isOpera){h+=b.body().scrollLeft;i+=b.body().scrollTop}if(h>0&&h<d.w)if(h<e)c=-e;else if(h>d.w-e)c=e;if(i>0&&i<d.h)if(i<k)m=-k;else if(i>d.h-k)m=k;d=a.scrollLeft;e=a.scrollTop;a.scrollLeft+=c;a.scrollTop+=m;if(d!=a.scrollLeft||e!=a.scrollTop)return}}try{a=a.parentNode}catch(p){a=null}}b.dnd.autoScroll(f)};return b.dnd});
define("dojo/dnd/Mover",["dojo","dojo/dnd/common","dojo/dnd/autoscroll"],function(b){b.declare("dojo.dnd.Mover",null,{constructor:function(f,a,c){this.node=b.byId(f);var d=a.touches?a.touches[0]:a;this.marginBox={l:d.pageX,t:d.pageY};this.mouseButton=a.button;a=this.host=c;f=f.ownerDocument;this.events=[b.connect(f,"onmousemove",this,"onFirstMove"),b.connect(f,"ontouchmove",this,"onFirstMove"),b.connect(f,"onmousemove",this,"onMouseMove"),b.connect(f,"ontouchmove",this,"onMouseMove"),b.connect(f,
"onmouseup",this,"onMouseUp"),b.connect(f,"ontouchend",this,"onMouseUp"),b.connect(f,"ondragstart",b.stopEvent),b.connect(f.body,"onselectstart",b.stopEvent)];a&&a.onMoveStart&&a.onMoveStart(this)},onMouseMove:function(f){b.dnd.autoScroll(f);var a=this.marginBox,c=f.touches?f.touches[0]:f;this.host.onMove(this,{l:a.l+c.pageX,t:a.t+c.pageY},f);b.stopEvent(f)},onMouseUp:function(f){if(b.isWebKit&&b.isMac&&this.mouseButton==2?f.button==0:this.mouseButton==f.button)this.destroy();b.stopEvent(f)},onFirstMove:function(f){var a=
this.node.style,c,d=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=b.marginBox(this.node);c=b.doc.body;var e=b.getComputedStyle(c),k=b._getMarginBox(c,e);e=b._getContentBox(c,e);c=a.l-(e.l-k.l);a=a.t-(e.t-k.t);break}this.marginBox.l=c-this.marginBox.l;this.marginBox.t=a-this.marginBox.t;d&&d.onFirstMove&&d.onFirstMove(this,f);b.disconnect(this.events.shift());b.disconnect(this.events.shift())},
destroy:function(){b.forEach(this.events,b.disconnect);var f=this.host;f&&f.onMoveStop&&f.onMoveStop(this);this.events=this.node=this.host=null}});return b.dnd.Mover});
define("dojo/dnd/Moveable",["dojo","dojo/dnd/Mover"],function(b){b.declare("dojo.dnd.Moveable",null,{handle:"",delay:0,skip:false,constructor:function(f,a){this.node=b.byId(f);a||(a={});this.handle=a.handle?b.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:b.dnd.Mover;this.events=[b.connect(this.handle,"onmousedown",this,"onMouseDown"),b.connect(this.handle,"ontouchstart",this,"onMouseDown"),b.connect(this.handle,
"ondragstart",this,"onSelectStart"),b.connect(this.handle,"onselectstart",this,"onSelectStart")]},markupFactory:function(f,a){return new b.dnd.Moveable(a,f)},destroy:function(){b.forEach(this.events,b.disconnect);this.events=this.node=this.handle=null},onMouseDown:function(f){if(!(this.skip&&b.dnd.isFormElement(f))){if(this.delay){this.events.push(b.connect(this.handle,"onmousemove",this,"onMouseMove"),b.connect(this.handle,"ontouchmove",this,"onMouseMove"),b.connect(this.handle,"onmouseup",this,
"onMouseUp"),b.connect(this.handle,"ontouchend",this,"onMouseUp"));var a=f.touches?f.touches[0]:f;this._lastX=a.pageX;this._lastY=a.pageY}else this.onDragDetected(f);b.stopEvent(f)}},onMouseMove:function(f){var a=f.touches?f.touches[0]:f;if(Math.abs(a.pageX-this._lastX)>this.delay||Math.abs(a.pageY-this._lastY)>this.delay){this.onMouseUp(f);this.onDragDetected(f)}b.stopEvent(f)},onMouseUp:function(f){for(var a=0;a<2;++a)b.disconnect(this.events.pop());b.stopEvent(f)},onSelectStart:function(f){if(!this.skip||
!b.dnd.isFormElement(f))b.stopEvent(f)},onDragDetected:function(f){new this.mover(this.node,f,this)},onMoveStart:function(f){b.publish("/dnd/move/start",[f]);b.addClass(b.body(),"dojoMove");b.addClass(this.node,"dojoMoveItem")},onMoveStop:function(f){b.publish("/dnd/move/stop",[f]);b.removeClass(b.body(),"dojoMove");b.removeClass(this.node,"dojoMoveItem")},onFirstMove:function(){},onMove:function(f,a){this.onMoving(f,a);var c=f.node.style;c.left=a.l+"px";c.top=a.t+"px";this.onMoved(f,a)},onMoving:function(){},
onMoved:function(){}});return b.dnd.Moveable});
define("dojo/dnd/move",["dojo","dojo/dnd/Mover","dojo/dnd/Moveable"],function(b){b.declare("dojo.dnd.move.constrainedMoveable",b.dnd.Moveable,{constraints:function(){},within:false,markupFactory:function(f,a){return new b.dnd.move.constrainedMoveable(a,f)},constructor:function(f,a){a||(a={});this.constraints=a.constraints;this.within=a.within},onFirstMove:function(f){var a=this.constraintBox=this.constraints.call(this,f);a.r=a.l+a.w;a.b=a.t+a.h;if(this.within){f=b._getMarginSize(f.node);a.r-=f.w;
a.b-=f.h}},onMove:function(f,a){var c=this.constraintBox,d=f.node.style;this.onMoving(f,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;d.left=a.l+"px";d.top=a.t+"px";this.onMoved(f,a)}});b.declare("dojo.dnd.move.boxConstrainedMoveable",b.dnd.move.constrainedMoveable,{box:{},markupFactory:function(f,a){return new b.dnd.move.boxConstrainedMoveable(a,f)},constructor:function(f,a){var c=a&&a.box;this.constraints=function(){return c}}});b.declare("dojo.dnd.move.parentConstrainedMoveable",
b.dnd.move.constrainedMoveable,{area:"content",markupFactory:function(f,a){return new b.dnd.move.parentConstrainedMoveable(a,f)},constructor:function(f,a){var c=a&&a.area;this.constraints=function(){var d=this.node.parentNode,e=b.getComputedStyle(d),k=b._getMarginBox(d,e);if(c=="margin")return k;var h=b._getMarginExtents(d,e);k.l+=h.l;k.t+=h.t;k.w-=h.w;k.h-=h.h;if(c=="border")return k;h=b._getBorderExtents(d,e);k.l+=h.l;k.t+=h.t;k.w-=h.w;k.h-=h.h;if(c=="padding")return k;h=b._getPadExtents(d,e);k.l+=
h.l;k.t+=h.t;k.w-=h.w;k.h-=h.h;return k}}});b.dnd.constrainedMover=b.dnd.move.constrainedMover;b.dnd.boxConstrainedMover=b.dnd.move.boxConstrainedMover;b.dnd.parentConstrainedMover=b.dnd.move.parentConstrainedMover;return b.dnd.move});
define("dojo/dnd/TimedMoveable",["dojo","dojo/dnd/Moveable"],function(b){(function(){var f=b.dnd.Moveable.prototype.onMove;b.declare("dojo.dnd.TimedMoveable",b.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 b.dnd.TimedMoveable(c,a)},onMoveStop:function(a){if(a._timer){clearTimeout(a._timer);f.call(this,a,a._leftTop)}b.dnd.Moveable.prototype.onMoveStop.apply(this,arguments)},
onMove:function(a,c){a._leftTop=c;if(!a._timer){var d=this;a._timer=setTimeout(function(){a._timer=null;f.call(d,a,a._leftTop)},this.timeout)}}})})();return b.dnd.TimedMoveable});
define("dojo/fx/Toggler",["dojo"],function(b){b.declare("dojo.fx.Toggler",null,{node:null,showFunc:b.fadeIn,hideFunc:b.fadeOut,showDuration:200,hideDuration:200,constructor:function(f){var a=this;b.mixin(a,f);a.node=f.node;a._showArgs=b.mixin({},f);a._showArgs.node=a.node;a._showArgs.duration=a.showDuration;a.showAnim=a.showFunc(a._showArgs);a._hideArgs=b.mixin({},f);a._hideArgs.node=a.node;a._hideArgs.duration=a.hideDuration;a.hideAnim=a.hideFunc(a._hideArgs);b.connect(a.showAnim,"beforeBegin",b.hitch(a.hideAnim,
"stop",true));b.connect(a.hideAnim,"beforeBegin",b.hitch(a.showAnim,"stop",true))},show:function(f){return this.showAnim.play(f||0)},hide:function(f){return this.hideAnim.play(f||0)}});return b.fx.Toggler});
define("dojo/fx",["dojo","dojo/fx/Toggler"],function(b){(function(){var f={_fire:function(d,e){if(this[d])this[d].apply(this,e||[]);return this}},a=function(d){this._index=-1;this._animations=d||[];this._current=this._onAnimateCtx=this._onEndCtx=null;this.duration=0;b.forEach(this._animations,function(e){this.duration+=e.duration;if(e.delay)this.duration+=e.delay},this)};b.extend(a,{_onAnimate:function(){this._fire("onAnimate",arguments)},_onEnd:function(){b.disconnect(this._onAnimateCtx);b.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=b.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx=b.connect(this._current,"onEnd",this,"_onEnd");this._current.play(0,true)}},play:function(d,e){if(!this._current)this._current=this._animations[this._index=0];if(!e&&this._current.status()=="playing")return this;var k=b.connect(this._current,"beforeBegin",this,
function(){this._fire("beforeBegin")}),h=b.connect(this._current,"onBegin",this,function(){this._fire("onBegin",arguments)}),i=b.connect(this._current,"onPlay",this,function(){this._fire("onPlay",arguments);b.disconnect(k);b.disconnect(h);b.disconnect(i)});this._onAnimateCtx&&b.disconnect(this._onAnimateCtx);this._onAnimateCtx=b.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx&&b.disconnect(this._onEndCtx);this._onEndCtx=b.connect(this._current,"onEnd",this,"_onEnd");this._current.play.apply(this._current,
arguments);return this},pause:function(){if(this._current){var d=b.connect(this._current,"onPause",this,function(){this._fire("onPause",arguments);b.disconnect(d)});this._current.pause()}return this},gotoPercent:function(d,e){this.pause();var k=this.duration*d;this._current=null;b.some(this._animations,function(h){if(h.duration<=k){this._current=h;return true}k-=h.duration;return false});this._current&&this._current.gotoPercent(k/this._current.duration,e);return this},stop:function(d){if(this._current){if(d){for(;this._index+
1<this._animations.length;++this._index)this._animations[this._index].stop(true);this._current=this._animations[this._index]}var e=b.connect(this._current,"onStop",this,function(){this._fire("onStop",arguments);b.disconnect(e)});this._current.stop()}return this},status:function(){return this._current?this._current.status():"stopped"},destroy:function(){this._onAnimateCtx&&b.disconnect(this._onAnimateCtx);this._onEndCtx&&b.disconnect(this._onEndCtx)}});b.extend(a,f);b.fx.chain=function(d){return new a(d)};
var c=function(d){this._animations=d||[];this._connects=[];this.duration=this._finished=0;b.forEach(d,function(k){var h=k.duration;if(k.delay)h+=k.delay;if(this.duration<h)this.duration=h;this._connects.push(b.connect(k,"onEnd",this,"_onEnd"))},this);this._pseudoAnimation=new b.Animation({curve:[0,1],duration:this.duration});var e=this;b.forEach(["beforeBegin","onBegin","onPlay","onAnimate","onPause","onStop","onEnd"],function(k){e._connects.push(b.connect(e._pseudoAnimation,k,function(){e._fire(k,
arguments)}))})};b.extend(c,{_doAction:function(d,e){b.forEach(this._animations,function(k){k[d].apply(k,e)});return this},_onEnd:function(){++this._finished>this._animations.length&&this._fire("onEnd")},_call:function(d,e){var k=this._pseudoAnimation;k[d].apply(k,e)},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(d,e){var k=
this.duration*d;b.forEach(this._animations,function(h){h.gotoPercent(h.duration<k?1:k/h.duration,e)});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(){b.forEach(this._connects,b.disconnect)}});b.extend(c,f);b.fx.combine=function(d){return new c(d)};b.fx.wipeIn=function(d){var e=d.node=b.byId(d.node),k=e.style,h;d=b.animateProperty(b.mixin({properties:{height:{start:function(){h=
k.overflow;k.overflow="hidden";if(k.visibility=="hidden"||k.display=="none"){k.height="1px";k.display="";k.visibility="";return 1}else{var i=b.style(e,"height");return Math.max(i,1)}},end:function(){return e.scrollHeight}}}},d));b.connect(d,"onEnd",function(){k.height="auto";k.overflow=h});return d};b.fx.wipeOut=function(d){var e=(d.node=b.byId(d.node)).style,k;d=b.animateProperty(b.mixin({properties:{height:{end:1}}},d));b.connect(d,"beforeBegin",function(){k=e.overflow;e.overflow="hidden";e.display=
""});b.connect(d,"onEnd",function(){e.overflow=k;e.height="auto";e.display="none"});return d};b.fx.slideTo=function(d){var e=null,k=null,h=function(i){return function(){var m=b.getComputedStyle(i),p=m.position;e=p=="absolute"?i.offsetTop:parseInt(m.top)||0;k=p=="absolute"?i.offsetLeft:parseInt(m.left)||0;if(p!="absolute"&&p!="relative"){m=b.position(i,true);e=m.y;k=m.x;i.style.position="absolute";i.style.top=e+"px";i.style.left=k+"px"}}}(d.node=b.byId(d.node));h();d=b.animateProperty(b.mixin({properties:{top:d.top||
0,left:d.left||0}},d));b.connect(d,"beforeBegin",d,h);return d}})();return b.fx});
define("dijit/form/_FormMixin",["dojo","dijit","dojo/window"],function(b,f){b.declare("dijit.form._FormMixin",null,{state:"",reset:function(){b.forEach(this.getDescendants(),function(a){a.reset&&a.reset()})},validate:function(){var a=false;return b.every(b.map(this.getDescendants(),function(c){c._hasBeenBlurred=true;var d=c.disabled||!c.validate||c.validate();if(!d&&!a){b.window.scrollIntoView(c.containerNode||c.domNode);c.focus();a=true}return d}),function(c){return c})},setValues:function(a){b.deprecated(this.declaredClass+
"::setValues() is deprecated. Use set('value', val) instead.","","2.0");return this.set("value",a)},_setValueAttr:function(a){var c={};b.forEach(this.getDescendants(),function(h){if(h.name)(c[h.name]||(c[h.name]=[])).push(h)});for(var d in c)if(c.hasOwnProperty(d)){var e=c[d],k=b.getObject(d,false,a);if(k!==undefined){b.isArray(k)||(k=[k]);if(typeof e[0].checked=="boolean")b.forEach(e,function(h){h.set("value",b.indexOf(k,h.value)!=-1)});else e[0].multiple?e[0].set("value",k):b.forEach(e,function(h,
i){h.set("value",k[i])})}}},getValues:function(){b.deprecated(this.declaredClass+"::getValues() is deprecated. Use get('value') instead.","","2.0");return this.get("value")},_getValueAttr:function(){var a={};b.forEach(this.getDescendants(),function(c){var d=c.name;if(!(!d||c.disabled)){var e=c.get("value");if(typeof c.checked=="boolean")if(/Radio/.test(c.declaredClass))if(e!==false)b.setObject(d,e,a);else{e=b.getObject(d,false,a);e===undefined&&b.setObject(d,null,a)}else{c=b.getObject(d,false,a);
if(!c){c=[];b.setObject(d,c,a)}e!==false&&c.push(e)}else{c=b.getObject(d,false,a);if(typeof c!="undefined")b.isArray(c)?c.push(e):b.setObject(d,[c,e],a);else b.setObject(d,e,a)}}});return a},isValid:function(){return this.state==""},onValidStateChange:function(){},_getState:function(){var a=b.map(this._descendants,function(c){return c.get("state")||""});return b.indexOf(a,"Error")>=0?"Error":b.indexOf(a,"Incomplete")>=0?"Incomplete":""},disconnectChildren:function(){b.forEach(this._childConnections||
[],b.hitch(this,"disconnect"));b.forEach(this._childWatches||[],function(a){a.unwatch()})},connectChildren:function(a){var c=this;this.disconnectChildren();this._descendants=this.getDescendants();a=a?function(h,i){c[h]=i}:b.hitch(this,"_set");a("value",this.get("value"));a("state",this._getState());var d=this._childConnections=[],e=this._childWatches=[];b.forEach(b.filter(this._descendants,function(h){return h.validate}),function(h){b.forEach(["state","disabled"],function(i){e.push(h.watch(i,function(){c.set("state",
c._getState())}))})});var k=function(){c._onChangeDelayTimer&&clearTimeout(c._onChangeDelayTimer);c._onChangeDelayTimer=setTimeout(function(){delete c._onChangeDelayTimer;c._set("value",c.get("value"))},10)};b.forEach(b.filter(this._descendants,function(h){return h.onChange}),function(h){d.push(c.connect(h,"onChange",k));e.push(h.watch("disabled",k))})},startup:function(){this.inherited(arguments);this.connectChildren(true);this.watch("state",function(a,c,d){this.onValidStateChange(d=="")})},destroy:function(){this.disconnectChildren();
this.inherited(arguments)}});return f.form._FormMixin});
define("dijit/_DialogMixin",["dojo","dijit","dijit/_Widget"],function(b,f){b.declare("dijit._DialogMixin",null,{attributeMap:f._Widget.prototype.attributeMap,execute:function(){},onCancel:function(){},onExecute:function(){},_onSubmit:function(){this.onExecute();this.execute(this.get("value"))},_getFocusItems:function(){var a=f._getTabNavigable(this.containerNode);this._firstFocusItem=a.lowest||a.first||this.closeButtonNode||this.domNode;this._lastFocusItem=a.last||a.highest||this._firstFocusItem}});
return f._DialogMixin});
define("dijit/DialogUnderlay",["dojo","dijit","dojo/window","dijit/_Widget","dijit/_Templated"],function(b,f){b.declare("dijit.DialogUnderlay",[f._Widget,f._Templated],{templateString:"<div class='dijitDialogUnderlayWrapper'><div class='dijitDialogUnderlay' dojoAttachPoint='node'></div></div>",dialogId:"","class":"",attributeMap:{id:"domNode"},_setDialogIdAttr:function(a){b.attr(this.node,"id",a+"_underlay");this._set("dialogId",a)},_setClassAttr:function(a){this.node.className="dijitDialogUnderlay "+
a;this._set("class",a)},postCreate:function(){b.body().appendChild(this.domNode)},layout:function(){var a=this.node.style,c=this.domNode.style;c.display="none";var d=b.window.getBox();c.top=d.t+"px";c.left=d.l+"px";a.width=d.w+"px";a.height=d.h+"px";c.display="block"},show:function(){this.domNode.style.display="block";this.layout();this.bgIframe=new f.BackgroundIframe(this.domNode)},hide:function(){this.bgIframe.destroy();delete this.bgIframe;this.domNode.style.display="none"}});return f.DialogUnderlay});
define("dijit/layout/_LayoutWidget",["dojo","dijit","dijit/_Widget","dijit/_Container","dijit/_Contained"],function(b,f){b.declare("dijit.layout._LayoutWidget",[f._Widget,f._Container,f._Contained],{baseClass:"dijitLayoutContainer",isLayoutContainer:true,buildRendering:function(){this.inherited(arguments);b.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(b.isIE?
this.domNode:b.global,"onresize",function(){this.resize()})}}},resize:function(a,c){var d=this.domNode;if(a){b.marginBox(d,a);if(a.t)d.style.top=a.t+"px";if(a.l)d.style.left=a.l+"px"}c=c||{};b.mixin(c,a||{});if(!("h"in c)||!("w"in c))c=b.mixin(b.marginBox(d),c);a=b.getComputedStyle(d);var e=b._getMarginExtents(d,a),k=b._getBorderExtents(d,a);c=this._borderBox={w:c.w-(e.w+k.w),h:c.h-(e.h+k.h)};e=b._getPadExtents(d,a);this._contentBox={l:b._toPixelValue(d,a.paddingLeft),t:b._toPixelValue(d,a.paddingTop),
w:c.w-e.w,h:c.h-e.h};this.layout()},layout:function(){},_setupChild:function(a){b.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){b.removeClass(a.domNode,this.baseClass+"-child"+(a.baseClass?" "+this.baseClass+"-"+a.baseClass:""));this.inherited(arguments)}});f.layout.marginBox2contentBox=function(a,c){var d=b.getComputedStyle(a),e=b._getMarginExtents(a,
d),k=b._getPadBorderExtents(a,d);return{l:b._toPixelValue(a,d.paddingLeft),t:b._toPixelValue(a,d.paddingTop),w:c.w-(e.w+k.w),h:c.h-(e.h+k.h)}};(function(){var a=function(d){return d.substring(0,1).toUpperCase()+d.substring(1)},c=function(d,e){var k=d.resize?d.resize(e):b.marginBox(d.domNode,e);if(k)b.mixin(d,k);else{b.mixin(d,b.marginBox(d.domNode));b.mixin(d,e)}};f.layout.layoutChildren=function(d,e,k,h,i){e=b.mixin({},e);b.addClass(d,"dijitLayoutContainer");k=b.filter(k,function(m){return m.region!=
"center"&&m.layoutAlign!="client"}).concat(b.filter(k,function(m){return m.region=="center"||m.layoutAlign=="client"}));b.forEach(k,function(m){var p=m.domNode,t=m.region||m.layoutAlign,y=p.style;y.left=e.l+"px";y.top=e.t+"px";y.position="absolute";b.addClass(p,"dijitAlign"+a(t));p={};if(h&&h==m.id)p[m.region=="top"||m.region=="bottom"?"h":"w"]=i;if(t=="top"||t=="bottom"){p.w=e.w;c(m,p);e.h-=m.h;if(t=="top")e.t+=m.h;else y.top=e.t+e.h+"px"}else if(t=="left"||t=="right"){p.h=e.h;c(m,p);e.w-=m.w;if(t==
"left")e.l+=m.w;else y.left=e.l+e.w+"px"}else if(t=="client"||t=="center")c(m,e)})}})();return f.layout._LayoutWidget});
define("dijit/layout/_ContentPaneResizeMixin",["dojo","dijit","dijit/_Contained","dijit/layout/_LayoutWidget"],function(b,f){b.declare("dijit.layout._ContentPaneResizeMixin",null,{doLayout:true,isContainer:true,isLayoutContainer:true,_startChildren:function(){b.forEach(this.getChildren(),function(a){a.startup();a._started=true})},startup:function(){if(!this._started){var a=f._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(b.isIE?this.domNode:b.global,"onresize",function(){this._needLayout=!this._childOfLayoutWidget;this.resize()})}},_checkIfSingleChild:function(){var a=b.query("> *",this.containerNode).filter(function(e){return e.tagName!=="SCRIPT"}),c=a.filter(function(e){return b.hasAttr(e,"data-dojo-type")||b.hasAttr(e,"dojoType")||b.hasAttr(e,"widgetId")}),d=b.filter(c.map(f.byNode),function(e){return e&&
e.domNode&&e.resize});if(a.length==c.length&&d.length==1)this._singleChild=d[0];else delete this._singleChild;b.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&&b.marginBox(this.domNode,
a);var d=this.containerNode;if(d===this.domNode){c=c||{};b.mixin(c,a||{});if(!("h"in c)||!("w"in c))c=b.mixin(b.marginBox(d),c);this._contentBox=f.layout.marginBox2contentBox(d,c)}else this._contentBox=b.contentBox(d);this._layoutChildren();delete this._needLayout},_layoutChildren:function(){this.doLayout&&this._checkIfSingleChild();if(this._singleChild&&this._singleChild.resize){var a=this._contentBox||b.contentBox(this.containerNode);this._singleChild.resize({w:a.w,h:a.h})}else b.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"&&!b.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 f.layout._ContentPaneResizeMixin});
define("dojo/html",["dojo","dojo/parser"],function(b){b.getObject("html",true,b);(function(){var f=0;b.html._secureForInnerHtml=function(a){return a.replace(/(?:\s*<!DOCTYPE\s[^>]+>|<title[^>]*>[\s\S]*?<\/title>)/ig,"")};b.html._emptyNode=b.empty;b.html._setNodeContent=function(a,c){b.empty(a);if(c){if(typeof c=="string")c=b._toDom(c,a.ownerDocument);if(!c.nodeType&&b.isArrayLike(c))for(var d=c.length,e=0;e<c.length;e=d==c.length?e+1:0)b.place(c[e],a,"last");else b.place(c,a,"last")}return a};b.declare("dojo.html._ContentSetter",
null,{node:"",content:"",id:"",cleanContent:false,extractContent:false,parseContent:false,parserScope:b._scopeName,startup:true,constructor:function(a,c){b.mixin(this,a||{});c=this.node=b.byId(this.node||c);if(!this.id)this.id=["Setter",c?c.id||c.tagName:"",f++].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=b.html._setNodeContent(a,this.content)}catch(c){var d=this.onContentError(c);try{a.innerHTML=d}catch(e){console.error("Fatal "+this.declaredClass+".setContent could not change content due to "+e.message,e)}}this.node=a},empty:function(){if(this.parseResults&&this.parseResults.length){b.forEach(this.parseResults,function(a){a.destroy&&a.destroy()});delete this.parseResults}b.html._emptyNode(this.node)},onBegin:function(){var a=this.content;if(b.isString(a)){if(this.cleanContent)a=b.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={},d;for(d in a)d in c||(this[d]=a[d])},_parse:function(){var a=this.node;try{var c={};b.forEach(["dir","lang","textDir"],
function(e){if(this[e])c[e]=this[e]},this);this.parseResults=b.parser.parse({rootNode:a,noStart:!this.startup,inherited:c,scope:this.parserScope})}catch(d){this._onError("Content",d,"Error parsing in _ContentSetter#"+this.id)}},_onError:function(a,c,d){a=this["on"+a+"Error"].call(this,c);if(d)console.error(d,c);else a&&b.html._setNodeContent(this.node,a,true)}});b.html.set=function(a,c,d){if(undefined==c){console.warn("dojo.html.set: no cont argument provided, using empty string");c=""}return d?(new b.html._ContentSetter(b.mixin(d,
{content:c,node:a}))).set():b.html._setNodeContent(a,c,true)}})();return b.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(b,f){b.declare("dijit.layout.ContentPane",[f._Widget,f.layout._ContentPaneResizeMixin],{href:"",extractContent:false,parseOnLoad:true,parserScope:b._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:b.delegate(f._Widget.prototype.attributeMap,{title:[]}),stopParser:true,template:false,create:function(a,c){if((!a||!a.template)&&c&&!("href"in a)&&!("content"in a)){var d=b.doc.createDocumentFragment();for(c=b.byId(c);c.firstChild;)d.appendChild(c.firstChild);a=b.delegate(a,{content:d})}this.inherited(arguments,[a,c])},postMixInProperties:function(){this.inherited(arguments);var a=b.i18n.getLocalization("dijit",
"loading",this.lang);this.loadingMessage=b.string.substitute(this.loadingMessage,a);this.errorMessage=b.string.substitute(this.errorMessage,a)},buildRendering:function(){this.inherited(arguments);if(!this.containerNode)this.containerNode=this.domNode;this.domNode.title="";b.attr(this.domNode,"role")||f.setWaiRole(this.domNode,"group")},_startChildren:function(){this.inherited(arguments);this._contentSetter&&b.forEach(this._contentSetter.parseResults,function(a){if(!a._started&&!a._destroyed&&b.isFunction(a.startup)){a.startup();
a._started=true}},this)},setHref:function(a){b.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 b.Deferred(b.hitch(this,"cancel"));this.onLoadDeferred.addCallback(b.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){b.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 b.Deferred(b.hitch(this,"cancel"));this._created&&this.onLoadDeferred.addCallback(b.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 b.Deferred(b.hitch(this,"cancel"));this.onLoadDeferred.addCallback(b.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"};b.isObject(this.ioArgs)&&b.mixin(c,this.ioArgs);var d=this._xhrDfd=(this.ioMethod||b.xhrGet)(c);d.addCallback(function(e){try{a._isDownloaded=true;a._setContent(e,false);a.onDownloadEnd()}catch(k){a._onError("Content",k)}delete a._xhrDfd;return e});d.addErrback(function(e){d.canceled||a._onError("Download",e);delete a._xhrDfd;return e});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;b.forEach(this.getChildren(),function(c){c.destroyRecursive&&c.destroyRecursive()});if(a){b.forEach(a.parseResults,
function(c){c.destroyRecursive&&c.domNode&&c.domNode.parentNode==b.body()&&c.destroyRecursive()});delete a.parseResults}b.html._emptyNode(this.containerNode);delete this._singleChild},_setContent:function(a,c){this.destroyDescendants();var d=this._contentSetter;if(!(d&&d instanceof b.html._ContentSetter))d=this._contentSetter=new b.html._ContentSetter({node:this.containerNode,_onError:b.hitch(this,this._onError),onContentError:b.hitch(this,function(k){k=this.onContentError(k);try{this.containerNode.innerHTML=
k}catch(h){console.error("Fatal "+this.id+" could not change content due to "+h.message,h)}})});var e=b.mixin({cleanContent:this.cleanContent,extractContent:this.extractContent,parseContent:this.parseOnLoad,parserScope:this.parserScope,startup:false,dir:this.dir,lang:this.lang},this._contentSetterParams||{});d.set(b.isObject(a)&&a.domNode?a.domNode:a,e);delete this._contentSetterParams;this.doLayout&&this._checkIfSingleChild();if(!c){if(this._started){this._startChildren();this._scheduleLayout()}this._onLoadHandler(a)}},
_onError:function(a,c,d){this.onLoadDeferred.errback(c);a=this["on"+a+"Error"].call(this,c);if(d)console.error(d,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 f.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(b,f){b.declare("dijit.TooltipDialog",[f.layout.ContentPane,f._Templated,f.form._FormMixin,f._DialogMixin],{title:"",doLayout:false,autofocus:true,baseClass:"dijitTooltipDialog",_firstFocusItem:null,_lastFocusItem:null,templateString:b.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,d){a="dijitTooltipAB"+(d.charAt(1)=="L"?"Left":"Right")+" dijitTooltip"+(d.charAt(0)=="T"?"Below":"Above");b.replaceClass(this.domNode,a,this._currentOrientClass||"");this._currentOrientClass=a},focus:function(){this._getFocusItems(this.containerNode);f.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,d=b.keys;a.charOrCode===d.TAB&&this._getFocusItems(this.containerNode);var e=this._firstFocusItem==this._lastFocusItem;if(a.charOrCode==d.ESCAPE){setTimeout(b.hitch(this,"onCancel"),0);b.stopEvent(a)}else if(c==this._firstFocusItem&&a.shiftKey&&a.charOrCode===d.TAB){e||f.focus(this._lastFocusItem);b.stopEvent(a)}else if(c==this._lastFocusItem&&a.charOrCode===d.TAB&&!a.shiftKey){e||f.focus(this._firstFocusItem);b.stopEvent(a)}else a.charOrCode===
d.TAB&&a.stopPropagation()}});return f.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(b,f){b.declare("dijit._DialogBase",[f._Templated,f.form._FormMixin,f._DialogMixin,f._CssStateMixin],{templateString:b.cache("dijit","templates/Dialog.html"),
baseClass:"dijitDialog",cssStateNodes:{closeButtonNode:"dijitDialogCloseIcon"},attributeMap:b.delegate(f._Widget.prototype.attributeMap,{title:[{node:"titleNode",type:"innerHTML"},{node:"titleBar",type:"attribute"}],"aria-describedby":""}),open:false,duration:f.defaultDuration,refocus:true,autofocus:true,_firstFocusItem:null,_lastFocusItem:null,doLayout:false,draggable:true,"aria-describedby":"",postMixInProperties:function(){var a=b.i18n.getLocalization("dijit","common");b.mixin(this,a);this.inherited(arguments)},
postCreate:function(){b.style(this.domNode,{display:"none",position:"absolute"});b.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&&f._DialogLevelManager.isTop(this)){this._getFocusItems(this.domNode);f.focus(this._firstFocusItem)}this.inherited(arguments)},_endDrag:function(a){if(a&&a.node&&a.node===this.domNode)this._relativePosition=
b.position(a.node)},_setup:function(){var a=this.domNode;if(this.titleBar&&this.draggable){this._moveable=b.isIE==6?new b.dnd.TimedMoveable(a,{handle:this.titleBar}):new b.dnd.Moveable(a,{handle:this.titleBar,timeout:0});this._dndListener=b.subscribe("/dnd/move/stop",this,"_endDrag")}else b.addClass(a,"dijitDialogFixed");this.underlayAttrs={dialogId:this.id,"class":b.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 b.style(this.containerNode,{width:"auto",height:"auto"});var a=b._getMarginSize(this.domNode),c=b.window.getBox();if(a.w>=c.w||a.h>=c.h){var d=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:d,h:a})}else b.style(this.containerNode,{width:d+"px",height:a+"px",
overflow:"auto",position:"relative"})}else this._singleChild&&this._singleChild.resize&&this._singleChild.resize()},_position:function(){if(!b.hasClass(b.body(),"dojoMove")){var a=this.domNode,c=b.window.getBox(),d=this._relativePosition,e=d?null:b._getBorderBox(a),k=Math.floor(c.l+(d?d.x:(c.w-e.w)/2));c=Math.floor(c.t+(d?d.y:(c.h-e.h)/2));b.style(a,{left:k+"px",top:c+"px"})}},_onKey:function(a){if(a.charOrCode){var c=b.keys,d=a.target;a.charOrCode===c.TAB&&this._getFocusItems(this.domNode);var e=
this._firstFocusItem==this._lastFocusItem;if(d==this._firstFocusItem&&a.shiftKey&&a.charOrCode===c.TAB){e||f.focus(this._lastFocusItem);b.stopEvent(a)}else if(d==this._lastFocusItem&&a.charOrCode===c.TAB&&!a.shiftKey){e||f.focus(this._firstFocusItem);b.stopEvent(a)}else{for(;d;){if(d==this.domNode||b.hasClass(d,"dijitPopup"))if(a.charOrCode==c.ESCAPE)this.onCancel();else return;d=d.parentNode}if(a.charOrCode!==c.TAB)b.stopEvent(a);else if(!b.isOpera)try{this._firstFocusItem.focus()}catch(k){}}}},
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(b.connect(window,"onscroll",this,"layout"));this._modalconnects.push(b.connect(window,"onresize",this,function(){var c=b.window.getBox();if(!this._oldViewport||c.h!=this._oldViewport.h||c.w!=this._oldViewport.w){this.layout();this._oldViewport=c}}));this._modalconnects.push(b.connect(this.domNode,
"onkeypress",this,"_onKey"));b.style(this.domNode,{opacity:0,display:""});this._set("open",true);this._onShow();this._size();this._position();var a;this._fadeInDeferred=new b.Deferred(b.hitch(this,function(){a.stop();delete this._fadeInDeferred}));a=b.fadeIn({node:this.domNode,duration:this.duration,beforeBegin:b.hitch(this,function(){f._DialogLevelManager.show(this,this.underlayAttrs)}),onEnd:b.hitch(this,function(){if(this.autofocus&&f._DialogLevelManager.isTop(this)){this._getFocusItems(this.domNode);
f.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 b.Deferred(b.hitch(this,function(){a.stop();delete this._fadeOutDeferred}));a=b.fadeOut({node:this.domNode,duration:this.duration,onEnd:b.hitch(this,function(){this.domNode.style.display="none";f._DialogLevelManager.hide(this);this.onHide();
this._fadeOutDeferred.callback(true);delete this._fadeOutDeferred})}).play();if(this._scrollConnected)this._scrollConnected=false;b.forEach(this._modalconnects,b.disconnect);this._modalconnects=[];this._relativePosition&&delete this._relativePosition;this._set("open",false);return this._fadeOutDeferred}},layout:function(){if(this.domNode.style.display!="none"){f._underlay&&f._underlay.layout();this._position()}},destroy:function(){this._fadeInDeferred&&this._fadeInDeferred.cancel();this._fadeOutDeferred&&
this._fadeOutDeferred.cancel();this._moveable&&this._moveable.destroy();this._dndListener&&b.unsubscribe(this._dndListener);b.forEach(this._modalconnects,b.disconnect);f._DialogLevelManager.hide(this);this.inherited(arguments)}});b.declare("dijit.Dialog",[f.layout.ContentPane,f._DialogBase],{});f._DialogLevelManager={show:function(a,c){var d=f._dialogStack;d[d.length-1].focus=f.getFocus(a);var e=f._underlay;if(!e||e._destroyed)e=f._underlay=new f.DialogUnderlay(c);else e.set(a.underlayAttrs);var k=
d[d.length-1].dialog?d[d.length-1].zIndex+2:950;d.length==1&&e.show();b.style(f._underlay.domNode,"zIndex",k-1);b.style(a.domNode,"zIndex",k);d.push({dialog:a,underlayAttrs:c,zIndex:k})},hide:function(a){var c=f._dialogStack;if(c[c.length-1].dialog==a){c.pop();var d=c[c.length-1];if(c.length==1)f._underlay._destroyed||f._underlay.hide();else{b.style(f._underlay.domNode,"zIndex",d.zIndex-1);f._underlay.set(d.underlayAttrs)}if(a.refocus){c=d.focus;if(!c||d.dialog&&!b.isDescendant(c.node,d.dialog.domNode)){d.dialog._getFocusItems(d.dialog.domNode);
c=d.dialog._firstFocusItem}try{f.focus(c)}catch(e){}}}else{d=b.indexOf(b.map(c,function(k){return k.dialog}),a);d!=-1&&c.splice(d,1)}},isTop:function(a){var c=f._dialogStack;return c[c.length-1].dialog==a}};f._dialogStack=[{dialog:null,focus:null,underlayAttrs:null}];return f.Dialog});define("text!orion/widgets/templates/OpenResourceDialog.html",function(){return'<div dojoAttachPoint="containerNode">\n\t<div dojoAttachPoint="dialog" dojoType="dijit.Dialog" title="${title}" widgetsInTemplate="true">\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","text!orion/widgets/templates/OpenResourceDialog.html"],function(b,f){return b.declare("orion.widgets.OpenResourceDialog",[f._Widget,f._Templated],{widgetsInTemplate:true,templateString:b.cache("orion","widgets/templates/OpenResourceDialog.html"),SEARCH_DELAY:500,timeoutId:null,time:null,searchLocation:null,searcher:null,constructor:function(){this.inherited(arguments);this.timeoutId=null;this.time=0;this.searchLocation=
arguments[0]&&arguments[0].SearchLocation;this.searcher=arguments[0]&&arguments[0].searcher;if(!this.searchLocation)throw new Error("Missing required argument: SearchLocation");if(!this.searcher)throw new Error("Missing required argument: searcher");},postMixInProperties:function(){this.inherited(arguments);this.title="Open Resource";this.selectFile="Type the name of a file to open (? = any character, * = any string):";this.searchPlaceHolder="Search"},postCreate:function(){this.inherited(arguments);
b.connect(this.resourceName,"onChange",this,function(){this.time=+new Date;clearTimeout(this.timeoutId);this.timeoutId=setTimeout(b.hitch(this,this.checkSearch),0)});b.connect(this.resourceName,"onKeyPress",this,function(a){if(a.keyCode===b.keys.ENTER&&this.results){a=b.query("a",this.results);if(a.length>0){window.open(a[0].href);this.dialog.hide()}}});b.connect(this.dialog,"onMouseUp",function(a){a.target.focus()});b.connect(this.dialog,"onHide",this,function(){this.onHide()});this.dialog.refocus=
false},checkSearch:function(){clearTimeout(this.timeoutId);var a=+new Date;if(a-this.time>this.SEARCH_DELAY){this.time=a;this.doSearch()}else this.timeoutId=setTimeout(b.hitch(this,arguments.callee),50)},doSearch:function(){var a=this.resourceName&&this.resourceName.get("value");if(a){b.place("<div>Searching&#x2026;</div>",this.results,"only");var c=this;setTimeout(function(){var d=a+=/\*$/.test(a)?"":"*";c.searcher.search(c.results,c.searchLocation+"Name:"+d,false,false,b.hitch(c,c.decorateResult),
true)},0)}},decorateResult:function(a){var c=this;b.query("a",a).forEach(function(d){b.connect(d,"onmouseup",function(e){!b.mouseButtons.isMiddle(e)&&!b.isCopyKey(e)&&c.dialog.hide()})})},show:function(){this.dialog.show();this.resourceName.focus()},onHide:function(){clearTimeout(this.timeoutId);setTimeout(b.hitch(this,function(){this.dialog.destroyRecursive();this.destroyRecursive()}),this.dialog.duration)}})});
define("orion/globalCommands",["dojo","dijit","orion/commands","orion/util","orion/textview/keyBinding","dijit/Menu","dijit/MenuItem","dijit/form/DropDownButton","orion/widgets/OpenResourceDialog"],function(b,f,a,c,d){function e(t,y){var u=b.byId("userInfo");if(u){b.addClass(u,"globalActions");var s=f.byId("userMenu");s&&s.destroy();b.empty(u);if(t){c.setUserName(t);s=new f.Menu({style:"display: none;",id:"userMenu"});var q=new f.MenuItem({label:"Profile",onClick:b.hitch(this,function(){window.location=
"/profile/user-profile.html#/users/"+t})});s.addChild(q);q=new f.MenuItem({label:"Sign out",onClick:logout});s.addChild(q);y=new f.form.DropDownButton({label:t,dropDown:s,title:y});b.addClass(y.domNode,"commandImage");b.place(y.domNode,u,"last")}else{y=document.createElement("span");y.appendChild(document.createTextNode("Sign in"));y.onclick=function(){login()};y.id="signOutUser";u.appendChild(y);b.addClass(y,"commandLink")}p=null}else p={userName:t,userStatusText:y}}function k(t,y,u,s){var q=b.byId("pageActions");
if(u)q=b.byId(u);if(q){b.empty(q);t.renderCommands(q,"dom",y,y,"image",null,null,!s)}}function h(t,y,u,s,q,x,w,g){var j;s=b.byId(t);if(!s)throw"could not find banner parent, id was "+t;b.place(i,s,"only");b.place('<div id="keyAssist" class="keyAssistFloat"></div>',document.body,"last");var l=b.byId("primaryNav");if(l)for(var n=y.getServiceReferences("orion.page.link"),o=0;o<n.length;o++)y.getService(n[o]).then(function(){for(var B={},D=n[o].getPropertyNames(),E=0;E<D.length;E++)B[D[E]]=n[o].getProperty(D[E]);
if(B.href&&B.name){D=b.create("a",{href:B.href},l,"last");b.addClass(D,"commandLink");j=document.createTextNode(B.name);b.place(j,D,"only")}});var r=b.byId("search");if(!r)throw"failed to generate HTML for banner";b.connect(r,"onkeypress",function(B){if(B.charOrCode===b.keys.ENTER)if(r.value.length>0)window.location="/search/search.html#"+("/filesearch?q="+r.value)});if(t=b.byId("pageTitle")){j=document.createTextNode(document.title);b.place(j,t,"last")}var v=function(B,D,E){var F=new orion.widgets.OpenResourceDialog({SearchLocation:B,
searcher:D});E&&b.connect(F,"onHide",function(){E.getTextView().focus()});window.setTimeout(function(){F.show()},0)};t=new a.Command({name:"Find File Named...",id:"eclipse.openResource",callback:function(){v("/filesearch?q=",q,w)}});if(w){w.getTextView().setKeyBinding(new d.KeyBinding("r",true,true,false),"Find File Named...");w.getTextView().setAction("Find File Named...",function(){v("/filesearch?q=",q,w);return true})}u.addCommand(t,"global");u.registerCommandContribution("eclipse.openResource",
1,"globalActions",null,new a.CommandKeyBinding("t"),true);var z=b.byId("keyAssist");b.connect(document,"onkeypress",b.hitch(this,function(B){if(B.charOrCode===b.keys.ESCAPE)z.style.display="none"}));g&&g.addHandler({isActive:function(){return z.style.display==="block"},cancel:function(){if(this.isActive()){z.style.display="none";return true}return false}});g=new a.Command({name:"Show Keys",id:"eclipse.keyAssist",callback:function(){b.empty(z);if(w){b.place("<h2>Editor</h2>",z,"last");for(var B=w.getTextView().getActions(false),
D=0;D<B.length;D++)for(var E=B[D],F=w.getTextView().getKeyBindings(E),J=0;J<F.length;J++)b.place("<span>"+c.getUserKeyString(F[J])+" = "+E+"<br></span>",z,"last")}b.place("<h2>Global</h2>",z,"last");u.showKeyBindings(z);z.style.display="block";return true}});u.addCommand(g,"global");u.registerCommandContribution("eclipse.keyAssist",1,"globalActions",null,new a.CommandKeyBinding(191,false,true),true);if(w){w.getTextView().setKeyBinding(new a.CommandKeyBinding("L",true,true),"Show Keys");w.getTextView().setAction("Show Keys",
g.callback)}if(g=b.byId("globalActions")){b.empty(g);u.renderCommands(g,"global",x||{},x,"image")}p&&e(p.userName,p.userStatusText);if(m)(x=b.byId("footer"))&&b.place(m,x,"only")}var i='<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="/index.html"><img class="toolbarLabel" src="/images/orion.gif" 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="/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></td></tr></table>',
m='<img src="http://dev.eclipse.org/small_icons/emblems/emblem-important.png"/> 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=e4&component=Orion&version=0.2">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>',
p=null;return{generateUserInfo:e,generateDomCommandsInBanner:k,generateBanner:h}});
define("dojo/date",["dojo"],function(b){b.getObject("date",true,b);b.date.getDaysInMonth=function(f){var a=f.getMonth();if(a==1&&b.date.isLeapYear(f))return 29;return[31,28,31,30,31,30,31,31,30,31,30,31][a]};b.date.isLeapYear=function(f){f=f.getFullYear();return!(f%400)||!(f%4)&&!!(f%100)};b.date.getTimezoneName=function(f){var a=f.toString(),c="",d=a.indexOf("(");if(d>-1)c=a.substring(++d,a.indexOf(")"));else{d=/([A-Z\/]+) \d{4}$/;if(a=a.match(d))c=a[1];else{a=f.toLocaleString();d=/ ([A-Z\/]+)$/;
if(a=a.match(d))c=a[1]}}return c=="AM"||c=="PM"?"":c};b.date.compare=function(f,a,c){f=new Date(+f);a=new Date(+(a||new Date));if(c=="date"){f.setHours(0,0,0,0);a.setHours(0,0,0,0)}else if(c=="time"){f.setFullYear(0,0,0);a.setFullYear(0,0,0)}if(f>a)return 1;if(f<a)return-1;return 0};b.date.add=function(f,a,c){var d=new Date(+f),e=false,k="Date";switch(a){case "day":break;case "weekday":var h;if(a=c%5){a=a;h=parseInt(c/5)}else{a=c>0?5:-5;h=c>0?(c-5)/5:(c+5)/5}var i=f.getDay(),m=0;if(i==6&&c>0)m=1;
else if(i==0&&c<0)m=-1;i=i+a;if(i==0||i==6)m=c>0?2:-2;c=7*h+a+m;break;case "year":k="FullYear";e=true;break;case "week":c*=7;break;case "quarter":c*=3;case "month":e=true;k="Month";break;default:k="UTC"+a.charAt(0).toUpperCase()+a.substring(1)+"s"}k&&d["set"+k](d["get"+k]()+c);e&&d.getDate()<f.getDate()&&d.setDate(0);return d};b.date.difference=function(f,a,c){a=a||new Date;c=c||"day";var d=a.getFullYear()-f.getFullYear(),e=1;switch(c){case "quarter":f=f.getMonth();a=a.getMonth();f=Math.floor(f/3)+
1;a=Math.floor(a/3)+1;a+=d*4;e=a-f;break;case "weekday":d=Math.round(b.date.difference(f,a,"day"));c=parseInt(b.date.difference(f,a,"week"));e=d%7;if(e==0)d=c*5;else{var k=0,h=f.getDay();a=a.getDay();c=parseInt(d/7);e=d%7;f=new Date(f);f.setDate(f.getDate()+c*7);f=f.getDay();if(d>0)switch(true){case h==6:k=-1;break;case h==0:k=0;break;case a==6:k=-1;break;case a==0:k=-2;break;case f+e>5:k=-2}else if(d<0)switch(true){case h==6:k=0;break;case h==0:k=1;break;case a==6:k=2;break;case a==0:k=1;break;case f+
e<0:k=2}d+=k;d-=c*2}e=d;break;case "year":e=d;break;case "month":e=a.getMonth()-f.getMonth()+d*12;break;case "week":e=parseInt(b.date.difference(f,a,"day")/7);break;case "day":e/=24;case "hour":e/=60;case "minute":e/=60;case "second":e/=1E3;case "millisecond":e*=a.getTime()-f.getTime()}return Math.round(e)};return b.date});
define("dojo/cldr/supplemental",["dojo","dojo/i18n"],function(b){b.getObject("cldr.supplemental",true,b);b.cldr.supplemental.getFirstDayOfWeek=function(f){f={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}[b.cldr.supplemental._region(f)];return f===undefined?
1:f};b.cldr.supplemental._region=function(f){f=b.i18n.normalizeLocale(f);f=f.split("-");var a=f[1];if(a){if(a.length==4)a=f[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"}[f[0]];return a};b.cldr.supplemental.getWeekend=function(f){var a=b.cldr.supplemental._region(f);f={"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(f===undefined)f=6;if(a===undefined)a=0;return{start:f,end:a}};return b.cldr.supplemental});
define("dojo/regexp",["dojo"],function(b){b.getObject("regexp",true,b);b.regexp.escapeString=function(f,a){return f.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,function(c){if(a&&a.indexOf(c)!=-1)return c;return"\\"+c})};b.regexp.buildGroupRE=function(f,a,c){if(!(f instanceof Array))return a(f);for(var d=[],e=0;e<f.length;e++)d.push(a(f[e]));return b.regexp.group(d.join("|"),c)};b.regexp.group=function(f,a){return"("+(a?"?:":"")+f+")"};return b.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(b){b.getObject("date.locale",true,b);(function(){function f(d,e,k,h){return h.replace(/([a-z])\1*/ig,function(i){var m,p,t=i.charAt(0);i=i.length;var y=["abbr","wide","narrow"];switch(t){case "G":m=e[i<4?"eraAbbr":"eraNames"][d.getFullYear()<0?0:1];break;case "y":m=d.getFullYear();switch(i){case 1:break;case 2:if(!k.fullYear){m=String(m);m=m.substr(m.length-
2);break}default:p=true}break;case "Q":case "q":m=Math.ceil((d.getMonth()+1)/3);p=true;break;case "M":m=d.getMonth();if(i<3){m=m+1;p=true}else{t=["months-format",y[i-3]].join("-");m=e[t][m]}break;case "w":m=b.date.locale._getWeekOfYear(d,0);p=true;break;case "d":m=d.getDate();p=true;break;case "D":m=b.date.locale._getDayOfYear(d);p=true;break;case "E":m=d.getDay();if(i<3){m=m+1;p=true}else{t=["days-format",y[i-3]].join("-");m=e[t][m]}break;case "a":m=d.getHours()<12?"am":"pm";m=k[m]||e["dayPeriods-format-wide-"+
m];break;case "h":case "H":case "K":case "k":p=d.getHours();switch(t){case "h":m=p%12||12;break;case "H":m=p;break;case "K":m=p%12;break;case "k":m=p||24;break}p=true;break;case "m":m=d.getMinutes();p=true;break;case "s":m=d.getSeconds();p=true;break;case "S":m=Math.round(d.getMilliseconds()*Math.pow(10,i-3));p=true;break;case "v":case "z":if(m=b.date.locale._getZone(d,true,k))break;i=4;case "Z":m=b.date.locale._getZone(d,false,k);m=[m<=0?"+":"-",b.string.pad(Math.floor(Math.abs(m)/60),2),b.string.pad(Math.abs(m)%
60,2)];if(i==4){m.splice(0,0,"GMT");m.splice(3,0,":")}m=m.join("");break;default:throw new Error("dojo.date.locale.format: invalid pattern char: "+h);}if(p)m=b.string.pad(m,i);return m})}function a(d,e,k,h){var i=function(t){return t};e=e||i;k=k||i;h=h||i;var m=d.match(/(''|[^'])+/g),p=d.charAt(0)=="'";b.forEach(m,function(t,y){if(t){m[y]=(p?k:e)(t.replace(/''/g,"'"));p=!p}else m[y]=""});return h(m.join(""))}function c(d,e,k,h){h=b.regexp.escapeString(h);k.strict||(h=h.replace(" a"," ?a"));return h.replace(/([a-z])\1*/ig,
function(i){var m;m=i.charAt(0);var p=i.length,t="",y="";if(k.strict){if(p>1)t="0{"+(p-1)+"}";if(p>2)y="0{"+(p-2)+"}"}else{t="0?";y="0{0,2}"}switch(m){case "y":m="\\d{2,4}";break;case "M":m=p>2?"\\S+?":"1[0-2]|"+t+"[1-9]";break;case "D":m="[12][0-9][0-9]|3[0-5][0-9]|36[0-6]|"+y+"[1-9][0-9]|"+t+"[1-9]";break;case "d":m="3[01]|[12]\\d|"+t+"[1-9]";break;case "w":m="[1-4][0-9]|5[0-3]|"+t+"[1-9]";break;case "E":m="\\S+";break;case "h":m="1[0-2]|"+t+"[1-9]";break;case "k":m="1[01]|"+t+"\\d";break;case "H":m=
"1\\d|2[0-3]|"+t+"\\d";break;case "K":m="1\\d|2[0-4]|"+t+"[1-9]";break;case "m":case "s":m="[0-5]\\d";break;case "S":m="\\d{"+p+"}";break;case "a":p=k.am||e["dayPeriods-format-wide-am"];t=k.pm||e["dayPeriods-format-wide-pm"];m=p+"|"+t;if(!k.strict){if(p!=p.toLowerCase())m+="|"+p.toLowerCase();if(t!=t.toLowerCase())m+="|"+t.toLowerCase();if(m.indexOf(".")!=-1)m+="|"+m.replace(/\./g,"")}m=m.replace(/\./g,"\\.");break;default:m=".*"}d&&d.push(i);return"("+m+")"}).replace(/[\xa0 ]/g,"[\\s\\xa0]")}b.date.locale._getZone=
function(d,e){return e?b.date.getTimezoneName(d):d.getTimezoneOffset()};b.date.locale.format=function(d,e){e=e||{};var k=b.i18n.normalizeLocale(e.locale),h=e.formatLength||"short";k=b.date.locale._getGregorianBundle(k);var i=[];d=b.hitch(this,f,d,k,e);if(e.selector=="year")return a(k["dateFormatItem-yyyy"]||"yyyy",d);var m;if(e.selector!="date")(m=e.timePattern||k["timeFormat-"+h])&&i.push(a(m,d));if(e.selector!="time")(m=e.datePattern||k["dateFormat-"+h])&&i.push(a(m,d));return i.length==1?i[0]:
k["dateTimeFormat-"+h].replace(/\{(\d+)\}/g,function(p,t){return i[t]})};b.date.locale.regexp=function(d){return b.date.locale._parseInfo(d).regexp};b.date.locale._parseInfo=function(d){d=d||{};var e=b.i18n.normalizeLocale(d.locale);e=b.date.locale._getGregorianBundle(e);var k=d.formatLength||"short",h=d.datePattern||e["dateFormat-"+k],i=d.timePattern||e["timeFormat-"+k];k=d.selector=="date"?h:d.selector=="time"?i:e["dateTimeFormat-"+k].replace(/\{(\d+)\}/g,function(p,t){return[i,h][t]});var m=[];
return{regexp:a(k,b.hitch(this,c,m,e,d)),tokens:m,bundle:e}};b.date.locale.parse=function(d,e){var k=/[\u200E\u200F\u202A\u202E]/g,h=b.date.locale._parseInfo(e),i=h.tokens,m=h.bundle;d=(new RegExp("^"+h.regexp.replace(k,"")+"$",h.strict?"":"i")).exec(d&&d.replace(k,""));if(!d)return null;var p=["abbr","wide","narrow"],t=[1970,0,1,0,0,0,0],y="";d=b.every(d,function(s,q){if(!q)return true;q=i[q-1];var x=q.length;switch(q.charAt(0)){case "y":if(x!=2&&e.strict)t[0]=s;else if(s<100){s=Number(s);x=""+(new Date).getFullYear();
q=x.substring(0,2)*100;x=Math.min(Number(x.substring(2,4))+20,99);t[0]=s<x?q+s:q-100+s}else{if(e.strict)return false;t[0]=s}break;case "M":if(x>2){q=m["months-format-"+p[x-3]].concat();if(!e.strict){s=s.replace(".","").toLowerCase();q=b.map(q,function(g){return g.replace(".","").toLowerCase()})}s=b.indexOf(q,s);if(s==-1)return false}else s--;t[1]=s;break;case "E":case "e":q=m["days-format-"+p[x-3]].concat();if(!e.strict){s=s.toLowerCase();q=b.map(q,function(g){return g.toLowerCase()})}s=b.indexOf(q,
s);if(s==-1)return false;break;case "D":t[1]=0;case "d":t[2]=s;break;case "a":q=e.am||m["dayPeriods-format-wide-am"];x=e.pm||m["dayPeriods-format-wide-pm"];if(!e.strict){var w=/\./g;s=s.replace(w,"").toLowerCase();q=q.replace(w,"").toLowerCase();x=x.replace(w,"").toLowerCase()}if(e.strict&&s!=q&&s!=x)return false;y=s==x?"p":s==q?"a":"";break;case "K":if(s==24)s=0;case "h":case "H":case "k":if(s>23)return false;t[3]=s;break;case "m":t[4]=s;break;case "s":t[5]=s;break;case "S":t[6]=s}return true});
k=+t[3];if(y==="p"&&k<12)t[3]=k+12;else if(y==="a"&&k==12)t[3]=0;k=new Date(t[0],t[1],t[2],t[3],t[4],t[5],t[6]);e.strict&&k.setFullYear(t[0]);var u=i.join("");h=u.indexOf("d")!=-1;u=u.indexOf("M")!=-1;if(!d||u&&k.getMonth()>t[1]||h&&k.getDate()>t[2])return null;if(u&&k.getMonth()<t[1]||h&&k.getDate()<t[2])k=b.date.add(k,"hour",1);return k}})();(function(){var f=[];b.date.locale.addCustomFormats=function(a,c){f.push({pkg:a,name:c})};b.date.locale._getGregorianBundle=function(a){var c={};b.forEach(f,
function(d){d=b.i18n.getLocalization(d.pkg,d.name,a);c=b.mixin(c,d)},this);return c}})();b.date.locale.addCustomFormats("dojo.cldr","gregorian");b.date.locale.getNames=function(f,a,c,d){var e;d=b.date.locale._getGregorianBundle(d);f=[f,c,a];if(c=="standAlone"){c=f.join("-");e=d[c];if(e[0]==1)e=undefined}f[1]="format";return(e||d[f.join("-")]).concat()};b.date.locale.isWeekend=function(f,a){a=b.cldr.supplemental.getWeekend(a);f=(f||new Date).getDay();if(a.end<a.start){a.end+=7;if(f<a.start)f+=7}return f>=
a.start&&f<=a.end};b.date.locale._getDayOfYear=function(f){return b.date.difference(new Date(f.getFullYear(),0,1,f.getHours()),f)+1};b.date.locale._getWeekOfYear=function(f,a){if(arguments.length==1)a=0;var c=(new Date(f.getFullYear(),0,1)).getDay(),d=(c-a+7)%7;d=Math.floor((b.date.locale._getDayOfYear(f)+d-1)/7);c==a&&d++;return d};return b.date.locale});
define("orion/auth",["dojo","orion/globalCommands","dojo/date/locale"],function(b,f){function a(m,p,t,y){k(p.xhr,function(){var u=b.xhrGet(m);t&&u.then(t,y)})}function c(m,p){k(p.xhr,function(){b.xhrPost(m)})}function d(m,p){k(p.xhr,function(){b.xhrDelete(m)})}function e(m,p){k(p.xhr,function(){b.xhrPut(m)})}function k(m,p){if(m.status===403){if(i==null)i=new dijit.Dialog({title:"Forbidden access"});i.set("content",m.message);i.show()}if(m.status===401){var t=b.subscribe("/auth",function(){p();b.unsubscribe(t)});
if(!h){h=true;eval(m.responseText)}}}var h=false,i;b.addOnLoad(function(){window.dojo=b;window.eclipse=window.eclipse||{};eclipse.globalCommandUtils=f;b.xhrGet({url:"/auth2",handleAs:"javascript",headers:{"Orion-Version":"1"}})});return{handleGetAuthenticationError:a,handlePostAuthenticationError:c,handleDeleteAuthenticationError:d,handlePutAuthenticationError:e,handleAuthenticationError:k}});
define("orion/preferences",["dojo","orion/auth"],function(b,f){function a(h,i,m){this._name=h;this._userProvider=i;this._defaultsProvider=m;this._flushPending=false;this._defaults=this._store=null}function c(h){this.location=h;this._currentPromises={}}function d(h){this.location=h;this._currentPromise=null}function e(h,i,m){i=i||"/prefs/user";m=m||"/defaults.pref";this._userProvider=new c(i);this._defaultsProvider=new d(m);this._serviceRegistration=h.registerService("orion.core.preference",this)}
a.prototype={_flush:function(){return this._userProvider.put(this._name,this._store)},_scheduleFlush:function(){if(!this._flushPending){this._flushPending=true;window.setTimeout(b.hitch(this,function(){if(this._flushPending){this._flushPending=false;this._flush()}}),0)}},keys:function(){var h,i=[];for(h in this._store)this._store.hasOwnProperty(h)&&h.charAt(0)!=="/"&&i.push(h);for(h in this._defaults)this._defaults.hasOwnProperty(h)&&!this._store.hasOwnProperty(h)&&h.charAt(0)!=="/"&&i.push(h);return i},
get:function(h){if(h.charAt(0)==="/")throw new Error("Bad character in key name: "+h);return this._store.hasOwnProperty(h)?this._store[h]:this._defaults[h]},put:function(h,i){if(h.charAt(0)==="/")throw new Error("Bad character in key name: "+h);if(this._store[h]!==i){this._store[h]=i;this._scheduleFlush()}},remove:function(h){if(h.charAt(0)==="/")throw new Error("Bad character in key name: "+h);if(this._store[h]){delete this._store[h];this._scheduleFlush();return true}return false},clear:function(){var h;
for(h in this._store)this._store.hasOwnProperty(h)&&h.charAt(0)!=="/"&&delete this._store[h];this._scheduleFlush()},sync:function(){if(this._flushPending){this._flushPending=false;return this._flush()}return this._defaultsProvider.get(this._name).then(b.hitch(this,function(h){this._defaults=h;return this._userProvider.get(this._name).then(b.hitch(this,function(i){this._store=i}))}))},flush:function(){this._flush()}};var k={get:function(h,i){h=localStorage.getItem(h);if(h==null)return null;h=JSON.parse(h);
if(i||h._expires&&h._expires>(new Date).getTime()){delete h._expires;return h}return null},set:function(h,i){i._expires=(new Date).getTime()+36E5;var m=JSON.stringify(i);localStorage.setItem(h,m);delete i._expires}};c.prototype={get:function(h){if(this._currentPromises[h])return this._currentPromises[h];var i=new b.Deferred,m="/orion/preferences/user"+h,p=k.get(m);if(p!==null)i.resolve(p);else{this._currentPromises[h]=i;var t=this;b.xhrGet({url:this.location+h,headers:{"Orion-Version":"1"},handleAs:"json",
timeout:15E3,load:function(y){k.set(m,y);delete t._currentPromises[h];i.resolve(y)},error:function(y,u){y.log=false;if(u.xhr.status===401)f.handleGetAuthenticationError(this,u);else if(u.xhr.status===404){y={};k.set(m,y);delete t._currentPromises[h];i.resolve(y)}else{delete t._currentPromises[h];i.resolve(k.get(m,true)||{})}},failOk:true})}return i},put:function(h,i){var m=new b.Deferred;k.set("/orion/preferences/user"+h,i);b.xhrPut({url:this.location+h,putData:JSON.stringify(i),headers:{"Orion-Version":"1"},
handleAs:"json",contentType:"application/json",timeout:15E3,load:function(){m.resolve()},error:function(p,t){t.xhr.status===401?f.handlePutAuthenticationError(this,t):m.resolve()}});return m}};d.prototype={get:function(h){if(this._currentPromise)return this._currentPromise;var i=new b.Deferred,m=k.get("/orion/preferences/default");if(m!==null)i.resolve(m[h]||{});else{this._currentPromise=i;var p=this;b.xhrGet({url:this.location,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,load:function(t){k.set("/orion/preferences/default",
t);p._currentPromise=null;i.resolve(t[h]||{})},error:function(t,y){if(y.xhr.status===401)f.handleGetAuthenticationError(y.xhr,y);else if(y.xhr.status===404){k.set("/orion/preferences/default",{});p._currentPromise=null;i.resolve({})}else{p._currentPromise=null;t=k.get("/orion/preferences/default",true);t!==null?i.resolve(t[h]||{}):i.resolve({})}}})}return i}};e.prototype={getPreferences:function(h){var i=new a(h,this._userProvider,this._defaultsProvider);return i.sync().then(function(){return i})}};
return{Preferences:a,PreferencesService:e}});
define("dojo/DeferredList",["dojo"],function(b){b.DeferredList=function(f,a,c,d){var e=[];b.Deferred.call(this);var k=this;f.length===0&&!a&&this.resolve([0,[]]);var h=0;b.forEach(f,function(i,m){function p(t,y){e[m]=[t,y];h++;h===f.length&&k.resolve(e)}i.then(function(t){a?k.resolve([m,t]):p(true,t)},function(t){c?k.reject(t):p(false,t);if(d)return null;throw t;})})};b.DeferredList.prototype=new b.Deferred;b.DeferredList.prototype.gatherResults=function(f){f=new b.DeferredList(f,false,true,false);
f.addCallback(function(a){var c=[];b.forEach(a,function(d){c.push(d[1])});return c});return f};return b.DeferredList});
define("orion/pluginregistry",["dojo","orion/serviceregistry","dojo/DeferredList"],function(b,f){var a=a||{};a.Plugin=function(c,d,e){function k(w,g,j,l){if(!t)throw new Error("plugin not connected");var n=s++;q[String(n)]=l;e.postMessage({id:n,serviceId:w,method:g,params:j},t)}function h(w){var g={};if(w.methods)for(var j=0;j<w.methods.length;j++){var l=w.methods[j];g[l]=function(n){return function(){var o=Array.prototype.slice.call(arguments),r=new b.Deferred;p._load().then(function(){k(w.serviceId,
n,o,r)});return r.promise}}(l)}return g}function i(){var w=d.services;if(w)for(var g=0;g<w.length;g++){var j=w[g],l=h(j);x[j.serviceId]=e.registerService(j.type,l,j.properties)}}function m(w){try{if(w.method)if("plugin"===w.method){if(d){if(JSON.stringify(d)!=JSON.stringify(w.params[0])){for(var g in x)if(x.hasOwnProperty(g)){x[g].unregister();delete x[g]}d=w.params[0];i();e.updatePlugin(p)}}else{d=w.params[0];i()}if(!u){u=true;y.resolve(p)}}else if("dispatchEvent"===w.method){var j=x[w.serviceId];
j.dispatchEvent.apply(j,w.params)}else throw new Error("Bad response method: "+w.method);else{var l=q[String(w.id)];delete q[String(w.id)];w.error?l.reject(w.error):l.resolve(w.result)}}catch(n){console.log(n)}}var p=this,t=null,y=new b.Deferred,u=false,s=0,q={},x={};this.getLocation=function(){return c};this.getData=function(){return d};this.uninstall=function(){for(var w in x)if(x.hasOwnProperty(w)){x[w].unregister();delete x[w]}if(t){e.disconnect(t);t=null}e.uninstallPlugin(this)};this.getServiceReferences=
function(){var w=[],g;for(g in x)x.hasOwnProperty(g)&&w.push(x[g].getServiceReference());return w};this._load=function(w){if(!t){t=e.connect(c,m);window.setTimeout(function(){if(!u){if(!w){d={};e.updatePlugin(p)}y.reject(new Error("Load timeout for plugin: "+c))}},15E3)}return y.promise};if(typeof c!=="string")throw new Error("invalid url:"+c);d&&i()};a.PluginRegistry=function(c,d){function e(){var g,j,l=[];if((g=p["/orion/preferences/default"]?JSON.parse(p["/orion/preferences/default"]):null)&&g["/plugins"]){q=
g["/plugins"];for(j in q)if(q.hasOwnProperty(j)){j=i(j);g="plugin."+j;if(p[g]){g=JSON.parse(p[g]);g=new a.Plugin(j,g,w);t.push(g)}else l.push(m.installPlugin(j))}}(x=p["/orion/preferences/user/plugins"]?JSON.parse(p["/orion/preferences/user/plugins"]):null)||(x={});for(j in x)if(x.hasOwnProperty(j)&&j!=="_expires"){j=i(j);g="plugin."+j;if(p[g]){g=JSON.parse(p[g]);g=new a.Plugin(j,g,w);t.push(g)}else l.push(m.installPlugin(j))}s=new b.DeferredList(l)}function k(g){var j;p["plugin."+g.getLocation()]=
JSON.stringify(g.getData());for(j in q)if(q.hasOwnProperty(j))if(g.getLocation()===i(j))return;for(j in x)if(x.hasOwnProperty(j))if(g.getLocation()===i(j))return;x[g.getLocation()]=true;p["/orion/preferences/user/plugins"]=JSON.stringify(x)}function h(g){var j;delete p["plugin."+g.getLocation()];for(j in x)if(x.hasOwnProperty(j))if(g.getLocation()===i(j)){delete x[g.getLocation()];p["/orion/preferences/user/plugins"]=JSON.stringify(x);return}}function i(g){if(g.indexOf("://")===-1){var j=document.createElement("a");
j.href=g;return j.href}return g}var m=this,p=d||localStorage||{},t=[],y=[],u=new f.EventTarget,s,q={},x;window.addEventListener("message",function(g){for(var j=0,l=g.source;j<y.length;j++)if(l===y[j].target){y[j].handler(JSON.parse(g.data));break}},false);var w={registerService:b.hitch(c,c.registerService),connect:function(g,j){var l=document.createElement("iframe");l.id=g;l.name=g;l.style.display="none";l.style.visibility="hidden";l.src=g;document.body.appendChild(l);g={iframe:l,target:l.contentWindow,
handler:j,url:g};y.push(g);return g},disconnect:function(g){for(var j=0;j<y.length;j++)if(g===y[j]){y.splice(j,1);try{document.body.removeChild(g.iframe)}catch(l){}break}},uninstallPlugin:function(g){h(g);for(var j=0;j<t.length;j++)if(g===t[j]){t.splice(j,1);u.dispatchEvent("pluginRemoved",g);break}},updatePlugin:function(g){p["plugin."+g.getLocation()]=JSON.stringify(g.getData());u.dispatchEvent("pluginUpdated",g)},postMessage:function(g,j){j.target.postMessage(JSON.stringify(g),j.url)}};this.startup=
function(){return s.promise};this.shutdown=function(){for(var g=0;g<y.length;g++)try{document.body.removeChild(y[g].iframe)}catch(j){}};this.installPlugin=function(g,j){g=i(g);for(var l=new b.Deferred,n,o=0;o<t.length;o++)if(g===t[o].getLocation()){n=t[o];break}if(n)if(n.getData())l.resolve(n);else{var r=function(v){if(v.getLocation()===g){l.resolve(v);u.removeEventListener("pluginAdded",r)}};u.addEventListener("pluginAdded",r)}else{n=new a.Plugin(g,j,w);t.push(n);if(n.getData()){k(n);u.dispatchEvent("pluginAdded",
n);l.resolve(n)}else n._load(!!s).then(function(){k(n);u.dispatchEvent("pluginAdded",n);l.resolve(n)},function(v){l.reject(v)})}return l.promise};this.getPlugins=function(){for(var g=[],j=0;j<t.length;j++)t[j].getData()&&g.push(t[j]);return g};this.getPlugin=function(g){g=i(g);for(var j=0;j<t.length;j++)if(t[j].getData()&&g===t[j].getLocation())return t[j];return null};this.addEventListener=function(g,j){u.addEventListener(g,j)};this.removeEventListener=function(g,j){u.removeEventListener(g,j)};e()};
return a});
define("orion/status",["dojo"],function(b){function f(a,c,d){this._serviceRegistry=a;this._serviceRegistration=a.registerService("orion.page.message",this);this.domId=c;this.progressDomId=d||c}f.prototype={setMessage:function(a,c){b.place(window.document.createTextNode(a),this.domId,"only");if(typeof c==="number"){var d=this;window.setTimeout(function(){var e=b.byId(d.domId);(typeof e.textContent==="string"?e.textContent:e.innerText)===a&&b.place(window.document.createTextNode(""),d.domId,"only")},
c)}},setErrorMessage:function(a){var c=a.responseText||a;try{c=JSON.parse(c)}catch(d){}a=c.Message||c;var e="red";if(c.Severity)switch(c.Severity){case "Warning":e="#FFCC00";break;case "Error":e="red";break;case "Info":case "Ok":e="green";break}c=b.create("span",{style:{color:e}});b.place(window.document.createTextNode(a),c);b.place(c,this.domId,"only")},setProgressMessage:function(a){b.place(window.document.createTextNode(a),this.progressDomId,"only")},setProgressResult:function(a){a=a.responseText||
a;try{a=JSON.parse(a)}catch(c){}var d=a.Message||a,e="/images/info.gif",k="info";if(a.Severity)switch(a.Severity){case "Warning":e="/images/warning.gif";k="warning";break;case "Error":e="/images/error.gif";k="error";break}var h=new Image;h.alt=k;h.title="Press to clear message";h.name=k;h.src=e;b.style(h,"opacity","0.7");b.connect(h,"onmouseover",this,function(){b.style(h,"opacity","1")});b.connect(h,"onmouseout",this,function(){b.style(h,"opacity","0.7")});b.connect(h,"onclick",this,function(){this.setProgressMessage("")});
b.place(h,this.progressDomId,"only");a.HTML?b.place(d,this.progressDomId,"last"):b.place(window.document.createTextNode("   "+d),this.progressDomId,"last")},showWhile:function(a,c){var d=this;d.setProgressMessage(c);return a.then(function(e){if(e&&e.Location&&e.Message&&e.Running)return d._doProgressWhile(e);d.setProgressMessage("");e&&e.Result&&d.setProgressResult(e.Result);return e})},_doProgressWhile:function(a){var c=new b.Deferred;window.setTimeout(function(){b.xhrGet({url:a.Location,headers:{"Orion-Version":"1"},
handleAs:"json",timeout:15E3,load:function(d){c.callback(d)}})},2E3);return this.showWhile(c,a.Message)}};f.prototype.constructor=f;return{StatusReportingService:f}});
define("orion/fileClient",["dojo","orion/auth"],function(b,f){function a(c){this.fileService=c}a.prototype={setFileService:function(c){this.fileService=c},fetchChildren:function(){return this._doServiceCall("fetchChildren",arguments)},createWorkspace:function(){return this._doServiceCall("createWorkspace",arguments)},loadWorkspaces:function(){return this._doServiceCall("loadWorkspaces",arguments)},loadWorkspace:function(){return this._doServiceCall("loadWorkspace",arguments)},createProject:function(){return this._doServiceCall("createProject",
arguments)},createFolder:function(){return this._doServiceCall("createFolder",arguments)},createFile:function(){return this._doServiceCall("createFile",arguments)},deleteFile:function(){return this._doServiceCall("deleteFile",arguments)},moveFile:function(){return this._doServiceCall("moveFile",arguments)},copyFile:function(){return this._doServiceCall("copyFile",arguments)},read:function(){return this._doServiceCall("read",arguments)},write:function(){return this._doServiceCall("write",arguments)},
remoteImport:function(){return this._doServiceCall("remoteImport",arguments)},remoteExport:function(){return this._doServiceCall("remoteExport",arguments)},_doServiceCall:function(c,d){var e=new b.Deferred,k=this.fileService;k[c].apply(k,d).then(function(h){e.callback(h)},function(h){h.status===401||h.status===403?f.handleAuthenticationError(h,function(){k[c].apply(k,d).then(function(i){e.callback(i)},function(i){e.errback(i)})}):e.errback(h)});return e}};a.prototype.constructor=a;return{FileClient:a}});
define("dojo/cookie",["dojo","dojo/regexp"],function(b){b.cookie=function(f,a,c){var d=document.cookie;if(arguments.length==1){var e=d.match(new RegExp("(?:^|; )"+b.regexp.escapeString(f)+"=([^;]*)"));return e?decodeURIComponent(e[1]):undefined}else{c=c||{};d=c.expires;if(typeof d=="number"){var k=new Date;k.setTime(k.getTime()+d*24*60*60*1E3);d=c.expires=k}if(d&&d.toUTCString)c.expires=d.toUTCString();a=encodeURIComponent(a);d=f+"="+a;for(e in c){d+="; "+e;k=c[e];if(k!==true)d+="="+k}document.cookie=
d}};b.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 b.cookie});
define("dijit/layout/BorderContainer",["dojo","dijit","dijit/layout/_LayoutWidget","dojo/cookie","dijit/_Templated"],function(b,f){b.declare("dijit.layout.BorderContainer",f.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){b.forEach(this.getChildren(),
this._setupChild,this);this.inherited(arguments)}},_setupChild:function(a){var c=a.region;if(c){this.inherited(arguments);b.addClass(a.domNode,this.baseClass+"Pane");var d=this.isLeftToRight();if(c=="leading")c=d?"left":"right";if(c=="trailing")c=d?"right":"left";if(c!="center"&&(a.splitter||this.gutters)&&!a._splitterWidget){var e=b.getObject(a.splitter?this._splitterClass:"dijit.layout._Gutter");d=new e({id:a.id+"_splitter",container:this,child:a,region:c,live:this.liveSplitters});d.isSplitter=
true;a._splitterWidget=d;b.place(d.domNode,a.domNode,"after");d.startup()}a.region=c}},layout:function(){this._layoutChildren()},addChild:function(){this.inherited(arguments);this._started&&this.layout()},removeChild:function(a){var c=a.region,d=a._splitterWidget;if(d){d.destroy();delete a._splitterWidget}this.inherited(arguments);this._started&&this._layoutChildren();b.removeClass(a.domNode,this.baseClass+"Pane");b.style(a.domNode,{top:"auto",bottom:"auto",left:"auto",right:"auto",position:"static"});
b.style(a.domNode,c=="top"||c=="bottom"?"width":"height","auto")},getChildren:function(){return b.filter(this.inherited(arguments),function(a){return!a.isSplitter})},getSplitter:function(a){return b.filter(this.getChildren(),function(c){return c.region==a})[0]._splitterWidget},resize:function(){if(!this.cs||!this.pe){var a=this.domNode;this.cs=b.getComputedStyle(a);this.pe=b._getPadExtents(a,this.cs);this.pe.r=b._toPixelValue(a,this.cs.paddingRight);this.pe.b=b._toPixelValue(a,this.cs.paddingBottom);
b.style(a,"padding","0px")}this.inherited(arguments)},_layoutChildren:function(a,c){if(this._borderBox&&this._borderBox.h){var d=b.map(this.getChildren(),function(k,h){return{pane:k,weight:[k.region=="center"?Infinity:0,k.layoutPriority,(this.design=="sidebar"?1:-1)*(/top|bottom/.test(k.region)?1:-1),h]}},this);d.sort(function(k,h){k=k.weight;h=h.weight;for(var i=0;i<k.length;i++)if(k[i]!=h[i])return k[i]-h[i];return 0});var e=[];b.forEach(d,function(k){k=k.pane;e.push(k);k._splitterWidget&&e.push(k._splitterWidget)});
f.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},e,a,c)}},destroyRecursive:function(){b.forEach(this.getChildren(),function(a){var c=a._splitterWidget;c&&c.destroy();delete a._splitterWidget});this.inherited(arguments)}});b.extend(f._Widget,{region:"",layoutPriority:0,splitter:false,minSize:0,maxSize:Infinity});b.declare("dijit.layout._Splitter",[f._Widget,f._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);b.addClass(this.domNode,"dijitSplitter"+(this.horizontal?"H":"V"));if(this.container.persist){var a=b.cookie(this._cookieName);if(a)this.child.domNode.style[this.horizontal?"height":"width"]=a}},_computeMaxSize:function(){var a=this.horizontal?"h":
"w",c=b.marginBox(this.child.domNode)[a],d=b.filter(this.container.getChildren(),function(e){return e.region=="center"})[0];a=b.marginBox(d.domNode)[a];return Math.min(this.child.maxSize,c+a)},_startDrag:function(a){if(!this.cover){this.cover=b.doc.createElement("div");b.addClass(this.cover,"dijitSplitterCover");b.place(this.cover,this.child.domNode,"after")}b.addClass(this.cover,"dijitSplitterCoverActive");this.fake&&b.destroy(this.fake);if(!(this._resize=this.live)){(this.fake=this.domNode.cloneNode(true)).removeAttribute("id");
b.addClass(this.domNode,"dijitSplitterShadow");b.place(this.fake,this.domNode,"after")}b.addClass(this.domNode,"dijitSplitterActive dijitSplitter"+(this.horizontal?"H":"V")+"Active");if(this.fake)b.removeClass(this.fake,"dijitSplitterHover dijitSplitter"+(this.horizontal?"H":"V")+"Hover");var c=this._factor,d=this.horizontal,e=d?"pageY":"pageX",k=a[e],h=this.domNode.style;d=d?"h":"w";var i=b.marginBox(this.child.domNode)[d],m=this._computeMaxSize(),p=this.child.minSize||20;d=this.region;var t=d==
"top"||d=="bottom"?"top":"left",y=parseInt(h[t],10),u=this._resize,s=b.hitch(this.container,"_layoutChildren",this.child.id);d=b.doc;this._handlers=(this._handlers||[]).concat([b.connect(d,"onmousemove",this._drag=function(q,x){q=q[e]-k;var w=c*q+i,g=Math.max(Math.min(w,m),p);if(u||x)s(g);h[t]=q+y+c*(g-w)+"px"}),b.connect(d,"ondragstart",b.stopEvent),b.connect(b.body(),"onselectstart",b.stopEvent),b.connect(d,"onmouseup",this,"_stopDrag")]);b.stopEvent(a)},_onMouse:function(a){a=a.type=="mouseover"||
a.type=="mouseenter";b.toggleClass(this.domNode,"dijitSplitterHover",a);b.toggleClass(this.domNode,"dijitSplitter"+(this.horizontal?"H":"V")+"Hover",a)},_stopDrag:function(a){try{this.cover&&b.removeClass(this.cover,"dijitSplitterCoverActive");this.fake&&b.destroy(this.fake);b.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)b.cookie(this._cookieName,
this.child.domNode.style[this.horizontal?"height":"width"],{expires:365})},_cleanupHandlers:function(){b.forEach(this._handlers,b.disconnect);delete this._handlers},_onKeyPress:function(a){this._resize=true;var c=this.horizontal,d=1,e=b.keys;switch(a.charOrCode){case c?e.UP_ARROW:e.LEFT_ARROW:d*=-1;case c?e.DOWN_ARROW:e.RIGHT_ARROW:break;default:return}c=b._getMarginSize(this.child.domNode)[c?"h":"w"]+this._factor*d;this.container._layoutChildren(this.child.id,Math.max(Math.min(c,this._computeMaxSize()),
this.child.minSize));b.stopEvent(a)},destroy:function(){this._cleanupHandlers();delete this.child;delete this.container;delete this.cover;delete this.fake;this.inherited(arguments)}});b.declare("dijit.layout._Gutter",[f._Widget,f._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);b.addClass(this.domNode,"dijitGutter"+
(this.horizontal?"H":"V"))}});return f.layout.BorderContainer});
define("orion/searchClient",["dojo","dijit","orion/auth","orion/util","dijit/form/Button","dijit/layout/BorderContainer","dijit/layout/ContentPane"],function(b,f,a,c){function d(e){this.registry=e.serviceRegistry}d.prototype={search:function(e,k,h,i,m,p){b.xhrGet({url:k,handleAs:"json",headers:{Accept:"application/json","Orion-Version":"1"},sync:false,timeout:15E3,error:b.hitch(this,function(t,y){this.handleError(t,e);a.handleGetAuthenticationError(this,y,b.hitch(this,this.showSearchResult),b.hitch(this,
function(u){this.handleError(u,e)}));return t}),load:b.hitch(this,function(t){this.showSearchResult(e,k,h,i,m,p,t)})})},handleError:function(e,k){console.error(e);var h=document.createTextNode(e);b.place(h,k,"only");return e},saveSearch:function(e,k){this.registry.getService("orion.core.favorite").then(function(h){h.addFavoriteSearch(e,k)})},formatHighlight:function(e){e=e.split(/(##match|match##)/);for(var k=b.create("div"),h,i=0;i<e.length;i++){var m=e[i];if(m==="##match")h=b.create("b");else if(m===
"match##"){b.place(h,k,"last");h=null}else b.place(document.createTextNode(m),h||k,"last")}return k},showSearchResult:function(e,k,h,i,m,p,t){k=window.location.href.split("#")[0];var y=k.substring(0,k.length-window.location.pathname.length),u=false;b.empty(e);k=t.responseHeader.params.q;k=k.substring(k.indexOf("}")+1);if(t.response.numFound>0){for(var s=document.createElement("table"),q=0;q<t.response.docs.length;q++){var x=t.response.docs[q];if(!x.Directory&&x.Location!==h){var w;if(!u){u=true;if(i){w=
s.insertRow(0).insertCell(0);w.innerHTML="<h2>Search Results</h2>"}}w=s.insertRow(-1).insertCell(0);w.colspan=2;var g=document.createElement("a");b.place(document.createTextNode(x.Name),g);x.LineNumber&&b.place(document.createTextNode(" (Line "+x.LineNumber+")"),g);var j;j=k&&x.LineNumber?y+"/edit/edit.html#"+c.hashFromPosition(x.Location,null,null,x.LineNumber,x.Offset,k.length):y+"/edit/edit.html#"+x.Location;g.setAttribute("href",j);w.appendChild(g);if(!p&&t.highlighting&&t.highlighting[x.Id]&&
t.highlighting[x.Id].Text){x=t.highlighting[x.Id].Text[0];w=s.insertRow(-1).insertCell(0);w.colspan=2;b.place(this.formatHighlight(x),w,"only")}}}b.place(s,e,"last");typeof m==="function"&&m(e)}if(!u){e=b.place("<div>No matches found for </div>",e,"only");e=b.create("b",null,e,"last");b.place(document.createTextNode(k),e,"only")}}};d.prototype.constructor=d;return{Searcher:d}});
define("orion/compare/compare-features",["dojo","dijit","dijit/layout/ContentPane","dijit/layout/BorderContainer"],function(b,f){var a=a||{};a.CompareMergeUIFactory=function(){function c(d){this._parentDivID=d.parentDivID;this._showTitle=d.showTitle;this._showLineStatus=d.showLineStatus}c.prototype={_createNoWrapTextDiv:function(d,e,k,h){var i=document.createElement("table");i.width="100%";var m=document.createElement("tr");i.appendChild(m);var p=document.createElement("td");p.noWrap=true;if(k)p.align=
k;m.appendChild(p);k=document.createElement("h2");k.id=d;b.place(document.createTextNode(e),k,"only");p.appendChild(k);if(h){p=document.createElement("td");p.id="rightContainerCommands";m.appendChild(p);p.noWrap=true;m.align="right";i.align="right"}return i},_createEditorParentDiv:function(d){d=new f.layout.ContentPane({id:d,region:"center",style:"width:100%;height: 100%;overflow: hidden;"});b.addClass(d,"paneScrolled");return d},_createCompareCanvasDiv:function(d){var e=new f.layout.ContentPane({region:"leading",
splitter:false,style:"width:44px;height:100%;overflow: hidden;"}),k=document.createElement("canvas");k.id=d;k.width=46;k.height=3E3;b.toggleClass(k,"compareCanvas",true);e.attr("content",k);e.startup();return e},_appendDomNode:function(d,e){e.placeAt(d)},_createTileDiv:function(d,e){d=this._createNoWrapTextDiv(d,"Compare...",null,e);e=new f.layout.ContentPane({region:"top",style:"width:100%;height:30px;overflow: hidden;"});e.attr("content",d);return e},_createStatusDiv:function(d){d=this._createNoWrapTextDiv(d,
"Line Status","center");var e=new f.layout.ContentPane({region:"bottom",style:"width:100%;height:30px;overflow: hidden;"});e.attr("content",d);return e},_createLeftEditorParentDiv:function(d,e){return this._createEditorParentDiv(d,e)},_createRightEditorParentDiv:function(d,e){var k=new f.layout.BorderContainer({region:"center",gutters:false,design:"headline",style:"width:100%;height: 100%;",liveSplitters:false,persist:false,splitter:false});this._appendDomNode(k,this._createCompareCanvasDiv(e));this._appendDomNode(k,
this._createEditorParentDiv(d));k.startup();return k},_createLeftBorder:function(){var d=new f.layout.BorderContainer({region:"leading",gutters:false,design:"headline",liveSplitters:true,persist:false,splitter:true,style:"width: 50%;height:100%;"});if(this._showTitle){this._leftTitleDivId=this._parentDivID+"_left_title_id";this._appendDomNode(d,this._createTileDiv(this._leftTitleDivId))}this._leftEditorParentDivId=this._parentDivID+"_left_editor_id";this._appendDomNode(d,this._createLeftEditorParentDiv(this._leftEditorParentDivId));
if(this._showLineStatus){this._leftStatusDivId=this._parentDivID+"_left_status_id";this._appendDomNode(d,this._createStatusDiv(this._leftStatusDivId))}d.startup();return d},_createRightBorder:function(){var d=new f.layout.BorderContainer({region:"center",gutters:false,design:"headline",style:"height:100%;",liveSplitters:false,persist:false,splitter:false});if(this._showTitle){this._rightTitleDivId=this._parentDivID+"_right_title_id";this._appendDomNode(d,this._createTileDiv(this._rightTitleDivId,
true))}this._rightEditorParentDivId=this._parentDivID+"_right_editor_id";this._diffCanvasDivId=this._parentDivID+"_diff_canvas_id";this._appendDomNode(d,this._createRightEditorParentDiv(this._rightEditorParentDivId,this._diffCanvasDivId));if(this._showLineStatus){this._rightStatusDivId=this._parentDivID+"_right_status_id";this._appendDomNode(d,this._createStatusDiv(this._rightStatusDivId))}d.startup();return d},buildUI:function(){var d=this._createLeftBorder(),e=this._createRightBorder(),k=f.byId(this._parentDivID);
k.addChild(d);k.addChild(e)},getEditorParentDivId:function(d){return d?this._leftEditorParentDivId:this._rightEditorParentDivId},getTitleDivId:function(d){return d?this._leftTitleDivId:this._rightTitleDivId},getStatusDivId:function(d){return d?this._leftStatusDivId:this._rightStatusDivId},getDiffCanvasDivId:function(){return this._diffCanvasDivId}};return c}();return a});
define("orion/compare/diff-provider",["dojo","orion/auth"],function(b,f){var a=a||{};a.DiffProvider=function(){function c(d){if(d)this._serviceRegistry=d}c.prototype={getDiffContent:function(d,e,k){var h=this;b.xhrGet({url:d,headers:{"Orion-Version":"1"},content:{parts:"diff"},handleAs:"text",timeout:15E3,load:function(i,m){if(e)typeof e==="function"?e(i,m):h._serviceRegistration.dispatchEvent(e,i)},error:function(i,m){k&&k(i,m);f.handleGetAuthenticationError(this,m);return i}})},getDiffFileURI:function(d,
e,k){b.xhrGet({url:d,headers:{"Orion-Version":"1"},content:{parts:"uris"},handleAs:"json",timeout:15E3,load:function(h,i){if(e)typeof e==="function"?e(h,i):service._serviceRegistration.dispatchEvent(e,h)},error:function(h,i){k&&k(h,i);f.handleGetAuthenticationError(this,i);return h}})}};return c}();return a});
define("orion/compare/diff-parser",[],function(){var b=b||{};b.DiffParser=function(){function f(c){this._lineDelimiter=c?c:a?"\r\n":"\n"}var a=navigator.platform.indexOf("Win")!==-1;f.prototype={_init:function(){this._oFileContents=[];this._diffContents=[];this._oBlocks=[];this._nBlocks=[];this._hunkRanges=[];this._lastToken=" ";this._deltaMap=[];this._nFileContents=[];this._nNewLineAtEnd=this._oNewLineAtEnd=true;this._diffContentIndex=1},setLineDelim:function(c){this._lineDelimiter=c},getDiffArray:function(){return{array:this._diffContents,
index:this._diffContentIndex}},parse:function(c,d,e,k){this._init();if(d==="")return{outPutFile:c,mapper:[]};this._oFileContents=c===""?[]:c.split(this._lineDelimiter);this._diffContents=d.split(this._lineDelimiter);d=this._diffContents.length;this._hunkRanges=[];for(var h=0;h<d;h++){var i=this._parseHunkRange(h);i&&this._hunkRanges.push(i)}if(0===this._hunkRanges.length)return{outPutFile:c,mapper:[]};for(c=0;c<this._hunkRanges.length;c++)this._parsehunkBlock(c);this._buildMap(e);if(k===undefined||
!k)this._buildNewFile();return{outPutFile:this._nFileContents.join(this._lineDelimiter),mapper:this._deltaMap}},_logMap:function(){for(var c=0;c<this._deltaMap.length;c++)console.log(JSON.stringify(this._deltaMap[c]))},_logNewFile:function(){for(var c=0;c<this._nFileContents.length;c++)console.log(this._nFileContents[c])},_createBlock:function(c,d,e,k){if(!(k===e&&c===" ")){e=[e,k-e,"s"];if(c==="-")e[2]="r";else if(c==="+")e[2]="a";else if(c==="c")e[2]="c";d.push(e)}},_createMinusBlock:function(c,
d,e){var k=this._oBlocks.length;if(k===0||c!==this._oBlocks[k-1][0]){this._oBlocks.push([c===0?1:c,e]);this._nBlocks.push([d,0,-2])}else this._oBlocks[k-1][1]+=e},_createPlusBlock:function(c,d,e,k){var h=this._nBlocks.length;if(h===0||d!==this._nBlocks[h-1][0]){this._oBlocks.push([c===0?1:c,0]);this._nBlocks.push([d,e,k])}else{this._nBlocks[h-1][1]+=e;this._nBlocks[h-1][2]=k}},_parsehunkBlock:function(c){for(var d=" ",e=this._hunkRanges[c][0]+1,k=c===this._hunkRanges.length-1?this._diffContents.length:
this._hunkRanges[c+1][0],h=0,i=0,m=this._hunkRanges[c][1],p=this._hunkRanges[c][3],t=e,y=e;y<k;y++)if(0!==this._diffContents[y].length){var u=this._diffContents[y][0];if(u==="\\")if("\\ No newline at end of file"===this._diffContents[y].substring(0,this._diffContents[y].length-1)||"\\ No newline at end of file"===this._diffContents[y]){d==="-"?(this._oNewLineAtEnd=false):(this._nNewLineAtEnd=false);if(y>e&&"\r"===this._diffContents[y-1].substring(this._diffContents[y-1].length-1))this._diffContents[y-
1]=this._diffContents[y-1].substring(0,this._diffContents[y-1].length-1);continue}switch(u){case "-":case "+":case " ":break;default:continue}if(d!==u){if(u==="+")t=y;switch(d){case " ":m=this._hunkRanges[c][1]+h;p=this._hunkRanges[c][3]+i;break;case "-":this._createMinusBlock(m,p,this._hunkRanges[c][1]+h-m);break;case "+":this._createPlusBlock(m,p,this._hunkRanges[c][3]+i-p,t);break;default:}d=u}switch(u){case "-":h++;break;case "+":i++;break;case " ":h++;i++;break}}switch(d){case "-":this._createMinusBlock(m,
p,this._hunkRanges[c][1]+h-m);break;case "+":this._createPlusBlock(m,p,this._hunkRanges[c][3]+i-p,t);break}},_detectConflictes:function(c,d){if(c<0)return false;d=c+d;for(c=c;c<d;c++){var e=this._diffContents[c];if(e.indexOf("<<<<<")>-1||e.indexOf(">>>>>")>-1)return true}return false},_buildMap:function(c){for(var d=this._oBlocks.length,e=this._oFileContents.length,k=0,h=1,i=0;i<d;i++){h=this._oBlocks[i][0]-h;if(h>0){this._deltaMap.push([h,h,0]);k+=h}c&&this._detectConflictes(this._nBlocks[i][2],
this._nBlocks[i][1])?this._deltaMap.push([this._nBlocks[i][1],this._oBlocks[i][1],this._nBlocks[i][2]+1,1]):this._deltaMap.push([this._nBlocks[i][1],this._oBlocks[i][1],this._nBlocks[i][2]+1]);k+=this._oBlocks[i][1];h=this._oBlocks[i][0]+this._oBlocks[i][1]}if(0<e-h){this._deltaMap.push([e-h+1,e-h+1,0]);k+=e-h+1}if(k<e){h=e-k;c=this._deltaMap[this._deltaMap.length-1];if(c[2]===0){c[0]+=h;c[1]+=h}else if(c[2]===-1)this._deltaMap.push([h,h,0]);else c[1]+=h}},_buildNewFile:function(){for(var c=1,d=false,
e=this._deltaMap.length,k=0;k<e;k++){d=false;if(this._deltaMap[k][2]===0){for(var h=0;h<this._deltaMap[k][0];h++)this._nFileContents.push(this._oFileContents[c+h-1]);d=true}else if(this._deltaMap[k][2]>0)for(h=0;h<this._deltaMap[k][0];h++)this._nFileContents.push(this._diffContents[this._deltaMap[k][2]+h-1].substring(1));c+=this._deltaMap[k][1]}if(this._nNewLineAtEnd&&!d){this._nFileContents.push("");this._deltaMap[e-1][0]+=1}},_parseHRangeBody:function(c,d){if(0<c.indexOf(",")){c=c.split(",");d.push(parseInt(c[0]));
d.push(parseInt(c[1]))}else{d.push(parseInt(c));d.push(1)}},_parseHunkRange:function(c){var d=this._diffContents[c];if(!(8>d.length))if("@@"===d.substring(0,2)){d=d.substring(2);var e=d.indexOf("@@");if(!(e<0)){d=d.substring(0,e);e=d.indexOf("-");var k=d.indexOf("+");if(!(e<0||k<0)){c=[c];if(e<k){d=d.substring(e+1).split("+");this._parseHRangeBody(d[0],c);this._parseHRangeBody(d[1],c)}else{d=d.substring(k+1).split("-");this._parseHRangeBody(d[1],c);this._parseHRangeBody(d[0],c)}return c}}}}};return f}();
return b});
define("orion/compare/compareUtils",[],function(){var b=b||{};b.compareUtils=b.compareUtils||{};b.compareUtils.lookUpMapper=function(f,a,c){for(var d=0,e=0;e<f.length;e++){var k=f[e][a];if(k===0)k=1;if(c>=d&&c<d+k)return{mapperIndex:e,startFrom:d};if(e===f.length-1)break;d+=f[e][a]}return{mapperIndex:f.length-1,startFrom:d}};b.compareUtils.lookUpLineIndex=function(f,a,c){if(c===0)return 0;for(var d=0,e=0;e<c;e++)d+=f[e][a];return d};b.compareUtils.updateMapper=function(f,a,c,d,e){if(d!==e)if(d>0||
e>0){var k=b.compareUtils.lookUpMapper(f,a,c);if(!(k.mapperIndex<0)){if(d>0){d=d;var h=c-k.startFrom;for(c=k.mapperIndex;c<f.length;c++){h=f[c][a]-h;if(d<=h){f[c][a]-=d;break}f[c][a]-=h;d-=h;h=0}}if(e>0)f[k.mapperIndex][a]+=e}}};b.compareUtils.overlapMapper=function(f,a,c,d,e){f=c+f[a]-1;if(f<c)f=c;if(e<d)e=d;if(f<d||e<c)return false;return true};b.compareUtils.findFirstDiff=function(f,a,c,d){for(var e=0,k=undefined,h=0;h<f.length;h++){if(e>d)break;if(b.compareUtils.overlapMapper(f[h],a,e,c,d)){k=
{mapperIndex:h,startFrom:e};if(f[h][2]!==0)break}e+=f[h][a]}return k};b.compareUtils.matchMapper=function(f,a,c,d){if(f.length===0)return c;var e=c+Math.round((d-c)/3),k=b.compareUtils.findFirstDiff(f,a,c,d),h=f[k.mapperIndex][a]===0?k.startFrom:k.startFrom+f[k.mapperIndex][a]-1,i=b.compareUtils.lookUpLineIndex(f,1-a,k.mapperIndex),m=k.startFrom-c;if(f[k.mapperIndex][2]===0)return i-m;if(e>=k.startFrom&&e<=h)return i-Math.round((d-c)/3);if(e<k.startFrom)return i-m;return(f[k.mapperIndex][1-a]===0?
i:i+f[k.mapperIndex][1-a]-1)-(h-c)};b.compareUtils.getMapperLineCount=function(f){for(var a=0,c=0;c<f.length;c++)a+=Math.max(f[c][0],f[c][1]);return a};b.compareUtils.findNextDiff=function(f,a){var c=0;if(a>=0&&a<f.length-1)c=a+1;for(var d=c;d<f.length;d++)if(f[d][2]!==0)return d;for(d=0;d<c;d++)if(f[d][2]!==0)return d;return a};return b.compareUtils});
define("orion/compare/rulers",["orion/compare/compareUtils"],function(b){var f=f||{};f.CompareRuler=function(){function a(c,d,e){this._location=c||"left";this._overview=d||"page";this._rulerStyle=e;this._editor=null}a.prototype={setView:function(c){this._onModelChanged&&this._editor&&this._editor.removeEventListener("ModelChanged",this,this._onModelChanged);this._editor=c;this._onModelChanged&&this._editor&&this._editor.addEventListener("ModelChanged",this,this._onModelChanged)},getLocation:function(){return this._location},
getOverview:function(){return this._overview}};return a}();f.LineNumberCompareRuler=function(){function a(c,d,e,k,h){f.CompareRuler.call(this,d,"page",e);this._oddStyle=k||{style:{backgroundColor:"white"}};this._evenStyle=h||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=c}a.prototype=new f.CompareRuler;a.prototype.getStyle=function(c){return c===undefined?this._rulerStyle:this._evenStyle};a.prototype.getHTML=function(c){var d=this._editor.getModel();if(c===-1)return d.getLineCount();
else{if(d.getLineNumber){c=d.getLineNumber(c,this._mapperColumnIndex);if(c===-1)return"";return c+1}return c+1}};a.prototype._onModelChanged=function(c){c=c.start;var d=this._editor.getModel(),e=d.getLineCount(),k=(e+"").length;if(this._numOfDigits!==k){this._numOfDigits=k;this._editor.redrawLines(d.getLineAtOffset(c),e,this)}};return a}();f.CompareOverviewRuler=function(){function a(c,d){f.CompareRuler.call(this,c,"document",d)}a.prototype=new f.CompareRuler;a.prototype.getAnnotations=function(){var c=
this._editor.getModel(),d=[];if(c.getAnnotations){c=c.getAnnotations();for(var e=0;e<c.length;e++)c[e]!==undefined&&d.push(c[e][0])}return d};a.prototype.getStyle=function(c){var d,e;if(c===undefined){d=this._rulerStyle||{};e=d.style||(d.style={});e.lineHeight="1px";e.fontSize="1px";e.width="14px"}else{d=c!==-1?{styleClass:"ruler_annotation_breakpoint_overview"}:{};e=d.style||(d.style={});e.cursor="pointer";e.width="8px";e.left="2px";var k=this._editor.getModel();if(c>=0&&k.getAnnotationH){c=k.getAnnotationH(c);
k=k.getLineCount();var h=this._editor.getClientArea();c=Math.floor(h.height*c/k);if(c<2)c=2;e.height=c+"px"}else e.height="3px"}return d};a.prototype.getHTML=function(){return"&nbsp;"};a.prototype.onClick=function(c){if(c!==undefined){var d=this._editor.getLineHeight(),e=this._editor.getClientArea();d=Math.floor(e.height/d/3);this._editor.setTopIndex(c-d>0?c-d:0)}};a.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,1,this)};return a}();f.CompareMergeOverviewRuler=
function(){function a(c,d,e){this._compareMatchRenderer=c;f.CompareRuler.call(this,d,"document",e)}a.prototype=new f.CompareRuler;a.prototype.getAnnotations=function(){var c=this._editor.getModel(),d=[];if(c.getAnnotations){c=c.getAnnotations();for(var e=0;e<c.length;e++)c[e]!==undefined&&d.push(c[e][0])}return d};a.prototype.getStyle=function(c){var d,e;if(c===undefined){d=this._rulerStyle||{};e=d.style||(d.style={});e.lineHeight="1px";e.fontSize="1px";e.width="14px"}else{d=c!==-1?{styleClass:"ruler_annotation_breakpoint_overview"}:
{};e=d.style||(d.style={});e.cursor="pointer";e.width="8px";e.left="2px";var k=this._editor.getModel();if(c>=0&&k.getAnnotationH){c=k.getAnnotationIndex(c);var h=k.getAnnotationMapperIndex(c);if(h=k.isMapperConflict(h))e.border="1px #FF0000 solid";if(c===this._compareMatchRenderer.getCurrentAnnotationIndex())e.backgroundColor=h?"red":"blue";c=k.getAnnotationH(c);k=k.getAnnotationLineCount();h=this._editor.getClientArea();k=Math.floor(h.height*c/k);if(k<2)k=2;e.height=k+"px"}else e.height="3px"}return d};
a.prototype.getHTML=function(){return"&nbsp;"};a.prototype.onClick=function(c){c!==undefined&&this._compareMatchRenderer.matchPositionFromAnnotation(c)};a.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,1,this)};return a}();f.CompareMatchRenderer=function(){function a(c){this._canvasDiv=c;this._mapper=undefined}a.prototype={init:function(c,d,e){this._mapper=c;this._leftEditor=d;this._rightEditor=e;this._currentAnnotationIndex=0;this.render()},
getCurrentAnnotationIndex:function(){return this._currentAnnotationIndex},getCurrentMapperIndex:function(){var c=this._rightEditor.getModel().getAnnotations();return c.length===0?-1:c[this._currentAnnotationIndex][1]},setOverviewRuler:function(c){this._overviewRuler=c},_setEditorPosition:function(c,d){var e=c.getLineHeight(),k=c.getClientArea();e=Math.floor(k.height/e/3);c.setTopIndex(d-e>0?d-e:0)},_findBaseLine:function(c){var d=c.getLineHeight(),e=c.getClientArea();d=Math.floor(e.height/d/3);return c.getTopIndex()+
d},matchPositionFrom:function(c){var d=c?this._leftEditor:this._rightEditor,e=c?this._rightEditor:this._leftEditor,k=d.getTopIndex();d=d.getBottomIndex();c=b.matchMapper(this._mapper,c?0:1,k,d);e.setTopIndex(c)},matchPositionFromAnnotation:function(c){var d=c;this._currentAnnotationIndex=d=c===-1?0:this._rightEditor.getModel().getAnnotationIndex(c);this.positionAnnotation(d)},positionAnnotation:function(c){var d=this._rightEditor.getModel().getAnnotations();if(d.length!==0){this._setEditorPosition(this._rightEditor,
d[c][0]);this._setEditorPosition(this._leftEditor,this._leftEditor.getModel().getLineIndexFromMapper(d[c][1]));this._leftEditor.redrawRange();this._rightEditor.redrawRange();c=this._rightEditor.getTopIndex();this._rightEditor.redrawLines(c,c+1,this._overviewRuler)}},nextDiff:function(){var c=this._rightEditor.getModel().getAnnotations();if(c.length!==0)if(c.length-1===this._currentAnnotationIndex)this._currentAnnotationIndex=0;else this._currentAnnotationIndex+=1;this.positionAnnotation(this._currentAnnotationIndex);
this.render()},prevDiff:function(){var c=this._rightEditor.getModel().getAnnotations();if(c.length!==0)if(0===this._currentAnnotationIndex)this._currentAnnotationIndex=c.length-1;else this._currentAnnotationIndex-=1;this.positionAnnotation(this._currentAnnotationIndex);this.render()},getMapperTextRange:function(c,d,e){var k=c.getModel().getLineIndexFromMapper(d);d=k+this._mapper[d][e]-1;k=c.getModel().getLineStart(k);c=c.getModel().getLineEnd(d,true);return{start:k,end:c}},copyToLeft:function(){var c=
this.getCurrentMapperIndex(),d=this.getMapperTextRange(this._rightEditor,c,1);c=this.getMapperTextRange(this._leftEditor,c,0);this._leftEditor.setText(this._rightEditor.getText(d.start,d.end),c.start,c.end);this._leftEditor.redrawRange();this._rightEditor.redrawRange()},render:function(){if(this._mapper){var c=this._canvasDiv.getContext("2d");c.clearRect(0,0,this._canvasDiv.width,this._canvasDiv.height);c.strokeStyle="#AAAAAA";c.lineWidth=1;c.beginPath();var d=this._leftEditor.getTopIndex(),e=this._leftEditor.getBottomIndex(),
k=this._rightEditor.getTopIndex(),h=this._rightEditor.getBottomIndex();this._leftLineH=this._leftEditor.getLineHeight();this._rightLineH=this._rightEditor.getLineHeight();for(var i=0,m=0,p=false,t=0;t<this._mapper.length;t++){if(this._mapper[t][2]!==0)if(b.overlapMapper(this._mapper[t],0,i,d,e)||b.overlapMapper(this._mapper[t],1,m,k,h)){this._renderCurve(t,i,m,this._canvasDiv,c,d,e,k,h);p=true}else if(p)break;i+=this._mapper[t][0];m+=this._mapper[t][1]}c.stroke()}},_renderCurve:function(c,d,e,k,h){var i=
this._mapper[c];d=this._leftEditor.getLinePixel(d+i[0]/2)+i[0]%2*this._leftLineH/3-this._leftEditor.getTopPixel();e=this._rightEditor.getLinePixel(e+i[1]/2)+i[1]%2*this._rightLineH/3-this._rightEditor.getTopPixel();k=k.parentNode.clientWidth;if(c===this.getCurrentMapperIndex()){h.stroke();h.strokeStyle="#000";h.lineWidth=1;h.beginPath();h.moveTo(0,d);h.bezierCurveTo(k/3,d,k*0.666,e,k,e);h.stroke();h.strokeStyle="#AAAAAA";h.lineWidth=1;h.beginPath()}else{h.moveTo(0,d);h.bezierCurveTo(k/3,d,k*0.666,
e,k,e);h.stroke()}},onChanged:function(c,d,e,k,h){if(k!==h)if(k>0||h>0)this.render()}};return a}();return f});
define("orion/compare/compare-model",[],function(){var b=b||{};b.CompareTextModel=function(){function f(a,c,d){this._model=a;this._mapperColumnIndex=c.columnIndex;this._mapper=c.mapper;this._listeners=[];a.addListener(this);this._lineFeeder=d;this.init()}navigator.platform.indexOf("Win");f.prototype={init:function(a,c){if(a)this._mapper=a;a=this._lineFeeder.generateGapBlocks(this._mapper,this._mapperColumnIndex,c);this._dummyLBlock=a.gapBlocks;this._dummyLNumber=a.gapNumber},_getDummyCharCountAt:function(a,
c){if(a.blockNumber<0)return 0;for(var d=0,e=0;e<=a.blockNumber;e++){if(e>=this._dummyLBlock.length)break;for(var k=e===a.blockNumber?a.stopAtDelta:this._dummyLBlock[e][1]-1,h=0;h<=k;h++){var i=c?this._lineFeeder.getLineAt(this._dummyLBlock,e,h,true):this._lineFeeder.getLineAt(this._dummyLBlock,e,h,!(e===a.blockNumber&&h===k));d+=i.length}}return d},lookUpRealIndex:function(a){for(var c=0,d=0,e=0;e<this._dummyLBlock.length;e++){var k=this._dummyLBlock[e][0],h=k+this._dummyLBlock[e][1]-1;if(a<k)break;
if(a>=k&&a<=h)return{lineIndex:-1,gapsBefore:c+a-k,lastGapInfo:{blockNumber:e,stopAtDelta:a-k}};d=this._dummyLBlock[e][1];c+=d}return{lineIndex:a-c,gapsBefore:c,lastGapInfo:{blockNumber:e-1,stopAtDelta:d-1}}},getLineType:function(a){return this._lineFeeder.getLineType(a,this._mapperColumnIndex)},getAnnotations:function(){return this._lineFeeder.getAnnotations()},getAnnotationH:function(a){return this._lineFeeder.getAnnotationH(a)},getLineNumber:function(a,c){if(this._lineFeeder.getLineNumber)return this._lineFeeder.getLineNumber(a,
c);return this.lookUpRealIndex(a).lineIndex},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(){var a=this._model.getCharCount();if(this._dummyLBlock.length>0)a+=this._getDummyCharCountAt({blockNumber:this._dummyLBlock.length-1,stopAtDelta:this._dummyLBlock[this._dummyLBlock.length-1][1]-1},true);return a},getLine:function(a,c){var d=this.getLineCount();
if(!(0<=a&&a<d))return null;a=this.lookUpRealIndex(a);return a.lineIndex<0?this._lineFeeder.getLineAt(this._dummyLBlock,a.lastGapInfo.blockNumber,a.lastGapInfo.stopAtDelta,c):this._model.getLine(a.lineIndex,c)},getLineAtOffset:function(a){if(!(0<=a&&a<=this.getCharCount()))return-1;for(var c=this.getLineCount(),d=0,e=0;d<c;){var k=this.lookUpRealIndex(d);if(k.lineIndex<0)e+=this._lineFeeder.getLineAt(this._dummyLBlock,k.lastGapInfo.blockNumber,k.lastGapInfo.stopAtDelta,true).length;else{k=this._model.getLine(k.lineIndex,
true);e+=k?k.length:0}d++;if(e>a)break}if(d>c)return c-1;return d-1},getLineCount:function(){return this._model.getLineCount()+this._dummyLNumber},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(a,c){var d=this.getLineCount();if(!(0<=a&&a<d))return-1;var e=this.lookUpRealIndex(a);d=0;if(e.lineIndex<0){d+=this._getDummyCharCountAt(e.lastGapInfo,c);a=a-e.gapsBefore;if(a>0)d+=this._model.getLineEnd(a-1,true)}else{d+=this._getDummyCharCountAt(e.lastGapInfo,true);
d+=this._model.getLineEnd(e.lineIndex,c)}return d},getLineStart:function(a){if(!(0<=a&&a<this.getLineCount()))return-1;if(a===0)return 0;return this.getLineEnd(a-1,true)},getText:function(a,c){if(a===c)return this._model.getText(a,c);if(a===undefined)a=0;if(c===undefined)c=this.getCharCount();var d=this.getLineAtOffset(a),e=this.getLineAtOffset(c),k=this.getLineStart(d),h=this.getLineEnd(e,true),i=this.getLine(d,true);if(!i)return this._model.getText(a,c);if(d===e)return i.substring(a-k,i.length-
h+c);k=i.substring(a-k);i=this.getLine(e,true);if(!i)return this._model.getText(a,c);a=i.substring(0,i.length-h+c);c="";for(d=d+1;d<e;d++)c+=this.getLine(d,true);return k+c+a},onChanging:function(a,c,d,e,k,h){for(var i=0;i<this._listeners.length;i++){var m=this._listeners[i];m&&m.onChanging&&m.onChanging(a,c,d,e,k,h)}},onChanged:function(a,c,d,e,k){for(var h=0;h<this._listeners.length;h++){var i=this._listeners[h];i&&i.onChanged&&i.onChanged(a,c,d,e,k)}},setText:function(a){this._model.setText(a,
0,this._model.getCharCount())}};return f}();b.DiffLineFeeder=function(){function f(a,c){if(a){this._diffLinesArray=a.array;this._diffLinesArrayIndex=a.index}this._lineDelimeter=c;this._annotations=[]}navigator.platform.indexOf("Win");f.prototype={generateGapBlocks:function(a,c,d){var e=[];this._mapper=a;if(d){this._diffLinesArray=d.array;this._diffLinesArrayIndex=d.index}this._annotations=[];d=a=0;for(var k=1-c,h=0,i=0;i<this._mapper.length;i++){h=this._mapper[i][2]===0?this._mapper[i][c]:this._mapper[i][c]+
this._mapper[i][k];if(this._mapper[i][2]>0){var m=this._mapper[i][c];a+=m;e.push([d+this._mapper[i][k],m,this._mapper[i][2]])}this._mapper[i][2]!==0&&this._annotations.push([d,h]);d+=h}return{gapBlocks:e,gapNumber:a}},getLineAt:function(a,c,d,e){c=a[c][2];c+=d-1;d=this._diffLinesArray[c];d===undefined&&console.log(a);d=d.substring(this._diffLinesArrayIndex);if(e)return d+this._lineDelimeter;return d},getLineType:function(a,c){for(var d=0,e=1-c,k=0,h=0;h<this._mapper.length;h++){k=this._mapper[h][2]===
0?this._mapper[h][c]:this._mapper[h][c]+this._mapper[h][e];if(a>=d&&a<d+k){if(this._mapper[h][2]===0)return"unchnaged";else if(this._mapper[h][2]<0)return"removed";else if(this._mapper[h][1]===0)return"added";else if(a<this._mapper[h][e]+d)return"removed";return"added"}d+=k}return"unchnaged"},getLineNumber:function(a,c){if(this._mapper.length===0)return a;for(var d=0,e=0,k=1-c,h=0,i=0;i<this._mapper.length;i++){h=this._mapper[i][2]===0?this._mapper[i][c]:this._mapper[i][c]+this._mapper[i][k];if(a>=
d&&a<d+h){k=a-d;if(this._mapper[i][2]===0)return e+k;else if(this._mapper[i][2]<0)return c===0?-1:e+k;else if(this._mapper[i][1]===0)return c===0?e+k:-1;else if(a<this._mapper[i][1]+d)return c===0?-1:e+k;return c===0?e+k-this._mapper[i][1]:-1}d+=h;e+=this._mapper[i][c]}return a},getAnnotations:function(){return this._annotations},getAnnotationH:function(a){for(var c=0;c<this._annotations.length;c++)if(this._annotations[c][0]===a)return this._annotations[c][1];return 0}};return f}();b.GapLineFeeder=
function(){function f(a){this._lineDelimeter=a;this._annotations=[]}navigator.platform.indexOf("Win");f.prototype={generateGapBlocks:function(a,c){var d=[];this._mapper=a;this._annotations=[];for(var e=a=0,k=1-c,h=0;h<this._mapper.length;h++){if(this._mapper[h][c]<this._mapper[h][k]){var i=this._mapper[h][k]-this._mapper[h][c];a+=i;d.push([e+this._mapper[h][c],i,1])}i=Math.max(this._mapper[h][k],this._mapper[h][c]);this._mapper[h][2]!==0&&this._annotations.push([e,i]);e+=i}return{gapBlocks:d,gapNumber:a}},
getLineAt:function(a,c,d,e){if(e)return this._lineDelimeter;return""},getLineType:function(a,c){for(var d=0,e=1-c,k=0;k<this._mapper.length;k++){var h=Math.max(this._mapper[k][c],this._mapper[k][e]);if(a>=d&&a<d+h){if(this._mapper[k][2]===0)return"unchnaged";else if(this._mapper[k][2]<0)return"removed";else if(this._mapper[k][1]===0)return"added";else if(a<this._mapper[k][c]+d)return"changed";return"changed_gap"}d+=Math.max(this._mapper[k][c],this._mapper[k][e])}return"unchnaged"},getAnnotations:function(){return this._annotations},
getAnnotationH:function(a){for(var c=0;c<this._annotations.length;c++)if(this._annotations[c][0]===a)return this._annotations[c][1];return 0}};return f}();return b});
define("orion/compare/compare-m-model",["orion/compare/compareUtils"],function(b){var f=f||{};f.CompareMergeModel=function(){function a(c,d){this._model=c;this._mapperColumnIndex=d.columnIndex;this._mapper=d.mapper;this._listeners=[];c.addListener(this);this.init()}navigator.platform.indexOf("Win");a.prototype={init:function(c){this._initing=true;if(c){this._mapper=c;this._annotations=undefined}},getLineType:function(c){var d=b.lookUpMapper(this._mapper,this._mapperColumnIndex,c);if(d.mapperIndex>
-1)if(this._mapper[d.mapperIndex][2]!==0){var e=this._mapper[d.mapperIndex][this._mapperColumnIndex];if(e===0)return{type:"top-only",mapperIndex:d.mapperIndex};if(e===1)return{type:"oneline",mapperIndex:d.mapperIndex};if(c===d.startFrom)return{type:"top",mapperIndex:d.mapperIndex};if(c===d.startFrom+e-1)return{type:"bottom",mapperIndex:d.mapperIndex};return{type:"middle",mapperIndex:d.mapperIndex}}return{type:"unchanged",mapperIndex:d.mapperIndex}},isMapperEmpty:function(){return this._mapper.length===
0},isMapperConflict:function(c){if(c<0)return false;if(!this._mapper[c][3])return false;return this._mapper[c][3]===1},getAnnotations:function(){if(this._annotations===undefined){this._annotations=[];for(var c=0,d=0;d<this._mapper.length;d++){this._mapper[d][2]!==0&&this._annotations.push([c,d]);c+=this._mapper[d][this._mapperColumnIndex]}}return this._annotations},getAnnotationH:function(c){c=this._annotations[c][1];return c===-1?0:this._mapper[c][this._mapperColumnIndex]},getAnnotationLineCount:function(){return this.getLineCount()},
getAnnotationIndex:function(c){this._annotations===undefined&&this.getAnnotations();for(var d=0;d<this._annotations.length;d++)if(this._annotations[d][0]===c)return d;return-1},getAnnotationMapperIndex:function(c){this._annotations===undefined&&this.getAnnotations();return this._annotations[c][1]},getAnnotationIndexByMapper:function(c){this._annotations===undefined&&this.getAnnotations();for(var d=0;d<this._annotations.length;d++)if(this._annotations[d][1]===c)return d;return-1},getLineNumber:function(c){return c},
getLineIndexFromMapper:function(c){return b.lookUpLineIndex(this._mapper,this._mapperColumnIndex,c)},lookUpMapper:function(c){return b.lookUpMapper(this._mapper,this._mapperColumnIndex,c)},updateMapper:function(c,d,e,k,h){k!==h&&b.updateMapper(this._mapper,this._mapperColumnIndex,this.getLineAtOffset(c),k,h)},addListener:function(c){this._listeners.push(c)},removeListener:function(c){for(var d=0;d<this._listeners.length;d++)if(this._listeners[d]===c){this._listeners.splice(d,1);return}},getCharCount:function(){return this._model.getCharCount()},
getLine:function(c,d){return this._model.getLine(c,d)},getLineAtOffset:function(c){return this._model.getLineAtOffset(c)},getLineCount:function(){return this._model.getLineCount()},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(c,d){return this._model.getLineEnd(c,d)},getLineStart:function(c){return this._model.getLineStart(c)},setText:function(c,d,e){this._model.setText(c,d,e)},getText:function(c,d){return this._model.getText(c,d)},onChanging:function(c,d,
e,k,h,i){for(var m=0;m<this._listeners.length;m++){var p=this._listeners[m];p&&p.onChanging&&p.onChanging(c,d,e,k,h,i)}},onChanged:function(c,d,e,k,h){if(this._initing)this._initing=false;else this.updateMapper(c,d,e,k,h);for(var i=0;i<this._listeners.length;i++){var m=this._listeners[i];m&&m.onChanged&&m.onChanged(c,d,e,k,h)}}};return a}();return f});orion=orion||{};orion.editor=orion.editor||{};
orion.editor.ContentAssist=function(){function b(f,a,c){this.editor=f;this.textView=f.getTextView();this.contentAssistPanel=dojo.byId(a);this.active=false;this.prefix="";this.serviceRegistry=c;this.contentAssistProviders=[];this.activeServiceReferences=[];this.activeContentAssistProviders=[];this.contentAssistListener={onVerify:function(){this.showContentAssist(false)},onSelectionChanged:function(){this.showContentAssist(false)}};this.init()}b.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",dojo.hitch(this,function(){this.showContentAssist(true);return true}));dojo.connect(this.editor,"onInputChange",this,this.inputChanged)},inputChanged:function(f){if(this.serviceRegistry){this.activeServiceReferences=[];var a=this.serviceRegistry.getServiceReferences("orion.edit.contentAssist");dojo.forEach(a,dojo.hitch(this,function(d){for(var e=
{},k=d.getPropertyNames(),h=0;h<k.length;h++)e[k[h]]=d.getProperty(k[h]);(new RegExp(e.pattern)).test(f)&&this.activeServiceReferences.push(d)}))}for(a=0;a<this.contentAssistProviders.length;a++){var c=this.contentAssistProviders[a];(new RegExp(c.pattern)).test(f)&&this.activeContentAssistProviders.push(c.provider)}},cancel:function(){this.showContentAssist(false)},isActive:function(){return this.active},lineUp:function(){if(this.contentAssistPanel){for(var f=dojo.query("> div",this.contentAssistPanel),
a=0,c=0;c<f.length;c++)if(f[c].className==="selected"){f[c].className="";a=c;break}if(a>0)f[a-1].className="selected";else f[f.length-1].className="selected";return true}},lineDown:function(){if(this.contentAssistPanel){for(var f=dojo.query("> div",this.contentAssistPanel),a=0,c=0;c<f.length;c++)if(f[c].className==="selected"){f[c].className="";a=c;break}if(a<f.length-1)f[a+1].className="selected";else f[0].className="selected";return true}},enter:function(){if(this.contentAssistPanel){this.textView.setText(dojo.query("> .selected",
this.contentAssistPanel)[0].innerHTML.substring(this.prefix.length),this.textView.getCaretOffset(),this.textView.getCaretOffset());this.showContentAssist(false);return true}},showContentAssist:function(f){function a(k,h,i){var m={innerHTML:k,onclick:function(){alert(k)}};if(h)m.className="selected";dojo.create("div",m,i,this)}if(this.contentAssistPanel)if(f){var c=this.textView.getCaretOffset();f=c;for(var d;f>0&&(97<=(d=this.textView.getText(f-1,f).charCodeAt(0))&&d<=122||65<=d&&d<=90||d===95||48<=
d&&d<=57);)f--;this.prefix=this.textView.getText(f,c);var e=[];d=this.textView.getText();f=this.textView.getSelection();this.getKeywords(this.prefix,d,f).then(dojo.hitch(this,function(k){for(var h=0;h<k.length;h++){var i=k[h];i.substr(0,this.prefix.length)===this.prefix&&e.push(i)}if(e.length!==0){k=this.textView.getLocationAtOffset(c);k.y+=this.textView.getLineHeight();this.contentAssistPanel.innerHTML="";for(h=0;h<e.length;h++)a(e[h],h===0,this.contentAssistPanel);this.textView.convert(k,"document",
"page");this.contentAssistPanel.style.position="absolute";this.contentAssistPanel.style.left=k.x+"px";this.contentAssistPanel.style.top=k.y+"px";this.contentAssistPanel.style.display="block";this.textView.addEventListener("Verify",this,this.contentAssistListener.onVerify);this.textView.addEventListener("Selection",this,this.contentAssistListener.onSelectionChanged);this.active=true}}))}else{this.textView.removeEventListener("Verify",this,this.contentAssistListener.onVerify);this.textView.removeEventListener("Selection",
this,this.contentAssistListener.onSelectionChanged);this.active=false;this.contentAssistPanel.style.display="none"}},getKeywords:function(f,a,c){var d=[];dojo.forEach(this.activeContentAssistProviders,function(m){d=d.concat(m.getKeywords()||[])});var e=new dojo.Deferred;if(this.serviceRegistry)for(var k=dojo.map(this.activeServiceReferences,dojo.hitch(this,function(m){return this.serviceRegistry.getService(m).then(function(p){return p.getKeywords(f,a,c)})})),h=0,i=0;i<k.length;i++)k[i].then(function(m){h++;
d=d.concat(m);h===k.length&&e.resolve(d)},function(m){h=-1;e.reject(m)});else e.resolve(d);return e},addProvider:function(f,a,c){this.contentAssistProviders=this.contentAssistProviders||[];this.contentAssistProviders.push({name:a,pattern:c,provider:f})}};return b}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/editor/contentAssist",["dojo","orion/textview/keyBinding"],function(){return orion.editor});orion=orion||{};orion.textview=orion.textview||{};
orion.textview.UndoStack=function(){function b(c,d){this.view=c;this.size=d!==undefined?d:100;this.reset();c.addEventListener("ModelChanging",this,this._onModelChanging);c.addEventListener("Destroy",this,this._onDestroy)}var f=function(){function c(d,e,k){this.offset=d;this.text=e;this.previousText=k}c.prototype={undo:function(d,e){this._doUndoRedo(this.offset,this.previousText,this.text,d,e)},redo:function(d,e){this._doUndoRedo(this.offset,this.text,this.previousText,d,e)},_doUndoRedo:function(d,
e,k,h,i){h.setText(e,d,d+k.length);i&&h.setSelection(d,d+e.length)}};return c}(),a=function(){function c(d,e){this.selection=d;this.caret=e;this.changes=[]}c.prototype={add:function(d){this.changes.push(d)},undo:function(d,e){for(var k=this.changes.length-1;k>=0;k--)this.changes[k].undo(d,false);if(e){e=this.selection.start;k=this.selection.end;d.setSelection(this.caret?e:k,this.caret?k:e)}},redo:function(d,e){for(var k=0;k<this.changes.length;k++)this.changes[k].redo(d,false);if(e){e=this.selection.start;
k=this.selection.end;d.setSelection(this.caret?e:k,this.caret?k:e)}}};return c}();b.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,d=this.stack.length;this._undoStart!==undefined&&c++;return{undo:c,redo:d-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 f(-this._undoStart,"",this._undoText,
"")):this.add(new f(this._undoStart,this._undoText,""));this._undoStart=undefined;this._undoText=""}},_onDestroy:function(){this.view.removeEventListener("ModelChanging",this,this._onModelChanging);this.view.removeEventListener("Destroy",this,this._onDestroy)},_onModelChanging:function(c){var d=c.text,e=c.start,k=c.removedCharCount;c=c.addedCharCount;if(!this._ignoreUndo){if(this._undoStart!==undefined&&!(c===1&&k===0&&e===this._undoStart+this._undoText.length||c===0&&k===1&&(e+1===-this._undoStart||
e===-this._undoStart)))this._commitUndo();if(!this.compoundChange)if(c===1&&k===0){if(this._undoStart===undefined)this._undoStart=e;this._undoText+=d;return}else if(c===0&&k===1){d=this._undoText.length>0&&-this._undoStart===e;this._undoStart=-e;if(d)this._undoText+=this.view.getText(e,e+k);else this._undoText=this.view.getText(e,e+k)+this._undoText;return}this.add(new f(e,d,this.view.getText(e,e+k)))}}};return b}();
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(b,f,a,c,d){var e={};e.EditorCommandFactory=function(){function k(h,i,m,p,t,y){this.serviceRegistry=h;this.commandService=i;this.fileClient=m;this.inputManager=p;this.toolbarId=t;this.isReadOnly=y}k.prototype={generateEditorCommands:function(h){function i(t){return c.KeyBinding.apply(this,t)}if(!this.isReadOnly){h.getTextView().setKeyBinding(new c.KeyBinding("s",
true),"Save");h.getTextView().setAction("Save",b.hitch(this,function(){var t=h.getTextView().getText();this.fileClient.write(this.inputManager.getInput(),t).then(b.hitch(this,function(){h.onInputChange(this.inputManager.getInput(),null,t,true);this.inputManager.afterSave&&this.inputManager.afterSave()}));return true}));this.commandService.addCommand(new f.Command({name:"Save",id:"orion.save",callback:function(t){t.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 f.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 m=this.serviceRegistry.getServiceReferences("orion.edit.command"),p=0;p<m.length;p++)this.serviceRegistry.getService(m[p]).then(b.hitch(this,
function(t){for(var y={},u=m[p].getPropertyNames(),s=0;s<u.length;s++)y[u[s]]=m[p].getProperty(u[s]);u=h.getTextView();s=new f.Command({name:y.name,image:y.img,id:y.name,callback:b.hitch(h,function(q){var x=q?q.getTextView():this.getTextView();q=x.getText();var w=x.getSelection();t.run(x.getText(w.start,w.end),q,w).then(function(g){if(g.text){x.setText(g.text);if(g.selection){x.setSelection(g.selection.start,g.selection.end);x.focus()}}else if(typeof g==="string"){x.setText(g,w.start,w.end);x.setSelection(w.start,
w.end);x.focus()}});return true})});this.commandService.addCommand(s,"dom");y.img?this.commandService.registerCommandContribution(s.id,p,this.toolbarId,"orion.editorActions.contributed.images"):this.commandService.registerCommandContribution(s.id,p,this.toolbarId,"orion.editorActions.contributed.noImages");a.generateDomCommandsInBanner(this.commandService,h);if(y.key){i.prototype=c.KeyBinding.prototype;u.setKeyBinding(new i(y.key),s.id);u.setAction(s.id,s.callback)}}))}}};return k}();e.UndoCommandFactory=
function(){function k(h,i,m){this.serviceRegistry=h;this.commandService=i;this.toolbarId=m}k.prototype={createUndoStack:function(h){var i=new d.UndoStack(h.getTextView(),200);h.getTextView().setKeyBinding(new c.KeyBinding("z",true),"Undo");h.getTextView().setAction("Undo",function(){i.undo();return true});this.commandService.addCommand(new f.Command({name:"Undo",id:"orion.undo",callback:function(p){p.getTextView().invokeAction("Undo")}}),"dom");var m=navigator.platform.indexOf("Mac")!==-1?new c.KeyBinding("z",
true,true):new c.KeyBinding("y",true);h.getTextView().setKeyBinding(m,"Redo");h.getTextView().setAction("Redo",function(){i.redo();return true});this.commandService.addCommand(new f.Command({name:"Redo",id:"orion.redo",callback:function(p){p.getTextView().invokeAction("Redo")}}),"dom");this.commandService.registerCommandContribution("orion.undo",400,this.toolbarId,"orion.editorActions.unlabeled",new f.CommandKeyBinding("z",true),true);this.commandService.registerCommandContribution("orion.redo",401,
this.toolbarId,"orion.editorActions.unlabeled",m,true);return i}};return k}();return e});orion=orion||{};orion.editor=orion.editor||{};
orion.editor.Editor=function(){function b(f){this._textViewFactory=f.textViewFactory;this._undoStackFactory=f.undoStackFactory;this._annotationFactory=f.annotationFactory;this._lineNumberRulerFactory=f.lineNumberRulerFactory;this._contentAssistFactory=f.contentAssistFactory;this._keyBindingFactory=f.keyBindingFactory;this._statusReporter=f.statusReporter;this._domNode=f.domNode;this._syntaxHighlightProviders=f.syntaxHighlightProviders;this._overviewRuler=this._annotationsRuler=null;this._dirty=false;
this._contentAssist=null;this._keyModes=[]}b.prototype={getTextView:function(){return this._textView},reportStatus:function(f,a){this._statusReporter?this._statusReporter(f,a):window.alert(a?"ERROR: "+f:f)},moveSelection:function(f,a,c){c=c||a;f.setSelection(a,c,false);c=f.getTopPixel();var d=f.getBottomPixel();a=f.getModel().getLineAtOffset(a);a=f.getLinePixel(a);if(a<c||a>d){d=Math.max(0,a-Math.floor((a<c?3:1)*(d-c)/4));(new dojo.Animation({node:f,duration:300,curve:[c,d],onAnimate:function(e){f.setTopPixel(Math.floor(e))},
onEnd:function(){f.showSelection();f.focus()}})).play()}else{f.showSelection();f.focus()}},getContents:function(){if(this._textView)return this._textView.getText()},isDirty:function(){return this._dirty},checkDirty:function(){var f=!this._undoStack.isClean();this._dirty!==f&&this.onDirtyChange(f)},getAnnotationsRuler:function(){return this._annotationsRuler},doFind:function(f,a,c,d){var e=this._textView.getText();if(c){f=f.toLowerCase();e=e.toLowerCase()}if(d){e=e.split("").reverse().join("");f=f.split("").reverse().join("");
a=e.length-a-1;a=e.indexOf(f,a);if(a!==-1)return{index:e.length-f.length-a,length:f.length}}else{a=e.indexOf(f,a);if(a!==-1)return{index:a,length:f.length}}return null},doFindRegExp:function(f,a,c,d){if(!f)return null;a=a||"";a+=(a.indexOf("g")===-1?"g":"")+(a.indexOf("m")===-1?"m":"");f=new RegExp(f,a);a=this._textView.getText();var e=null,k=null;if(d)for(;;)if((e=f.exec(a))&&e.index<=c)k={index:e.index,length:e[0].length};else return k;else return(e=f.exec(a.substring(c)))&&{index:e.index+c,length:e[0].length}},
parseRegExp:function(f){if(f=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(f))return{pattern:f[1],flags:f[2]};return null},installTextView:function(){function f(){var e=c.getModel(),k=c.getCaretOffset(),h=e.getLineAtOffset(k);e=e.getLineStart(h);k=k-e;for(e=0;e<this._keyModes.length;e++)if(this._keyModes[e].isActive())return;this.reportStatus("Line "+(h+1)+" : Col "+k)}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",dojo.hitch(this,function(){for(var e=0;e<this._keyModes.length;e++)if(this._keyModes[e].isActive())return this._keyModes[e].cancel();return false}));c.setAction("lineUp",dojo.hitch(this,
function(){for(var e=0;e<this._keyModes.length;e++)if(this._keyModes[e].isActive())return this._keyModes[e].lineUp();return false}));c.setAction("lineDown",dojo.hitch(this,function(){for(var e=0;e<this._keyModes.length;e++)if(this._keyModes[e].isActive())return this._keyModes[e].lineDown();return false}));c.addEventListener("ModelChanged",this,this.checkDirty);c.addEventListener("Selection",this,f);if(this._annotationFactory){var d=this._annotationFactory.createAnnotationRulers();this._annotationsRuler=
d.annotationRuler;this._annotationsRuler.onClick=function(e){if(e!==undefined)if(e!==-1){e=this.getAnnotation(e);e!==undefined&&a.onGotoLine(e.line,e.column)}};this._overviewRuler=d.overviewRuler;this._overviewRuler.onClick=function(e){e!==undefined&&a.moveSelection(c,c.getModel().getLineStart(e))};c.addRuler(this._annotationsRuler);c.addRuler(this._overviewRuler)}if(this._lineNumberRulerFactory){this._lineNumberRuler=this._lineNumberRulerFactory.createLineNumberRuler();c.addRuler(this._lineNumberRuler)}},
showSelection:function(f,a,c,d,e){if(typeof f==="number"){if(typeof a!=="number")a=f;this.moveSelection(this._textView,f,a)}else if(typeof c==="number"){f=this._textView.getModel().getLineStart(c-1);if(typeof d==="number")f+=d;if(typeof e!=="number")e=0;this.moveSelection(this._textView,f,f+e)}},onInputChange:function(f,a,c,d){if(d&&this._textView){this._undoStack.markClean();this.checkDirty()}else if(this._textView){if(a)this._textView.setText(a);else c!==null&&c!==undefined&&this._textView.setText(c);
this._undoStack.reset();this.checkDirty();this._textView.focus()}},onGotoLine:function(f,a,c){if(this._textView){var d=this._textView.getModel().getLineStart(f);if(typeof a==="string"){var e=this._textView.getModel().getLine(f).indexOf(a);if(e!==-1){c=e+a.length;a=e}else a=0}f=Math.min(this._textView.getModel().getLineEnd(f),a);if(c===undefined)c=f;this.moveSelection(this._textView,d+f,d+c)}},onDirtyChange:function(f){this._dirty=f}};return b}();
typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/editor/editor",["dojo","orion/textview/keyBinding"],function(){return orion.editor});orion=orion||{};orion.textview=orion.textview||{};
orion.textview.Ruler=function(){function b(f,a,c){this._location=f||"left";this._overview=a||"page";this._rulerStyle=c;this._view=null}b.prototype={setView:function(f){this._onModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this,this._onModelChanged);this._view=f;this._onModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this,this._onModelChanged)},getLocation:function(){return this._location},getOverview:function(){return this._overview}};return b}();
orion.textview.LineNumberRuler=function(){function b(f,a,c,d){orion.textview.Ruler.call(this,f,"page",a);this._oddStyle=c||{style:{backgroundColor:"white"}};this._evenStyle=d||{style:{backgroundColor:"white"}};this._numOfDigits=0}b.prototype=new orion.textview.Ruler;b.prototype.getStyle=function(f){return f===undefined?this._rulerStyle:f&1?this._oddStyle:this._evenStyle};b.prototype.getHTML=function(f){return f===-1?this._view.getModel().getLineCount():f+1};b.prototype._onModelChanged=function(f){f=
f.start;var a=this._view.getModel(),c=a.getLineCount(),d=(c+"").length;if(this._numOfDigits!==d){this._numOfDigits=d;this._view.redrawLines(a.getLineAtOffset(f),c,this)}};return b}();
orion.textview.AnnotationRuler=function(){function b(f,a,c){orion.textview.Ruler.call(this,f,"page",a);this._defaultAnnotation=c;this._annotations=[]}b.prototype=new orion.textview.Ruler;b.prototype.clearAnnotations=function(){this._annotations=[];var f=this._view.getModel().getLineCount();this._view.redrawLines(0,f,this);this._overviewRuler&&this._view.redrawLines(0,f,this._overviewRuler)};b.prototype.getAnnotation=function(f){return this._annotations[f]};b.prototype.getAnnotations=function(){return this._annotations};
b.prototype.getStyle=function(f){switch(f){case undefined:return this._rulerStyle;case -1:return this._defaultAnnotation?this._defaultAnnotation.style:null;default:return this._annotations[f]&&this._annotations[f].style?this._annotations[f].style:null}};b.prototype.getHTML=function(f){return f===-1?this._defaultAnnotation?this._defaultAnnotation.html:"":this._annotations[f]&&this._annotations[f].html?this._annotations[f].html:""};b.prototype.setAnnotation=function(f,a){if(f!==undefined){this._annotations[f]=
a;this._view.redrawLines(f,f+1,this);this._overviewRuler&&this._view.redrawLines(f,f+1,this._overviewRuler)}};b.prototype._onModelChanged=function(f){var a=f.start,c=f.removedLineCount;if(f=f.addedLineCount-c){var d=this._view.getModel();a=d.getLineAtOffset(a);var e=[],k=this._annotations,h=false;for(var i in k){var m=i>>>0;if(a<m&&m<a+c)h=true;else{var p=m;if(m>a){p+=f;h=true}e[p]=k[m]}}this._annotations=e;if(h){c=d.getLineCount();this._view.redrawLines(a,c,this);this._overviewRuler&&this._view.redrawLines(0,
c,this._overviewRuler)}}};return b}();
orion.textview.OverviewRuler=function(){function b(f,a,c){orion.textview.Ruler.call(this,f,"document",a);if(this._annotationRuler=c)c._overviewRuler=this}b.prototype=new orion.textview.Ruler;b.prototype.getAnnotations=function(){var f=this._annotationRuler.getAnnotations(),a=[];for(var c in f){var d=c>>>0;f[d]!==undefined&&a.push(d)}return a};b.prototype.getStyle=function(f){var a;if(f===undefined){f=this._rulerStyle||{};a=f.style||(f.style={});a.lineHeight="1px";a.fontSize="1px";a.width="14px"}else{f=
f!==-1?this._annotationRuler.getAnnotation(f).overviewStyle||{}:{};a=f.style||(f.style={});a.cursor="pointer";a.width="8px";a.height="3px";a.left="2px"}return f};b.prototype.getHTML=function(){return"&nbsp;"};b.prototype.onClick=function(f){f!==undefined&&this._view.setTopIndex(f)};return b}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/textview/rulers",[],function(){return orion.textview});orion=orion||{};orion.editor=orion.editor||{};
orion.editor.UndoFactory=function(){function b(){}b.prototype={createUndoStack:function(f){var a=new orion.textview.UndoStack(f.getTextView(),200);f.getTextView().setKeyBinding(new orion.textview.KeyBinding("z",true),"Undo");f.getTextView().setAction("Undo",function(){a.undo();return true});var c=navigator.platform.indexOf("Mac")!==-1;f.getTextView().setKeyBinding(c?new orion.textview.KeyBinding("z",true,true):new orion.textview.KeyBinding("y",true),"Redo");f.getTextView().setAction("Redo",function(){a.redo();
return true});return a}};return b}();orion.editor.LineNumberRulerFactory=function(){function b(){}b.prototype={createLineNumberRuler:function(){return new orion.textview.LineNumberRuler("left",{style:{backgroundColor:"#ffffff",textAlign:"right",borderLeft:"1px solid #ddd",borderRight:"1px solid #ddd"}},{style:{backgroundColor:"#ffffff"}},{style:{backgroundColor:"#ffffff"}})}};return b}();
orion.editor.AnnotationFactory=function(){function b(f){this.problemImageUrl=f}b.prototype={createAnnotationRulers:function(){var f={style:{backgroundColor:"#ffffff"}};this.annotationRuler=new orion.textview.AnnotationRuler("left",f,{html:"<img src='"+this.problemImageUrl+"'></img>"});this.overviewRuler=new orion.textview.OverviewRuler("right",f,this.annotationRuler);return{annotationRuler:this.annotationRuler,overviewRuler:this.overviewRuler}},showProblems:function(f){var a,c;f=f||[];f.length>0&&
f[f.length-1]===null&&f.pop();var d=this.annotationRuler;if(d){d.clearAnnotations();var e=-1;for(a in f)if(f[a]){c=f[a].reason.replace(/'/g,"&#39;").replace(/"/g,"&#34;");c={line:f[a].line-1,column:f[a].character,html:"<img src='"+this.problemImageUrl+"' title='"+c+"' alt='"+c+"'></img>",overviewStyle:{style:{backgroundColor:"lightcoral",border:"1px solid red"}}};if(e!==f[a].line){d.setAnnotation(f[a].line-1,c);e=f[a].line}}}}};return b}();
orion.editor.TextActions=function(){function b(f,a){this.editor=f;this.textView=f.getTextView();this.undoStack=a;this._incrementalFindActive=false;this._incrementalFindSuccess=true;this._incrementalFindIgnoreSelection=false;this._incrementalFindPrefix="";this.init()}b.prototype={init:function(){this._incrementalFindListener={onVerify:dojo.hitch(this,function(d){var e=this._incrementalFindPrefix,k=this.textView.getText(d.start,d.end);if((e=e.match(new RegExp("^"+dojo.regexp.escapeString(k),"i")))&&
e.length>0){e=this._incrementalFindPrefix+=d.text;this.editor.reportStatus("Incremental find: "+e);k=e.toLowerCase()===e;if(k=this.editor.doFind(e,this.textView.getSelection().start,k)){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;this.editor.moveSelection(this.textView,k.index,k.index+k.length);this._incrementalFindIgnoreSelection=false}else{this.editor.reportStatus("Incremental find: "+e+" (not found)",true);this._incrementalFindSuccess=false}d.text=null}}),onSelection:dojo.hitch(this,
function(){this._incrementalFindIgnoreSelection||this.toggleIncrementalFind()})};var f="",a,c;this.textView.setKeyBinding(new orion.textview.KeyBinding("f",true),"Find...");this.textView.setAction("Find...",dojo.hitch(this,function(){setTimeout(dojo.hitch(this,function(){var d=this.textView.getSelection();f=d.end>d.start?this.textView.getText().substring(d.start,d.end):"";if(f=prompt("Enter search term or /regex/:",f)){d=f.toLowerCase()===f;var e=this.editor.parseRegExp(f);if(e){a=e.pattern;c=e.flags;
c+=d&&c.indexOf("i")===-1?"i":"";d=this.editor.doFindRegExp(a,c,this.textView.getCaretOffset())}else{c=a=null;d=this.editor.doFind(f,this.textView.getCaretOffset(),d)}d?this.editor.moveSelection(this.textView,d.index,d.index+d.length):this.editor.reportStatus("not found",true)}}),0);return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding("k",true),"Find Next Occurrence");this.textView.setAction("Find Next Occurrence",dojo.hitch(this,function(){var d;if(this._incrementalFindActive){var e=
this._incrementalFindPrefix;d=e.toLowerCase()===e;d=this.editor.doFind(e,this.textView.getCaretOffset(),d)}else if(a)d=this.editor.doFindRegExp(a,c,this.textView.getCaretOffset());else{d=this.textView.getSelection();if(d.end>d.start)f=this.textView.getText().substring(d.start,d.end);d=this.editor.doFind(f,this.textView.getCaretOffset(),true)}if(d){this._incrementalFindIgnoreSelection=true;this.editor.moveSelection(this.textView,d.index,d.index+d.length);this._incrementalFindIgnoreSelection=false}else this.editor.reportStatus("not found",
true);return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding("k",true,true),"Find Previous Occurrence");this.textView.setAction("Find Previous Occurrence",dojo.hitch(this,function(){var d=this.textView.getSelection(),e=d.end>d.start?d.end-d.start:0;if(this._incrementalFindActive){var k=this._incrementalFindPrefix;d=k.toLowerCase()===k;e=this.editor.doFind(k,this.textView.getCaretOffset()-e-1,d,true)}else if(a)e=this.editor.doFindRegExp(a,c,this.textView.getCaretOffset()-e-1,true);
else{if(e>0)f=this.textView.getText().substring(d.start,d.end);e=this.editor.doFind(f,this.textView.getCaretOffset()-e-1,true,true)}if(e){this._incrementalFindIgnoreSelection=true;this.editor.moveSelection(this.textView,e.index,e.index+e.length);this._incrementalFindIgnoreSelection=false}else this.editor.reportStatus("not found",true);return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding("j",true),"Incremental Find");this.textView.setAction("Incremental Find",dojo.hitch(this,function(){if(this._incrementalFindActive){var d=
this._incrementalFindPrefix;if(d.length!==0){var e=this.textView.getSelection().start+1;if(this._incrementalFindSuccess===false)e=0;var k=d.toLowerCase()===d;if(e=this.editor.doFind(d,e,k)){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;this.editor.moveSelection(this.textView,e.index,e.index+e.length);this._incrementalFindIgnoreSelection=false;this.editor.reportStatus("Incremental find: "+d)}else{this.editor.reportStatus("Incremental find: "+d+" (not found)",true);this._incrementalFindSuccess=
false}}}else{this.textView.setCaretOffset(this.textView.getCaretOffset());this.toggleIncrementalFind()}return true}));this.textView.setAction("deletePrevious",dojo.hitch(this,function(){if(this._incrementalFindActive){var d=this._incrementalFindPrefix;d=this._incrementalFindPrefix=d.substring(0,d.length-1);if(d.length===0){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;this.textView.setCaretOffset(this.textView.getSelection().start);this._incrementalFindIgnoreSelection=false;
this.toggleIncrementalFind();return true}this.editor.reportStatus("Incremental find: "+d);var e=this.textView.getText().lastIndexOf(d,this.textView.getCaretOffset()-d.length-1);if(e!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;this.editor.moveSelection(this.textView,e,e+d.length);this._incrementalFindIgnoreSelection=false}else this.editor.reportStatus("Incremental find: "+d+" (not found)",true);return true}else return false}));this.textView.setAction("tab",dojo.hitch(this,
function(){var d=this.textView.getSelection(),e=this.textView.getModel(),k=e.getLineAtOffset(d.start),h=e.getLineAtOffset(d.end>d.start?d.end-1:d.end);if(k!==h){var i=[];i.push("");for(var m=k;m<=h;m++)i.push(e.getLine(m,true));this.startUndo();m=e.getLineStart(k);this.textView.setText(i.join("\t"),m,e.getLineEnd(h,true));this.textView.setSelection(m===d.start?d.start:d.start+1,d.end+(h-k+1));this.endUndo();return true}return false}));this.textView.setKeyBinding(new orion.textview.KeyBinding(9,false,
true),"Unindent Lines");this.textView.setAction("Unindent Lines",dojo.hitch(this,function(){for(var d=this.textView.getSelection(),e=this.textView.getModel(),k=e.getLineAtOffset(d.start),h=e.getLineAtOffset(d.end>d.start?d.end-1:d.end),i=[],m=k;m<=h;m++){var p=e.getLine(m,true);if(p.indexOf("\t")!==0)return false;i.push(p.substring(1))}this.startUndo();m=e.getLineStart(k);p=e.getLineStart(h);this.textView.setText(i.join(""),m,e.getLineEnd(h,true));this.textView.setSelection(m===d.start?d.start:d.start-
1,d.end-(h-k+1)+(d.end===p+1?1:0));this.endUndo();return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding(38,false,false,true),"Move Lines Up");this.textView.setAction("Move Lines Up",dojo.hitch(this,function(){var d=this.textView.getSelection(),e=this.textView.getModel(),k=e.getLineAtOffset(d.start);if(k===0)return true;this.startUndo();var h=e.getLineAtOffset(d.end>d.start?d.end-1:d.end);d=e.getLineCount()-1===h;var i=e.getLineStart(k);h=d?e.getCharCount():e.getLineStart(h+1);if(d){i=
e.getLineEnd(k-1);var m=e.getLineEnd(k-1,true),p=e.getText(i,m);i=i;e.setText(e.getText(m,h)+p,i,h)}m=e.getText(i,h);e.setText("",i,h);k=e.getLineStart(k-1);e.setText(m,k,k);e=k+m.length-(d?e.getLineDelimiter().length:0);this.textView.setSelection(k,e);this.endUndo();return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding(40,false,false,true),"Move Lines Down");this.textView.setAction("Move Lines Down",dojo.hitch(this,function(){var d=this.textView.getSelection(),e=this.textView.getModel(),
k=e.getLineAtOffset(d.start),h=e.getLineAtOffset(d.end>d.start?d.end-1:d.end);if(h===e.getLineCount()-1)return true;this.startUndo();d=h===e.getLineCount()-2;k=e.getLineStart(k);var i=e.getLineStart(h+1);if(d){var m=e.getLineStart(h+1)-e.getLineDelimiter().length,p=e.getLineStart(h+1);p=e.getText(m,p);e.setText(p+e.getText(k,m),k,i)}m=e.getText(k,i);h=(d?e.getCharCount():e.getLineStart(h+2))-(i-k);e.setText("",k,i);e.setText(m,h,h);this.textView.setSelection(h+(d?e.getLineDelimiter().length:0),h+
m.length);this.endUndo();return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding(38,true,false,true),"Copy Lines Up");this.textView.setAction("Copy Lines Up",dojo.hitch(this,function(){this.startUndo();var d=this.textView.getSelection(),e=this.textView.getModel(),k=e.getLineDelimiter(),h=e.getLineAtOffset(d.start),i=e.getLineAtOffset(d.end>d.start?d.end-1:d.end);h=e.getLineStart(h);i=(d=e.getLineCount()-1===i)?e.getCharCount():e.getLineStart(i+1);i=e.getText(h,i)+(d?k:"");e.setText(i,
h,h);this.textView.setSelection(h,h+i.length-(d?k.length:0));this.endUndo();return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding(40,true,false,true),"Copy Lines Down");this.textView.setAction("Copy Lines Down",dojo.hitch(this,function(){this.startUndo();var d=this.textView.getSelection(),e=this.textView.getModel(),k=e.getLineDelimiter(),h=e.getLineAtOffset(d.start);d=e.getLineAtOffset(d.end>d.start?d.end-1:d.end);var i=e.getLineStart(h);d=(h=e.getLineCount()-1===d)?e.getCharCount():
e.getLineStart(d+1);i=(h?k:"")+e.getText(i,d);e.setText(i,d,d);this.textView.setSelection(d+(h?k.length:0),d+i.length);this.endUndo();return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding("d",true,false,false),"Delete Selected Lines");this.textView.setAction("Delete Selected Lines",dojo.hitch(this,function(){this.startUndo();var d=this.textView.getSelection(),e=this.textView.getModel(),k=e.getLineAtOffset(d.start);d=e.getLineAtOffset(d.end>d.start?d.end-1:d.end);k=e.getLineStart(k);
d=e.getLineCount()-1===d?e.getCharCount():e.getLineStart(d+1);e.setText("",k,d);this.endUndo();return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding("l",true),"Goto Line...");this.textView.setAction("Goto Line...",dojo.hitch(this,function(){var d=this.textView.getModel().getLineAtOffset(this.textView.getCaretOffset());if(d=prompt("Go to line:",d+1)){d=parseInt(d,10);this.editor.onGotoLine(d-1,0)}return true}))},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},lineUp:function(){var f;if(this._incrementalFindActive){var a=this._incrementalFindPrefix;f=this.textView.getCaretOffset()-a.length-1;if(this._incrementalFindSuccess===false)f=this.textView.getModel().getCharCount()-1;f=this.textView.getText().lastIndexOf(a,
f);if(f!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;this.editor.moveSelection(this.textView,f,f+a.length);this._incrementalFindIgnoreSelection=false}else{this.editor.reportStatus("Incremental find: "+a+" (not found)",true);this._incrementalFindSuccess=false}return true}return false},lineDown:function(){var f;if(this._incrementalFindActive){var a=this._incrementalFindPrefix;if(a.length===0)return;f=this.textView.getSelection().start+1;if(this._incrementalFindSuccess===
false)f=0;f=this.textView.getText().indexOf(a,f);if(f!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;this.editor.moveSelection(this.textView,f,f+a.length);this._incrementalFindIgnoreSelection=false;this.editor.reportStatus("Incremental find: "+a)}else{this.editor.reportStatus("Incremental find: "+a+" (not found)",true);this._incrementalFindSuccess=false}return true}return false},enter:function(){return false}};return b}();
orion.editor.SourceCodeActions=function(){function b(f,a,c){this.editor=f;this.textView=f.getTextView();this.undoStack=a;this.contentAssist=c;this.init()}b.prototype={startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},init:function(){function f(a,c,d){var e=a.getLineAtOffset(c),k=a.getLineAtOffset(d),h,i,m,p,t,y;for(h=e;h>=0;h--){i=a.getLine(h);m=h===e?c-a.getLineStart(e):i.length;p=i.lastIndexOf("/*",m);
i=i.lastIndexOf("*/",m);if(i>p)break;else if(p!==-1){t=a.getLineStart(h)+p;break}}for(h=k;h<a.getLineCount();h++){i=a.getLine(h);m=h===k?d-a.getLineStart(k):0;p=i.indexOf("/*",m);i=i.indexOf("*/",m);if(p!==-1&&p<i)break;else if(i!==-1){y=a.getLineStart(h)+i;break}}return{commentStart:t,commentEnd:y}}this.textView.setKeyBinding(new orion.textview.KeyBinding(191,true),"Toggle Line Comment");this.textView.setAction("Toggle Line Comment",dojo.hitch(this,function(){this.startUndo();for(var a=this.textView.getSelection(),
c=this.textView.getModel(),d=c.getLineAtOffset(a.start),e=c.getLineAtOffset(a.end>a.start?a.end-1:a.end),k=true,h,i=d;i<=e&&k;i++){h=this.textView.getModel().getLine(i);var m=h.indexOf("//");if(m===-1)k=false;else if(m!==0){for(k=0;k<m;k++){var p=h.charCodeAt(k);if(!(p===32||p===9))break}k=k===m}}i=[];m=c.getLineStart(d);if(k){p=c.getLineStart(e);for(k=d;k<=e;k++){var t=c.getLine(k,true),y=h.indexOf("//");i.push(t.substring(0,y)+t.substring(y+2))}this.textView.setText(i.join(""),m,c.getLineEnd(e,
true));this.textView.setSelection(m===a.start?a.start:a.start-2,a.end-2*(e-d+1)+(a.end===p+1?2:0))}else{i.push("");for(k=d;k<=e;k++)i.push(c.getLine(k,true));this.textView.setText(i.join("//"),m,c.getLineEnd(e,true));this.textView.setSelection(m===a.start?a.start:a.start+2,a.end+2*(e-d+1))}this.endUndo();return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding(191,true,true),"Add Block Comment");this.textView.setAction("Add Block Comment",dojo.hitch(this,function(){var a=this.textView.getSelection(),
c=this.textView.getModel(),d=new RegExp("/\\*|\\*/","g");c.getLineAtOffset(a.start);c.getLineAtOffset(a.end);var e=f(c,a.start,a.end);if(e.commentStart!==undefined&&e.commentEnd!==undefined)return true;e=c.getText(a.start,a.end);if(e.length===0)return true;var k=e.length;e=e.replace(d,"");d=e.length;this.startUndo();c.setText("/*"+e+"*/",a.start,a.end);this.textView.setSelection(a.start+2,a.end+2+(d-k));this.endUndo();return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding(220,true,
true),"Remove Block Comment");this.textView.setAction("Remove Block Comment",dojo.hitch(this,function(){var a=this.textView.getSelection(),c=this.textView.getModel();c.getLineAtOffset(a.start);c.getLineAtOffset(a.end);var d=c.getText(a.start,a.end),e,k,h;for(h=0;h<d.length;h++)if(d.substring(h,h+2)==="/*"){e=a.start+h;break}for(;h<d.length;h++)if(d.substring(h,h+2)==="*/"){k=a.start+h;break}this.startUndo();if(e!==undefined&&k!==undefined){c.setText(c.getText(e+2,k),e,k+2);this.textView.setSelection(e,
k)}else{d=f(c,a.start,a.end);if(d.commentStart===undefined||d.commentEnd===undefined)return true;e=c.getText(d.commentStart+2,d.commentEnd);c.setText(e,d.commentStart,d.commentEnd+2);this.textView.setSelection(a.start-2,a.end-2)}this.endUndo();return true}));this.textView.setAction("enter",dojo.hitch(this,function(){if(this.contentAssist&&this.contentAssist.isActive())return this.contentAssist.enter();var a=this.textView.getSelection();if(a.start===a.end){var c=this.textView.getModel(),d=c.getLineAtOffset(a.start),
e=c.getLine(d),k=c.getLineStart(d);d=0;k=a.start-k;for(var h;d<k&&((h=e.charCodeAt(d))===32||h===9);)d++;if(d>0){var i=e.substring(0,d);for(d=k;d<e.length&&((h=e.charCodeAt(d++))===32||h===9);)a.end++;this.textView.setText(c.getLineDelimiter()+i,a.start,a.end);return true}}return false}))},cancel:function(){return false},isActive:function(){return false},lineUp:function(){return false},lineDown:function(){return false},enter:function(){return false}};return b}();
typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/editor/editorFeatures",["dojo","orion/textview/undoStack","orion/textview/keyBinding","orion/textview/rulers"],function(){return orion.editor});
define("orion/breadcrumbs",["dojo"],function(b){function f(a){this._init(a)}f.prototype={_init:function(a){var c=a.container;if(typeof c==="string")c=b.byId(c);if(!c)throw"no parent container";this._container=c;b.removeClass(c,"currentLocation");this._id=a.id||"eclipse.breadcrumbs";this._resource=a.resource||null;this._firstSegmentName=a.firstSegmentName;this._makeHref=a.makeHref;this.path="";this.render()},getNavigatorRootSegment:function(){if(this._firstSegmentName){var a=document.createElement("a");
b.place(document.createTextNode(this._firstSegmentName),a,"only");a.href="/navigate/table.html#";return a}return null},render:function(){var a=this._container,c=b.byId(this._id);if(c)b.empty(c);else{c=document.createElement("span");c.id=this._id;a.appendChild(c)}var d;if(d=this.getNavigatorRootSegment()){b.addClass(d,"breadcrumb");c.appendChild(d);if(this._resource&&this._resource.Parents){d=document.createElement("span");b.place(document.createTextNode(" / "),d,"only");this.path+="/";b.addClass(d,
"breadcrumb");c.appendChild(d)}else{d.href="";b.removeClass(d,"breadcrumb");b.addClass(d,"currentLocation")}}if(this._resource&&this._resource.Parents){a=this._resource.Parents;for(var e=a.length;--e>=0;){d=document.createElement("a");b.addClass(d,"breadcrumb");b.place(document.createTextNode(a[e].Name),d,"only");this.path+=a[e].Name;if(this._makeHref)this._makeHref(d,a[e].ChildrenLocation);else d.href="/navigate/table.html#"+a[e].ChildrenLocation;c.appendChild(d);d=document.createElement("span");
b.place(document.createTextNode(" / "),d,"only");this.path+="/";b.addClass(d,"breadcrumb");c.appendChild(d)}if(this._resource){d=document.createElement("a");b.place(document.createTextNode(this._resource.Name),d,"only");b.addClass(d,"breadcrumb");b.addClass(d,"currentLocation");this.path+=this._resource.Name;c.appendChild(d)}}if(c.childNodes.length===0){d=document.createElement("a");b.place(document.createTextNode(document.title),d,"only");b.addClass(d,"breadcrumb");b.addClass(d,"currentLocation");
c.appendChild(d)}}};f.prototype.constructor=f;return{BreadCrumbs:f}});
define("orion/compare/gap-model",[],function(){var b=b||{};b.GapTextModel=function(){function f(a,c,d){this._model=a;this._myIndex=(this._isOriginal=c===undefined?true:c)?1:0;this._reverseIndex=1-this._myIndex;this._map=d;this._listeners=[];a.addListener(this);this._init()}navigator.platform.indexOf("Win");f.prototype={_init:function(){this._generateGapBlocks()},_generateGapBlocks:function(){this._gapBlocks=[];for(var a=this._gapNumber=0,c=0;c<this._map.length;c++){if(this._map[c][this._myIndex]<
this._map[c][this._reverseIndex]){var d=this._map[c][this._reverseIndex]-this._map[c][this._myIndex];this._gapNumber+=d;this._gapBlocks.push([a+this._map[c][this._myIndex],d])}a+=Math.max(this._map[c][this._reverseIndex],this._map[c][this._myIndex])}},lookUpRealIndex:function(a){for(var c=0,d=0;d<this._gapBlocks.length;d++){var e=this._gapBlocks[d][0],k=this._gapBlocks[d][0]+this._gapBlocks[d][1]-1;if(a<e)break;if(a>=e&&a<=k)return{lineIndex:-1,gapsBefore:c+a-e};c+=this._gapBlocks[d][1]}return{lineIndex:a-
c,gapsBefore:c}},getLineType:function(a){for(var c=0,d=0;d<this._map.length;d++){var e=Math.max(this._map[d][this._reverseIndex],this._map[d][this._myIndex]);if(a>=c&&a<c+e){if(this._map[d][2]===0)return"unchnaged";else if(this._map[d][2]<0)return"removed";else if(this._map[d][1]===0)return"added";else if(a<this._map[d][this._myIndex]+c)return"changed";return"changed_gap"}c+=Math.max(this._map[d][this._reverseIndex],this._map[d][this._myIndex])}return"unchnaged"},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(){var a=this._model.getCharCount();a+=this._gapNumber*this.getLineDelimiter().length;return a},getLine:function(a,c){var d=this.getLineCount();if(!(0<=a&&a<d))return null;a=this.lookUpRealIndex(a);if(a.lineIndex<0){if(c)return this.getLineDelimiter();return""}else return this._model.getLine(a.lineIndex,c)},getLineAtOffset:function(a){if(!(0<=a&&
a<=this.getCharCount()))return-1;for(var c=this.getLineCount(),d=0,e=0;d<c;){var k=this.lookUpRealIndex(d);e+=k.lineIndex<0?this.getLineDelimiter().length:this._model.getLine(k.lineIndex,true).length;d++;if(e>a)break}return d-1},getLineCount:function(){return this._model.getLineCount()+this._gapNumber},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(a,c){var d=this.getLineCount();if(!(0<=a&&a<d))return-1;var e=this.lookUpRealIndex(a);d=e.gapsBefore*this.getLineDelimiter().length;
if(e.lineIndex<0){a=a-e.gapsBefore;if(a>0)d+=this._model.getLineEnd(a-1,true);if(c)d+=this.getLineDelimiter().length}else d+=this._model.getLineEnd(e.lineIndex,c);return d},getLineStart:function(a){if(!(0<=a&&a<this.getLineCount()))return-1;var c=this.lookUpRealIndex(a),d=0,e=-1;if(c.lineIndex<0){d=c.gapsBefore;if(a-d>=0)e=a-d-1}else{d=c.gapsBefore;e=c.lineIndex}a=0;a+=this.getLineDelimiter().length*d;if(e>=0)a+=c.lineIndex<0?this._model.getLineEnd(e,true):this._model.getLineStart(e);return a},getText:function(a,
c){return this._model.getText(a,c)},onChanging:function(a,c,d,e,k,h){for(var i=0;i<this._listeners.length;i++){var m=this._listeners[i];m&&m.onChanging&&m.onChanging(a,c,d,e,k,h)}},onChanged:function(a,c,d,e,k){for(var h=0;h<this._listeners.length;h++){var i=this._listeners[h];i&&i.onChanged&&i.onChanged(a,c,d,e,k)}},setText:function(a,c,d){this._model.setText(a,c,d)}};return f}();return b});orion=orion||{};orion.textview=orion.textview||{};
orion.textview.TextModel=function(){function b(a,c){this._listeners=[];this._lineDelimiter=c?c:f?"\r\n":"\n";this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(a)}var f=window.navigator.platform.indexOf("Win")!==-1;b.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 d=this.getLineCount();if(!(0<=a&&a<d))return null;var e=this._lineOffsets[a];if(a+1<d){a=this.getText(e,this._lineOffsets[a+1]);if(c)return a;c=a.length;for(var k;(k=a.charCodeAt(c-1))===10||k===13;)c--;return a.substring(0,c)}else return this.getText(e)},getLineAtOffset:function(a){if(!(0<=a&&a<=this.getCharCount()))return-1;var c=this.getLineCount(),d=this.getCharCount();if(a===d)return c-1;var e,k,h=this._lastLineIndex;if(0<=h&&h<c){e=this._lineOffsets[h];k=
h+1<c?this._lineOffsets[h+1]:d;if(e<=a&&a<k)return h}for(var i=c,m=-1;i-m>1;){h=Math.floor((i+m)/2);e=this._lineOffsets[h];k=h+1<c?this._lineOffsets[h+1]:d;if(a<=e)i=h;else if(a<k){i=h;break}else m=h}return this._lastLineIndex=i},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(a,c){var d=this.getLineCount();if(!(0<=a&&a<d))return-1;if(a+1<d){d=this._lineOffsets[a+1];if(c)return d;a=this.getText(Math.max(this._lineOffsets[a],
d-2),d);c=a.length;for(var e;(e=a.charCodeAt(c-1))===10||e===13;)c--;return d-(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();for(var d=0,e=0,k;e<this._text.length;){k=this._text[e].length;if(a<=d+k)break;d+=k;e++}for(var h=d,i=e;e<this._text.length;){k=this._text[e].length;if(c<=d+k)break;d+=k;e++}d=d;e=e;if(i===e)return this._text[i].substring(a-
h,c-d);a=this._text[i].substring(a-h);c=this._text[e].substring(0,c-d);return a+this._text.slice(i+1,e).join("")+c},onChanging:function(a,c,d,e,k,h){for(var i=0;i<this._listeners.length;i++){var m=this._listeners[i];m&&m.onChanging&&m.onChanging(a,c,d,e,k,h)}},onChanged:function(a,c,d,e,k){for(var h=0;h<this._listeners.length;h++){var i=this._listeners[h];i&&i.onChanged&&i.onChanged(a,c,d,e,k)}},setText:function(a,c,d){if(a===undefined)a="";if(c===undefined)c=0;if(d===undefined)d=this.getCharCount();
for(var e=this.getLineAtOffset(c),k=this.getLineAtOffset(d),h=c,i=d-c,m=k-e,p=a.length,t=0,y=this.getLineCount(),u=0,s=0,q=0,x=[];;){if(u!==-1&&u<=q)u=a.indexOf("\r",q);if(s!==-1&&s<=q)s=a.indexOf("\n",q);if(s===-1&&u===-1)break;q=u!==-1&&s!==-1?u+1===s?s+1:(u<s?u:s)+1:u!==-1?u+1:s+1;x.push(c+q);t++}this.onChanging(a,h,i,p,m,t);if(x.length===0){u=this.getLineStart(e);k=k+1<y?this.getLineStart(k+1):this.getCharCount();if(c!==u){a=this.getText(u,c)+a;c=u}if(d!==k){a+=this.getText(d,k);d=k}}k=p-i;for(u=
e+m+1;u<y;u++)this._lineOffsets[u]+=k;e=[e+1,m].concat(x);Array.prototype.splice.apply(this._lineOffsets,e);for(k=x=0;k<this._text.length;){u=this._text[k].length;if(c<=x+u)break;x+=u;k++}y=x;for(e=k;k<this._text.length;){u=this._text[k].length;if(d<=x+u)break;x+=u;k++}x=x;k=k;u=this._text[k];c=this._text[e].substring(0,c-y);d=u.substring(d-x);e=[e,k-e+1];c&&e.push(c);a&&e.push(a);d&&e.push(d);Array.prototype.splice.apply(this._text,e);if(this._text.length===0)this._text=[""];this.onChanged(h,i,p,
m,t)}};return b}();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 b(g,j,l,n){typeof g.addEventListener==="function"?g.addEventListener(j,l,n===true):g.attachEvent("on"+j,l)}function f(g,j,l,n){typeof g.removeEventListener==="function"?g.removeEventListener(j,l,n===true):g.detachEvent("on"+j,l)}function a(g){this._init(g)}var c=document.selection&&window.ActiveXObject&&/MSIE/.test(navigator.userAgent)?document.documentMode:undefined,d=parseFloat(navigator.userAgent.split("Firefox/")[1]||navigator.userAgent.split("Minefield/")[1])||
undefined,e=navigator.userAgent.indexOf("Opera")!==-1,k=navigator.userAgent.indexOf("Chrome")!==-1,h=navigator.userAgent.indexOf("Safari")!==-1,i=navigator.userAgent.indexOf("WebKit")!==-1,m=navigator.userAgent.indexOf("iPad")!==-1,p=navigator.platform.indexOf("Mac")!==-1,t=navigator.platform.indexOf("Win")!==-1,y=navigator.platform.indexOf("Linux")!==-1,u=typeof window.document.documentElement.addEventListener==="function",s=(!c||c>=9)&&typeof window.document.createRange().getBoundingClientRect===
"function",q=t?"\r\n":"\n",x=function(){function g(j,l,n){this.start=j;this.end=l;this.caret=n}g.prototype={clone:function(){return new g(this.start,this.end,this.caret)},collapse:function(){if(this.caret)this.end=this.start;else this.start=this.end},extend:function(j){if(this.caret)this.start=j;else this.end=j;if(this.start>this.end){j=this.start;this.start=this.end;this.end=j;this.caret=!this.caret}},setCaret:function(j){this.end=this.start=j;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(j){return this.caret===j.caret&&this.start===j.start&&this.end===j.end}};return g}(),w=function(){function g(){this._listeners={}}g.prototype={addEventListener:function(j,l,n,o){this._listeners[j]||(this._listeners[j]=[]);this._listeners[j].push({context:l,func:n,data:o})},sendEvent:function(j,l){if(j=
this._listeners[j])for(var n=0,o=j.length;n<o;n++){var r=j[n];r&&r.context&&r.func&&r.func.call(r.context,l,r.data)}},removeEventListener:function(j,l,n,o){if(j=this._listeners[j])for(var r=0,v=j.length;r<v;r++){var z=j[r];if(z.context===l&&z.func===n&&z.data===o){j.splice(r,1);break}}}};return g}();a.prototype={addEventListener:function(g,j,l,n){this._eventTable.addEventListener(g,j,l,n)},addRuler:function(g){var j=this._frameDocument,l=j.body,n=g.getLocation(),o=n==="left"?this._leftDiv:this._rightDiv;
if(!o){o=j.createElement("DIV");o.style.overflow="hidden";o.style.MozUserSelect="none";o.style.WebkitUserSelect="none";c&&o.attachEvent("onselectstart",function(){return false});o.style.position="absolute";o.style.top="0px";o.style.cursor="default";l.appendChild(o);if(n==="left"){this._leftDiv=o;o.className="viewLeftRuler"}else{this._rightDiv=o;o.className="viewRightRuler"}l=j.createElement("TABLE");o.appendChild(l);l.cellPadding="0px";l.cellSpacing="0px";l.border="0px";l.insertRow(0);var r=this;
b(o,"click",function(v){r._handleRulerEvent(v)});b(o,"dblclick",function(v){r._handleRulerEvent(v)})}j=j.createElement("DIV");j._ruler=g;j.rulerChanged=true;j.style.position="relative";o=o.firstChild.rows[0];o=o.insertCell(o.cells.length);o.vAlign="top";o.appendChild(j);g.setView(this);this._updatePage()},convert:function(g,j,l){var n=this._getScroll(),o=this._getViewPadding(),r=this._frame.getBoundingClientRect(),v=this._viewDiv.getBoundingClientRect();switch(j){case "document":if(g.x!==undefined)g.x+=
-n.x+v.left+o.left;if(g.y!==undefined)g.y+=-n.y+v.top+o.top;break;case "page":if(g.x!==undefined)g.x+=-r.left;if(g.y!==undefined)g.y+=-r.top;break}switch(l){case "document":if(g.x!==undefined)g.x+=n.x-v.left-o.left;if(g.y!==undefined)g.y+=n.y-v.top-o.top;break;case "page":if(g.x!==undefined)g.x+=r.left;if(g.y!==undefined)g.y+=r.top;break}},destroy:function(){this._setGrab(null);this._unhookEvents();var g=function(j){if(j){j=j.firstChild.rows[0].cells;for(var l=0;l<j.length;l++)j[l].firstChild._ruler.setView(null)}};
g(this._leftDiv);g(this._rightDiv);if(this._autoScrollTimerID){clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=null}if(this._updateTimer){clearTimeout(this._updateTimer);this._updateTimer=null}g=this._parent;g.removeChild(this._frame);if(m){g.removeChild(this._touchDiv);this._textArea=this._selDiv3=this._selDiv2=this._selDiv1=this._touchDiv=null}this.onDestroy({});this._actions=this._keyBindings=this._overlayDiv=this._clientDiv=this._viewDiv=this._scrollDiv=this._frameWindow=this._frameDocument=
this._frame=this._eventTable=this._doubleClickSelection=this._selection=this._model=this._parentDocument=this._parent=null},focus:function(){this._updateDOMSelection();if(m)this._textArea.focus();else{e&&this._clientDiv.blur();this._clientDiv.focus()}this._updateDOMSelection()},getActions:function(g){for(var j=[],l=this._actions,n=0;n<l.length;n++)!g&&l[n].defaultHandler||j.push(l[n].name);return j},getBottomIndex:function(g){return this._getBottomIndex(g)},getBottomPixel:function(){return this._getScroll().y+
this._getClientHeight()},getCaretOffset:function(){return this._getSelection().getCaret()},getClientArea:function(){var g=this._getScroll();return{x:g.x,y:g.y,width:this._getClientWidth(),height:this._getClientHeight()}},getHorizontalPixel:function(){return this._getScroll().x},getKeyBindings:function(g){for(var j=[],l=this._keyBindings,n=0;n<l.length;n++)l[n].name===g&&j.push(l[n].keyBinding);return j},getLineHeight:function(){return this._getLineHeight()},getLinePixel:function(g){g=Math.min(Math.max(0,
g),this._model.getLineCount());return this._getLineHeight()*g},getLocationAtOffset:function(g){var j=this._model;g=Math.min(Math.max(0,g),j.getCharCount());j=j.getLineAtOffset(g);var l=this._getScroll(),n=this._viewDiv.getBoundingClientRect(),o=this._getViewPadding();g=this._getOffsetToX(g)+l.x-n.left-o.left;j=this.getLinePixel(j);return{x:g,y:j}},getModel:function(){return this._model},getOffsetAtLocation:function(g,j){var l=this._getScroll(),n=this._viewDiv.getBoundingClientRect(),o=this._getViewPadding();
j=this._getYToLine(j-l.y);g+=-l.x+n.left+o.left;return this._getXToOffset(j,g)},getSelection:function(){var g=this._getSelection();return{start:g.start,end:g.end}},getText:function(g,j){return this._model.getText(g,j)},getTopIndex:function(g){return this._getTopIndex(g)},getTopPixel:function(){return this._getScroll().y},invokeAction:function(g,j){for(var l=this._actions,n=0;n<l.length;n++){var o=l[n];if(o.name&&o.name===g){if(!j&&o.userHandler)if(o.userHandler())return;if(o.defaultHandler)return o.defaultHandler();
return false}}return false},onContextMenu:function(g){this._eventTable.sendEvent("ContextMenu",g)},onDestroy:function(g){this._eventTable.sendEvent("Destroy",g)},onLineStyle:function(g){this._eventTable.sendEvent("LineStyle",g)},onModelChanged:function(g){this._eventTable.sendEvent("ModelChanged",g)},onModelChanging:function(g){this._eventTable.sendEvent("ModelChanging",g)},onModify:function(g){this._eventTable.sendEvent("Modify",g)},onSelection:function(g){this._eventTable.sendEvent("Selection",
g)},onScroll:function(g){this._eventTable.sendEvent("Scroll",g)},onVerify:function(g){this._eventTable.sendEvent("Verify",g)},redrawLines:function(g,j,l){if(g===undefined)g=0;if(j===undefined)j=this._model.getLineCount();if(g!==j){var n=this._clientDiv;if(l)for(var o=(l.getLocation()==="left"?this._leftDiv:this._rightDiv).firstChild.rows[0].cells,r=0;r<o.length;r++)if(o[r].firstChild._ruler===l){n=o[r].firstChild;break}if(l)n.rulerChanged=true;if(!l||l.getOverview()==="page")for(n=n.firstChild;n;){o=
n.lineIndex;if(g<=o&&o<j)n.lineChanged=true;n=n.nextSibling}if(!l)if(g<=this._maxLineIndex&&this._maxLineIndex<j){this._maxLineIndex=-1;this._maxLineWidth=0}this._queueUpdatePage()}},redrawRange:function(g,j){var l=this._model;if(g===undefined)g=0;if(j===undefined)j=l.getCharCount();if(g!==j){g=l.getLineAtOffset(g);j=l.getLineAtOffset(Math.max(0,j-1))+1;this.redrawLines(g,j)}},removeEventListener:function(g,j,l,n){this._eventTable.removeEventListener(g,j,l,n)},removeRuler:function(g){g.setView(null);
for(var j=(g.getLocation()==="left"?this._leftDiv:this._rightDiv).firstChild.rows[0],l=j.cells,n=0;n<l.length;n++)if(l[n].firstChild._ruler===g)break;if(n!==l.length){j.cells[n]._ruler=undefined;j.deleteCell(n);this._updatePage()}},setAction:function(g,j){if(g){for(var l=this._actions,n=0;n<l.length;n++){var o=l[n];if(o.name===g){o.userHandler=j;return}}l.push({name:g,userHandler:j})}},setKeyBinding:function(g,j){for(var l=this._keyBindings,n=0;n<l.length;n++){var o=l[n];if(o.keyBinding.equals(g)){if(j)o.name=
j;else if(o.predefined)o.name=null;else{g=o.name;l.splice(n,1);for(n=0;n<l.length&&g!==l[n].name;)n++;if(n===l.length){l=this._actions;for(n=0;n<l.length;n++)if(l[n].name===g)l[n].defaultHandler||l.splice(n,1)}}return}}j&&l.push({keyBinding:g,name:j})},setCaretOffset:function(g,j){var l=this._model.getCharCount();g=Math.max(0,Math.min(g,l));this._setSelection(new x(g,g,false),j===undefined||j)},setHorizontalPixel:function(g){g=Math.max(0,g);this._scrollView(g-this._getScroll().x,0)},setModel:function(g){if(g){this._model.removeListener(this._modelListener);
var j=this._model.getLineCount(),l=this._model.getCharCount(),n=g.getLineCount(),o=g.getCharCount(),r={text:g.getText(),start:0,removedCharCount:l,addedCharCount:o,removedLineCount:j,addedLineCount:n};this.onModelChanging(r);this.redrawRange();this._model=g;r={start:0,removedCharCount:l,addedCharCount:o,removedLineCount:j,addedLineCount:n};this.onModelChanged(r);this._model.addListener(this._modelListener);this.redrawRange()}},setSelection:function(g,j,l){var n=g>j;if(n){var o=g;g=j;j=o}o=this._model.getCharCount();
g=Math.max(0,Math.min(g,o));j=Math.max(0,Math.min(j,o));this._setSelection(new x(g,j,n),l===undefined||l)},setText:function(g,j,l){var n=j===undefined&&l===undefined;if(j===undefined)j=0;if(l===undefined)l=this._model.getCharCount();this._modifyContent({text:g,start:j,end:l,_code:true},!n);if(n){this._columnX=-1;this._setSelection(new x(0,0,false),true);if(d){g=this._hasFocus;j=this._clientDiv;g&&j.blur();j.contentEditable=false;j.contentEditable=true;g&&j.focus()}}},setTopIndex:function(g){var j=
this._model;if(j.getCharCount()!==0){j=j.getLineCount();var l=this._getLineHeight(),n=Math.max(1,Math.min(j,Math.floor(this._getClientHeight()/l)));if(g<0)g=0;else if(g>j-n)g=j-n;this._scrollView(0,g*l-this._getScroll().y)}},setTopPixel:function(g){var j=this._getLineHeight(),l=this._getClientHeight(),n=this._model.getLineCount();g=Math.min(Math.max(0,g),j*n-l);this._scrollView(0,g-this._getScroll().y)},showSelection:function(){return this._showCaret()},_handleBodyMouseDown:function(g){if(!g)g=window.event;
for(var j=e?this._clientDiv:this._overlayDiv||this._viewDiv,l=g.target?g.target:g.srcElement;l;){if(j===l)return;l=l.parentNode}g.preventDefault&&g.preventDefault();g.stopPropagation&&g.stopPropagation();if(!u){j.setCapture();setTimeout(function(){j.releaseCapture()},0)}},_handleBlur:function(){this._hasFocus=false;if(c<9)if(!this._getSelection().isEmpty()){var g=this._frameDocument,j=g.createElement("DIV");g=g.body;g.appendChild(j);g.removeChild(j)}if(d||c)if(this._selDiv1){j=c?"transparent":"#AFAFAF";
this._selDiv1.style.background=j;this._selDiv2.style.background=j;this._selDiv3.style.background=j}},_handleContextMenu:function(g){if(!g)g=window.event;var j=this._getScroll(),l=this._viewDiv.getBoundingClientRect(),n=this._getViewPadding();this.onContextMenu({x:g.clientX+j.x-l.left-n.left,y:g.clientY+j.y-l.top-n.top,screenX:g.screenX,screenY:g.screenY});g.preventDefault&&g.preventDefault();return false},_handleCopy:function(g){if(!this._ignoreCopy){if(!g)g=window.event;if(this._doCopy(g)){g.preventDefault&&
g.preventDefault();return false}}},_handleCut:function(g){if(!g)g=window.event;if(this._doCut(g)){g.preventDefault&&g.preventDefault();return false}},_handleDataModified:function(){this._startIME()},_handleDblclick:function(g){if(!g)g=window.event;this._lastMouseTime=g.timeStamp?g.timeStamp:(new Date).getTime();if(this._clickCount!==2){this._clickCount=2;this._handleMouse(g)}},_handleDragStart:function(g){if(!g)g=window.event;g.preventDefault&&g.preventDefault();return false},_handleDragOver:function(g){if(!g)g=
window.event;g.dataTransfer.dropEffect="none";g.preventDefault&&g.preventDefault();return false},_handleDrop:function(g){if(!g)g=window.event;g.preventDefault&&g.preventDefault();return false},_handleDocFocus:function(){this._clientDiv.focus()},_handleFocus:function(){this._hasFocus=true;c&&this._updateDOMSelection();if(d||c)if(this._selDiv1){var g=this._hightlightRGB;this._selDiv1.style.background=g;this._selDiv2.style.background=g;this._selDiv3.style.background=g}},_handleKeyDown:function(g){if(!g)g=
window.event;if(m){if(g.keyCode===8){this._doBackspace({});g.preventDefault()}}else{if(g.keyCode===229){if(this.readonly){g.preventDefault&&g.preventDefault();return false}this._startIME()}else this._commitIME();if((p||y)&&d<4||e){this._keyDownEvent=g;return true}if(this._doAction(g)){if(g.preventDefault)g.preventDefault();else{g.cancelBubble=true;g.returnValue=false;g.keyCode=0}return false}}},_handleKeyPress:function(g){if(!g)g=window.event;if(p&&i)if(63232<=g.keyCode&&g.keyCode<=63487||g.keyCode===
13||g.keyCode===8){g.preventDefault&&g.preventDefault();return false}if((p||y)&&d<4||e)if(this._doAction(this._keyDownEvent)){g.preventDefault&&g.preventDefault();return false}var j=p?g.metaKey:g.ctrlKey;if(g.charCode!==undefined)if(j)switch(g.charCode){case 99:case 118:case 120:return true}j=false;if(p){if(g.ctrlKey||g.metaKey)j=true}else if(d){if(g.ctrlKey||g.altKey)j=true}else if(g.ctrlKey^g.altKey)j=true;if(!j){j=e?g.which:g.charCode!==undefined?g.charCode:g.keyCode;if(j>31){this._doContent(String.fromCharCode(j));
g.preventDefault&&g.preventDefault();return false}}},_handleKeyUp:function(g){if(!g)g=window.event;g.keyCode===13&&this._commitIME()},_handleMouse:function(g){var j=this._frameWindow;if(c)j=this._clientDiv;if(this._overlayDiv){var l=this;setTimeout(function(){l.focus()},0)}if(this._clickCount===1){this._setGrab(j);this._setSelectionTo(g.clientX,g.clientY,g.shiftKey)}else{u&&this._setGrab(j);this._doubleClickSelection=null;this._setSelectionTo(g.clientX,g.clientY,g.shiftKey);this._doubleClickSelection=
this._getSelection()}},_handleMouseDown:function(g){if(!g)g=window.event;var j=g.which?g.button===0:g.button===1;this._commitIME();if(j){this._isMouseDown=true;j=Math.abs(this._lastMouseX-g.clientX);var l=Math.abs(this._lastMouseY-g.clientY),n=g.timeStamp?g.timeStamp:(new Date).getTime();if(n-this._lastMouseTime<=this._clickTime&&j<=this._clickDist&&l<=this._clickDist)this._clickCount++;else this._clickCount=1;this._lastMouseX=g.clientX;this._lastMouseY=g.clientY;this._lastMouseTime=n;this._handleMouse(g);
if(e){this._hasFocus||this.focus();g.preventDefault()}}},_handleMouseMove:function(g){if(!g)g=window.event;if(!u){if(g.button===0){this._setGrab(null);return true}if(!this._isMouseDown&&g.button===1&&(this._clickCount&1)!==0){this._clickCount=2;return this._handleMouse(g,this._clickCount)}}var j=g.clientX;g=g.clientY;var l=this._getViewPadding(),n=this._viewDiv.getBoundingClientRect(),o=this._getClientWidth(),r=this._getClientHeight(),v=n.left+l.left,z=n.top+l.top;o=n.left+l.left+o;l=n.top+l.top+
r;n=this._model;r=n.getLineAtOffset(this._getSelection().getCaret());if(g<z&&r!==0)this._doAutoScroll("up",j,g-z);else if(g>l&&r!==n.getLineCount()-1)this._doAutoScroll("down",j,g-l);else if(j<v)this._doAutoScroll("left",j-v,g);else if(j>o)this._doAutoScroll("right",j-o,g);else{this._endAutoScroll();this._setSelectionTo(j,g,true);c&&this._frameDocument.body.getBoundingClientRect()}},_handleMouseUp:function(g){if(!g)g=window.event;this._endAutoScroll();if(g.which?g.button===0:g.button===1){this._isMouseDown=
false;u&&this._setGrab(null)}},_handleMouseWheel:function(g){if(!g)g=window.event;var j=this._getLineHeight(),l=0,n=0;if(d){j=p?g.detail*3:Math.max(-256,Math.min(256,g.detail))*j;if(g.axis===g.HORIZONTAL_AXIS)l=j;else n=j}else if(p){n=l=40;if(k){if(g.wheelDeltaX%120!==0)l=1;if(g.wheelDeltaY%120!==0)n=1}l=-g.wheelDeltaX/l;if(-1<l&&l<0)l=-1;if(0<l&&l<1)l=1;n=-g.wheelDeltaY/n;if(-1<n&&n<0)n=-1;if(0<n&&n<1)n=1}else{l=-g.wheelDeltaX;n=-g.wheelDeltaY/120*8*j}if(h){for(j=g.target;j&&j.lineIndex===undefined;)j=
j.parentNode;this._mouseWheelLine=j}j=this._getScroll();this._scrollView(l,n);l=this._getScroll();if(h)this._mouseWheelLine=null;if(j.x!==l.x||j.y!==l.y){g.preventDefault&&g.preventDefault();return false}},_handlePaste:function(g){if(!this._ignorePaste){if(!g)g=window.event;if(this._doPaste(g)){if(c){var j=this;setTimeout(function(){j._updateDOMSelection()},0)}g.preventDefault&&g.preventDefault();return false}}},_handleResize:function(){var g=this._frameDocument.documentElement,j=g.clientWidth;g=
g.clientHeight;if(this._frameWidth!==j||this._frameHeight!==g){this._frameWidth=j;this._frameHeight=g;this._updatePage()}},_handleRulerEvent:function(g){if(!g)g=window.event;var j=g.target?g.target:g.srcElement,l=j.lineIndex;for(j=j;j&&!j._ruler;){if(l===undefined&&j.lineIndex!==undefined)l=j.lineIndex;j=j.parentNode}j=j?j._ruler:null;if(m&&l===undefined&&j&&j.getOverview()==="document"){var n=this._getClientHeight(),o=this._getLineHeight(),r=this._getViewPadding();n=n+r.top+r.bottom-34;r=this._model.getLineCount()*
o;this.setTopPixel(Math.floor((g.clientY-17-o)*r/n))}if(j)switch(g.type){case "click":j.onClick&&j.onClick(l,g);break;case "dblclick":j.onDblClick&&j.onDblClick(l,g);break}},_handleScroll:function(){this._doScroll(this._getScroll())},_handleSelectStart:function(g){if(!g)g=window.event;if(this._ignoreSelect){g&&g.preventDefault&&g.preventDefault();return false}},_handleInput:function(g){var j=this._textArea;this._doContent(j.value);j.selectionStart=j.selectionEnd=0;j.value="";g.preventDefault()},_handleTextInput:function(g){this._doContent(g.data);
g.preventDefault()},_touchConvert:function(g){var j=this._frame.getBoundingClientRect(),l=this._parentDocument.body;return{left:g.clientX-j.left-l.scrollLeft,top:g.clientY-j.top-l.scrollTop}},_handleTouchStart:function(g){var j=g.touches,l,n;this._touchMoved=false;this._touchStartScroll=undefined;if(j.length===1){l=j[0];var o=l.pageY;this._touchStartX=l.pageX;this._touchStartY=o;this._touchStartTime=g.timeStamp;this._touchStartScroll=this._getScroll();g=this._getSelection();n=this._touchConvert(j[0]);
this._touchGesture="none";if(!g.isEmpty())if(this._hitOffset(g.end,n.left,n.top))this._touchGesture="extendEnd";else if(this._hitOffset(g.start,n.left,n.top))this._touchGesture="extendStart";if(this._touchGesture==="none"){j=this._textArea;j.value="";j.style.left="-1000px";j.style.top="-1000px";j.style.width="3000px";j.style.height="3000px";var r=this;this._touchTimeout=setTimeout(function(){r._touchTimeout=null;r._clickCount=1;r._setSelectionTo(n.left,n.top,false)},200)}}else if(j.length===2){this._touchGesture=
"select";if(this._touchTimeout){clearTimeout(this._touchTimeout);this._touchTimeout=null}n=this._touchConvert(j[0]);l=this._getXToOffset(this._getYToLine(n.top),n.left);n=this._touchConvert(j[1]);j=this._getXToOffset(this._getYToLine(n.top),n.left);g=this._getSelection();g.setCaret(l);g.extend(j);this._setSelection(g,true,true)}},_handleTouchMove:function(g){this._touchMoved=true;var j=g.touches,l;if(j.length===1){j=j[0];var n=j.pageX,o=j.pageY,r=this._touchStartX-n,v=this._touchStartY-o;l=this._touchConvert(j);
j=this._getSelection();if(this._touchTimeout){clearTimeout(this._touchTimeout);this._touchTimeout=null}if(this._touchGesture==="none")this._touchGesture=g.timeStamp-this._touchStartTime<200&&(Math.abs(r)>5||Math.abs(v)>5)?"scroll":"caret";if(this._touchGesture==="select")this._touchGesture=this._hitOffset(j.end,l.left,l.top)?"extendEnd":this._hitOffset(j.start,l.left,l.top)?"extendStart":"caret";switch(this._touchGesture){case "scroll":this._touchStartX=n;this._touchStartY=o;this._scrollView(r,v);
break;case "extendStart":case "extendEnd":this._clickCount=1;l=this._getXToOffset(this._getYToLine(l.top),l.left);j.setCaret(this._touchGesture==="extendStart"?j.end:j.start);j.extend(l);if(l>=j.end&&this._touchGesture==="extendStart")this._touchGesture="extendEnd";if(l<=j.start&&this._touchGesture==="extendEnd")this._touchGesture="extendStart";this._setSelection(j,true,true);break;case "caret":this._setSelectionTo(l.left,l.top,false);break}}else if(j.length===2){l=this._touchConvert(j[0]);n=this._getXToOffset(this._getYToLine(l.top),
l.left);l=this._touchConvert(j[1]);l=this._getXToOffset(this._getYToLine(l.top),l.left);j=this._getSelection();j.setCaret(n);j.extend(l);this._setSelection(j,true,true)}g.preventDefault()},_handleTouchEnd:function(g){if(!this._touchMoved)if(g.touches.length===0&&g.changedTouches.length===1&&this._touchTimeout){clearTimeout(this._touchTimeout);this._touchTimeout=null;var j=g.changedTouches[0];this._clickCount=1;j=this._touchConvert(j);this._setSelectionTo(j.left,j.top,false)}if(g.touches.length===
0){var l=this;setTimeout(function(){var n=l._getSelection(),o=l._model.getText(n.start,n.end),r=l._textArea;r.value=o;r.selectionStart=0;r.selectionEnd=o.length;if(!n.isEmpty()){o=l._touchDiv.getBoundingClientRect();n=l._getOffsetBounds(n.start);r.style.left=o.width/2+"px";r.style.top=(n.top>40?n.top-30:n.top+30)+"px"}},0)}g.preventDefault()},_doAction:function(g){for(var j=this._keyBindings,l=0;l<j.length;l++){var n=j[l];if(n.keyBinding.match(g)){if(n.name){g=this._actions;for(j=0;j<g.length;j++){l=
g[j];if(l.name===n.name){if(l.userHandler){if(!l.userHandler())if(l.defaultHandler)l.defaultHandler();else return false}else l.defaultHandler&&l.defaultHandler();break}}}return true}}return false},_doBackspace:function(g){var j=this._getSelection();if(j.isEmpty()){var l=this._model,n=j.getCaret(),o=l.getLineAtOffset(n);if(n===l.getLineStart(o))o>0&&j.extend(l.getLineEnd(o-1));else j.extend(this._getOffset(n,g.unit,-1))}this._modifyContent({text:"",start:j.start,end:j.end},true);return true},_doContent:function(g){var j=
this._getSelection();this._modifyContent({text:g,start:j.start,end:j.end,_ignoreDOMSelection:true},true)},_doCopy:function(g){var j=this._getSelection();if(!j.isEmpty())return this._setClipboardText(this._model.getText(j.start,j.end),g);return true},_doCursorNext:function(g){if(!g.select)if(this._clearSelection("next"))return true;var j=this._model,l=this._getSelection(),n=l.getCaret(),o=j.getLineAtOffset(n);if(n===j.getLineEnd(o))o+1<j.getLineCount()&&l.extend(j.getLineStart(o+1));else l.extend(this._getOffset(n,
g.unit,1));g.select||l.collapse();this._setSelection(l,true);return true},_doCursorPrevious:function(g){if(!g.select)if(this._clearSelection("previous"))return true;var j=this._model,l=this._getSelection(),n=l.getCaret(),o=j.getLineAtOffset(n);if(n===j.getLineStart(o))o>0&&l.extend(j.getLineEnd(o-1));else l.extend(this._getOffset(n,g.unit,-1));g.select||l.collapse();this._setSelection(l,true);return true},_doCut:function(g){var j=this._getSelection();if(!j.isEmpty()){j=this._model.getText(j.start,
j.end);this._doContent("");return this._setClipboardText(j,g)}return true},_doDelete:function(g){var j=this._getSelection();if(j.isEmpty()){var l=this._model,n=j.getCaret(),o=l.getLineAtOffset(n);if(n===l.getLineEnd(o))o+1<l.getLineCount()&&j.extend(l.getLineStart(o+1));else j.extend(this._getOffset(n,g.unit,1))}this._modifyContent({text:"",start:j.start,end:j.end},true);return true},_doEnd:function(g){var j=this._getSelection(),l=this._model;if(g.ctrl)j.extend(l.getCharCount());else{var n=l.getLineAtOffset(j.getCaret());
j.extend(l.getLineEnd(n))}g.select||j.collapse();this._setSelection(j,true);return true},_doEnter:function(){this._doContent(this._model.getLineDelimiter());return true},_doHome:function(g){var j=this._getSelection(),l=this._model;if(g.ctrl)j.extend(0);else{var n=l.getLineAtOffset(j.getCaret());j.extend(l.getLineStart(n))}g.select||j.collapse();this._setSelection(j,true);return true},_doLineDown:function(g){var j=this._model,l=this._getSelection(),n=l.getCaret(),o=j.getLineAtOffset(n);if(o+1<j.getLineCount()){j=
this._columnX;if(j===-1||g.select)j=this._getOffsetToX(n);l.extend(this._getXToOffset(o+1,j));g.select||l.collapse();this._setSelection(l,true,true);this._columnX=j}return true},_doLineUp:function(g){var j=this._model,l=this._getSelection(),n=l.getCaret();j=j.getLineAtOffset(n);if(j>0){var o=this._columnX;if(o===-1||g.select)o=this._getOffsetToX(n);l.extend(this._getXToOffset(j-1,o));g.select||l.collapse();this._setSelection(l,true,true);this._columnX=o}return true},_doPageDown:function(g){var j=
this._model,l=this._getSelection(),n=l.getCaret(),o=j.getLineAtOffset(n),r=j.getLineCount();if(o<r-1){j=this._getClientHeight();var v=this._getLineHeight(),z=Math.floor(j/v),B=Math.min(r-o-1,z);B=Math.max(1,B);z=this._columnX;if(z===-1||g.select)z=this._getOffsetToX(n);l.extend(this._getXToOffset(o+B,z));g.select||l.collapse();this._setSelection(l,false,false);g=r*v;l=this._getScroll().y;v=l+B*v;if(v+j>g)v=g-j;v>l?this._scrollView(0,v-l):this._updateDOMSelection();this._columnX=z}return true},_doPageUp:function(g){var j=
this._model,l=this._getSelection(),n=l.getCaret(),o=j.getLineAtOffset(n);if(o>0){var r=this._getClientHeight();j=this._getLineHeight();r=Math.floor(r/j);var v=Math.max(1,Math.min(o,r));r=this._columnX;if(r===-1||g.select)r=this._getOffsetToX(n);l.extend(this._getXToOffset(o-v,r));g.select||l.collapse();this._setSelection(l,false,false);g=this._getScroll().y;l=Math.max(0,g-v*j);l<g?this._scrollView(0,l-g):this._updateDOMSelection();this._columnX=r}return true},_doPaste:function(g){(g=this._getClipboardText(g))&&
this._doContent(g);return g!==null},_doScroll:function(g){var j=this._hScroll,l=this._vScroll;if(j!==g.x||l!==g.y){this._hScroll=g.x;this._vScroll=g.y;this._commitIME();this._updatePage();this.onScroll({oldValue:{x:j,y:l},newValue:g})}},_doSelectAll:function(){var g=this._model,j=this._getSelection();j.setCaret(0);j.extend(g.getCharCount());this._setSelection(j,false);return true},_doTab:function(){this._doContent("\t");return true},_applyStyle:function(g,j){if(g){if(g.styleClass)j.className=g.styleClass;
if(g=g.style)for(var l in g)if(g.hasOwnProperty(l))j.style[l]=g[l]}},_autoScroll:function(){var g=this._getSelection(),j,l=this._autoScrollX;if(this._autoScrollDir==="up"||this._autoScrollDir==="down"){var n=this._autoScrollY/this._getLineHeight();n=n<0?Math.floor(n):Math.ceil(n);j=this._model.getLineAtOffset(g.getCaret());j=Math.max(0,Math.min(this._model.getLineCount()-1,j+n))}else if(this._autoScrollDir==="left"||this._autoScrollDir==="right"){j=this._getYToLine(this._autoScrollY);l+=this._getOffsetToX(g.getCaret())}g.extend(this._getXToOffset(j,
l));this._setSelection(g,true)},_autoScrollTimer:function(){this._autoScroll();var g=this;this._autoScrollTimerID=setTimeout(function(){g._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateLineHeight:function(){var g=this._clientDiv,j=this._frameDocument,l=j.createElement("DIV");l.style.position="fixed";l.style.left="-1000px";var n=j.createElement("SPAN");n.appendChild(j.createTextNode(" "));l.appendChild(n);var o=j.createElement("SPAN");o.style.fontStyle="italic";o.appendChild(j.createTextNode(" "));
l.appendChild(o);var r=j.createElement("SPAN");r.style.fontWeight="bold";r.appendChild(j.createTextNode(" "));l.appendChild(r);var v=j.createElement("SPAN");v.style.fontWeight="bold";v.style.fontStyle="italic";v.appendChild(j.createTextNode(" "));l.appendChild(v);g.appendChild(l);j=n.getBoundingClientRect();o=o.getBoundingClientRect();n=r.getBoundingClientRect();var z=v.getBoundingClientRect();v=j.bottom-j.top;r=o.bottom-o.top;j=n.bottom-n.top;o=z.bottom-z.top;n=0;z=v;if(r>v){z=r;n=1}if(j>r){z=j;
n=2}if(o>j){z=o;n=3}this._largestFontStyle=n;g.removeChild(l);return z},_calculatePadding:function(){var g=this._frameDocument,j=this._clientDiv,l=this._getPadding(this._viewDiv),n=g.createElement("DIV");n.style.position="fixed";n.style.left="-1000px";n.style.paddingLeft=l.left+"px";n.style.paddingTop=l.top+"px";n.style.paddingRight=l.right+"px";n.style.paddingBottom=l.bottom+"px";n.style.width="100px";n.style.height="100px";l=g.createElement("DIV");l.style.width="100%";l.style.height="100%";n.appendChild(l);
j.appendChild(n);g=n.getBoundingClientRect();l=l.getBoundingClientRect();j.removeChild(n);return l={left:l.left-g.left,top:l.top-g.top,right:g.right-l.right,bottom:g.bottom-l.bottom}},_clearSelection:function(g){var j=this._getSelection();if(j.isEmpty())return false;if(g==="next")j.start=j.end;else j.end=j.start;this._setSelection(j,true);return true},_commitIME:function(){if(this._imeOffset!==-1){this._scrollDiv.focus();this._clientDiv.focus();var g=this._model,j=g.getLineAtOffset(this._imeOffset),
l=g.getLineStart(j),n=this._getDOMText(j);g=g.getLine(j);l=this._imeOffset-l;g=l+n.length-g.length;l!==g&&this._doContent(n.substring(l,g));this._imeOffset=-1}},_convertDelimiter:function(g,j,l){for(var n=0,o=0,r=0,v=g.length;r<v;){if(n!==-1&&n<=r)n=g.indexOf("\r",r);if(o!==-1&&o<=r)o=g.indexOf("\n",r);var z=r,B;if(o===-1&&n===-1){j(g.substring(r));break}if(n!==-1&&o!==-1)if(n+1===o){B=n;r=o+1}else{B=n<o?n:o;r=(n<o?n:o)+1}else if(n!==-1){B=n;r=n+1}else{B=o;r=o+1}j(g.substring(z,B));l()}},_createActions:function(){var g=
orion.textview.KeyBinding,j=this._keyBindings=[];j.push({name:"lineUp",keyBinding:new g(38),predefined:true});j.push({name:"lineDown",keyBinding:new g(40),predefined:true});j.push({name:"charPrevious",keyBinding:new g(37),predefined:true});j.push({name:"charNext",keyBinding:new g(39),predefined:true});j.push({name:"pageUp",keyBinding:new g(33),predefined:true});j.push({name:"pageDown",keyBinding:new g(34),predefined:true});if(p){j.push({name:"lineStart",keyBinding:new g(37,true),predefined:true});
j.push({name:"lineEnd",keyBinding:new g(39,true),predefined:true});j.push({name:"wordPrevious",keyBinding:new g(37,null,null,true),predefined:true});j.push({name:"wordNext",keyBinding:new g(39,null,null,true),predefined:true});j.push({name:"textStart",keyBinding:new g(36),predefined:true});j.push({name:"textEnd",keyBinding:new g(35),predefined:true});j.push({name:"textStart",keyBinding:new g(38,true),predefined:true});j.push({name:"textEnd",keyBinding:new g(40,true),predefined:true})}else{j.push({name:"lineStart",
keyBinding:new g(36),predefined:true});j.push({name:"lineEnd",keyBinding:new g(35),predefined:true});j.push({name:"wordPrevious",keyBinding:new g(37,true),predefined:true});j.push({name:"wordNext",keyBinding:new g(39,true),predefined:true});j.push({name:"textStart",keyBinding:new g(36,true),predefined:true});j.push({name:"textEnd",keyBinding:new g(35,true),predefined:true})}j.push({name:"selectLineUp",keyBinding:new g(38,null,true),predefined:true});j.push({name:"selectLineDown",keyBinding:new g(40,
null,true),predefined:true});j.push({name:"selectCharPrevious",keyBinding:new g(37,null,true),predefined:true});j.push({name:"selectCharNext",keyBinding:new g(39,null,true),predefined:true});j.push({name:"selectPageUp",keyBinding:new g(33,null,true),predefined:true});j.push({name:"selectPageDown",keyBinding:new g(34,null,true),predefined:true});if(p){j.push({name:"selectLineStart",keyBinding:new g(37,true,true),predefined:true});j.push({name:"selectLineEnd",keyBinding:new g(39,true,true),predefined:true});
j.push({name:"selectWordPrevious",keyBinding:new g(37,null,true,true),predefined:true});j.push({name:"selectWordNext",keyBinding:new g(39,null,true,true),predefined:true});j.push({name:"selectTextStart",keyBinding:new g(36,null,true),predefined:true});j.push({name:"selectTextEnd",keyBinding:new g(35,null,true),predefined:true});j.push({name:"selectTextStart",keyBinding:new g(38,true,true),predefined:true});j.push({name:"selectTextEnd",keyBinding:new g(40,true,true),predefined:true})}else{j.push({name:"selectLineStart",
keyBinding:new g(36,null,true),predefined:true});j.push({name:"selectLineEnd",keyBinding:new g(35,null,true),predefined:true});j.push({name:"selectWordPrevious",keyBinding:new g(37,true,true),predefined:true});j.push({name:"selectWordNext",keyBinding:new g(39,true,true),predefined:true});j.push({name:"selectTextStart",keyBinding:new g(36,true,true),predefined:true});j.push({name:"selectTextEnd",keyBinding:new g(35,true,true),predefined:true})}j.push({name:"deletePrevious",keyBinding:new g(8),predefined:true});
j.push({name:"deletePrevious",keyBinding:new g(8,null,true),predefined:true});j.push({name:"deleteNext",keyBinding:new g(46),predefined:true});j.push({name:"deleteWordPrevious",keyBinding:new g(8,true),predefined:true});j.push({name:"deleteWordPrevious",keyBinding:new g(8,true,true),predefined:true});j.push({name:"deleteWordNext",keyBinding:new g(46,true),predefined:true});j.push({name:"tab",keyBinding:new g(9),predefined:true});j.push({name:"enter",keyBinding:new g(13),predefined:true});j.push({name:"enter",
keyBinding:new g(13,null,true),predefined:true});j.push({name:"selectAll",keyBinding:new g("a",true),predefined:true});if(p){j.push({name:"deleteNext",keyBinding:new g(46,null,true),predefined:true});j.push({name:"deleteWordPrevious",keyBinding:new g(8,null,null,true),predefined:true});j.push({name:"deleteWordNext",keyBinding:new g(46,null,null,true),predefined:true})}if(!d){var l=p&&k;j.push({name:null,keyBinding:new g("u",!l,false,false,l),predefined:true});j.push({name:null,keyBinding:new g("i",
!l,false,false,l),predefined:true});j.push({name:null,keyBinding:new g("b",!l,false,false,l),predefined:true})}if(d){j.push({name:"copy",keyBinding:new g(45,true),predefined:true});j.push({name:"paste",keyBinding:new g(45,null,true),predefined:true});j.push({name:"cut",keyBinding:new g(46,null,true),predefined:true})}var n=this;this._actions=[{name:"lineUp",defaultHandler:function(){return n._doLineUp({select:false})}},{name:"lineDown",defaultHandler:function(){return n._doLineDown({select:false})}},
{name:"lineStart",defaultHandler:function(){return n._doHome({select:false,ctrl:false})}},{name:"lineEnd",defaultHandler:function(){return n._doEnd({select:false,ctrl:false})}},{name:"charPrevious",defaultHandler:function(){return n._doCursorPrevious({select:false,unit:"character"})}},{name:"charNext",defaultHandler:function(){return n._doCursorNext({select:false,unit:"character"})}},{name:"pageUp",defaultHandler:function(){return n._doPageUp({select:false})}},{name:"pageDown",defaultHandler:function(){return n._doPageDown({select:false})}},
{name:"wordPrevious",defaultHandler:function(){return n._doCursorPrevious({select:false,unit:"word"})}},{name:"wordNext",defaultHandler:function(){return n._doCursorNext({select:false,unit:"word"})}},{name:"textStart",defaultHandler:function(){return n._doHome({select:false,ctrl:true})}},{name:"textEnd",defaultHandler:function(){return n._doEnd({select:false,ctrl:true})}},{name:"selectLineUp",defaultHandler:function(){return n._doLineUp({select:true})}},{name:"selectLineDown",defaultHandler:function(){return n._doLineDown({select:true})}},
{name:"selectLineStart",defaultHandler:function(){return n._doHome({select:true,ctrl:false})}},{name:"selectLineEnd",defaultHandler:function(){return n._doEnd({select:true,ctrl:false})}},{name:"selectCharPrevious",defaultHandler:function(){return n._doCursorPrevious({select:true,unit:"character"})}},{name:"selectCharNext",defaultHandler:function(){return n._doCursorNext({select:true,unit:"character"})}},{name:"selectPageUp",defaultHandler:function(){return n._doPageUp({select:true})}},{name:"selectPageDown",
defaultHandler:function(){return n._doPageDown({select:true})}},{name:"selectWordPrevious",defaultHandler:function(){return n._doCursorPrevious({select:true,unit:"word"})}},{name:"selectWordNext",defaultHandler:function(){return n._doCursorNext({select:true,unit:"word"})}},{name:"selectTextStart",defaultHandler:function(){return n._doHome({select:true,ctrl:true})}},{name:"selectTextEnd",defaultHandler:function(){return n._doEnd({select:true,ctrl:true})}},{name:"deletePrevious",defaultHandler:function(){return n._doBackspace({unit:"character"})}},
{name:"deleteNext",defaultHandler:function(){return n._doDelete({unit:"character"})}},{name:"deleteWordPrevious",defaultHandler:function(){return n._doBackspace({unit:"word"})}},{name:"deleteWordNext",defaultHandler:function(){return n._doDelete({unit:"word"})}},{name:"tab",defaultHandler:function(){return n._doTab()}},{name:"enter",defaultHandler:function(){return n._doEnter()}},{name:"selectAll",defaultHandler:function(){return n._doSelectAll()}},{name:"copy",defaultHandler:function(){return n._doCopy()}},
{name:"cut",defaultHandler:function(){return n._doCut()}},{name:"paste",defaultHandler:function(){return n._doPaste()}}]},_createLine:function(g,j,l,n,o){var r=o.getLine(n),v=o.getLineStart(n),z={lineIndex:n,lineText:r,lineStart:v};this.onLineStyle(z);o=l.createElement("DIV");o.lineIndex=n;this._applyStyle(z.style,o);if(r.length!==0){var B=0;if((n=this._tabSize)&&n!==8)for(var D=r.indexOf("\t"),E=0;D!==-1;){this._createRange(o,l,z.ranges,B,D,r,v);var F=n-(D+E)%n,J="\u00a0";for(B=1;B<F;B++)J+=" ";
B=l.createElement("SPAN");B.appendChild(l.createTextNode(J));B.ignoreChars=F-1;E+=B.ignoreChars;if(z.ranges)for(F=0;F<z.ranges.length;F++){J=z.ranges[F];var K=J.start-v,O=J.end-v;if(K>D)break;if(K<=D&&D<O){this._applyStyle(J.style,B);break}}o.appendChild(B);B=D+1;D=r.indexOf("\t",B)}this._createRange(o,l,z.ranges,B,r.length,r,v)}r=l.createElement("SPAN");r.ignoreChars=1;if((this._largestFontStyle&1)!==0)r.style.fontStyle="italic";if((this._largestFontStyle&2)!==0)r.style.fontWeight="bold";r.appendChild(l.createTextNode(!this._fullSelection&&
(d||e||c>=9)?" ":i||d?"\u200c":"\ufeff"));o.appendChild(r);g.insertBefore(o,j);return o},_createRange:function(g,j,l,n,o,r,v){if(!(n>=o)){var z;if(l)for(var B=0;B<l.length;B++){var D=l[B];if(!(D.end<=v+n)){var E=Math.max(v+n,D.start)-v;if(E>=o)break;var F=Math.min(v+o,D.end)-v;if(E<F){E=Math.max(n,E);F=Math.min(o,F);if(n<E){z=j.createElement("SPAN");z.appendChild(j.createTextNode(r.substring(n,E)));g.appendChild(z)}z=j.createElement("SPAN");z.appendChild(j.createTextNode(r.substring(E,F)));this._applyStyle(D.style,
z);g.appendChild(z);n=F}}}if(n<o){z=j.createElement("SPAN");z.appendChild(j.createTextNode(r.substring(n,o)));g.appendChild(z)}}},_doAutoScroll:function(g,j,l){this._autoScrollDir=g;this._autoScrollX=j;this._autoScrollY=l;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=this._autoScrollDir=undefined},_getBoundsAtOffset:function(g){var j=this._model,l=this._frameDocument,n=this._clientDiv,
o=j.getLineAtOffset(g),r,v=this._getLineNode(o);v||(v=r=this._createLine(n,null,l,o,j));var z=null;if(g<j.getLineEnd(o)){j=j.getLineStart(o);for(o=v.firstChild;o;){var B=o.firstChild,D=B.length;if(o.ignoreChars)D-=o.ignoreChars;if(j+D>g){z=g-j;if(s){l=l.createRange();l.setStart(B,z);l.setEnd(B,z+1);z=l.getBoundingClientRect()}else if(c){l=l.body.createTextRange();l.moveToElementText(o);l.collapse();l.moveEnd("character",z+1);l.moveStart("character",z);z=l.getBoundingClientRect()}else{g=B.data;o.removeChild(B);
o.appendChild(l.createTextNode(g.substring(0,z)));var E=l.createElement("SPAN");E.appendChild(l.createTextNode(g.substring(z,z+1)));o.appendChild(E);o.appendChild(l.createTextNode(g.substring(z+1)));z=E.getBoundingClientRect();o.innerHTML="";o.appendChild(B);if(!r){l=this._getSelection();if(j<=l.start&&l.start<j+D||j<=l.end&&l.end<j+D)this._updateDOMSelection()}}if(c){l=window.screen.logicalXDPI;j=window.screen.deviceXDPI;z.left=z.left*l/j;z.right=z.right*l/j}break}j+=D;o=o.nextSibling}}if(!z){v=
this._getLineBoundingClientRect(v);z={left:v.right,right:v.right}}r&&n.removeChild(r);return z},_getBottomIndex:function(g){var j=this._bottomChild;if(g&&this._getClientHeight()>this._getLineHeight()){g=j.getBoundingClientRect();var l=this._clientDiv.getBoundingClientRect();if(g.bottom>l.bottom)j=this._getLinePrevious(j)||j}return j.lineIndex},_getFrameHeight:function(){return this._frameDocument.documentElement.clientHeight},_getFrameWidth:function(){return this._frameDocument.documentElement.clientWidth},
_getClientHeight:function(){var g=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-g.top-g.bottom)},_getClientWidth:function(){var g=this._getViewPadding();return Math.max(0,this._viewDiv.clientWidth-g.left-g.right)},_getClipboardText:function(g){var j=this._model.getLineDelimiter(),l;if(this._frameWindow.clipboardData){l=[];g=this._frameWindow.clipboardData.getData("Text");this._convertDelimiter(g,function(J){l.push(J)},function(){l.push(j)});return l.join("")}if(d){var n=this._frameWindow,
o=this._frameDocument,r=o.createElement("PRE");r.style.position="fixed";r.style.left="-1000px";r.appendChild(o.createTextNode(" "));this._clientDiv.appendChild(r);var v=o.createRange();v.selectNodeContents(r);var z=n.getSelection();z.rangeCount>0&&z.removeAllRanges();z.addRange(v);var B=this,D=function(){B._updateDOMSelection();B._clientDiv.removeChild(r)},E=function(){var J=null;if(z.anchorNode.nodeType!==r.TEXT_NODE)J=z.anchorNode.childNodes[z.anchorOffset];var K=[],O=function(R){for(R=R.firstChild;R&&
R!==J;){if(R.nodeType===r.TEXT_NODE)K.push(R!==z.anchorNode?R.data:R.data.substring(0,z.anchorOffset));else R.tagName==="BR"?K.push(j):O(R);R=R.nextSibling}};O(r);D();return K.join("")};n=false;this._ignorePaste=true;try{n=o.execCommand("paste",false,null)}catch(F){}this._ignorePaste=false;if(!n)if(g){setTimeout(function(){var J=E();J&&B._doContent(J)},0);return null}else{D();return""}return E()}if(g&&g.clipboardData){l=[];g=g.clipboardData.getData("text/plain");this._convertDelimiter(g,function(J){l.push(J)},
function(){l.push(j)});return l.join("")}return""},_getDOMText:function(g){g=this._getLineNode(g).firstChild;for(var j="";g;){for(var l=g.firstChild;l;){if(g.ignoreChars)for(var n=0;n<l.length;n++){var o=l.data.substring(n,n+1);if(o!==" ")j+=o}else j+=l.data;l=l.nextSibling}g=g.nextSibling}return j},_getViewPadding:function(){return this._viewPadding},_getLineBoundingClientRect:function(g){var j=g.getBoundingClientRect();for(g=g.lastChild;g&&g.ignoreChars===g.firstChild.length;)g=g.previousSibling;
if(!g)return{left:j.left,top:j.top,right:j.left,bottom:j.bottom};g=g.getBoundingClientRect();return{left:j.left,top:j.top,right:g.right,bottom:j.bottom}},_getLineHeight:function(){return this._lineHeight},_getLineNode:function(g){for(var j=this._clientDiv.firstChild;j;){if(g===j.lineIndex)return j;j=j.nextSibling}},_getLineNext:function(g){for(g=g?g.nextSibling:this._clientDiv.firstChild;g&&g.lineIndex===-1;)g=g.nextSibling;return g},_getLinePrevious:function(g){for(g=g?g.previousSibling:this._clientDiv.lastChild;g&&
g.lineIndex===-1;)g=g.previousSibling;return g},_getOffset:function(g,j,l){if(j==="wordend")return this._getOffset_W3C(g,j,l);return c?this._getOffset_IE(g,j,l):this._getOffset_W3C(g,j,l)},_getOffset_W3C:function(g,j,l){function n(F){return 33<=F&&F<=47||58<=F&&F<=64||91<=F&&F<=94||F===96||123<=F&&F<=126}function o(F){return F===32||F===9}if(j==="word"||j==="wordend"){var r=this._model,v=r.getLineAtOffset(g),z=r.getLine(v),B=r.getLineStart(v);v=r.getLineEnd(v);r=z.length;g=g-B;var D,E;if(l>0){if(g===
r)return v;D=z.charCodeAt(g);E=n(D);l=!E&&!o(D);for(g++;g<r;){D=z.charCodeAt(g);v=n(D);if(j==="wordend"){if(!v&&E)break}else if(v&&!E)break;D=!v&&!o(D);if(j==="wordend"){if(!D&&l)break}else if(D&&!l)break;l=D;E=v;g++}}else{if(g===0)return B;g--;D=z.charCodeAt(g);E=n(D);for(l=!E&&!o(D);0<g;){D=z.charCodeAt(g-1);v=n(D);if(j==="wordend"){if(v&&!E)break}else if(!v&&E)break;D=!v&&!o(D);if(j==="wordend"){if(D&&!l)break}else if(!D&&l)break;l=D;E=v;g--}}return B+g}return g+l},_getOffset_IE:function(g,j,l){var n=
this._frameDocument,o=this._model,r=o.getLineAtOffset(g),v=this._clientDiv,z,B=this._getLineNode(r);B||(B=z=this._createLine(v,null,n,r,o));var D=0,E;E=o.getLineStart(r);if(g===o.getLineEnd(r)){n=n.body.createTextRange();n.moveToElementText(B.lastChild);E=n.text.length;n.moveEnd(j,l);D=g+n.text.length-E}else if(g===E&&l<0)D=E;else for(B=B.firstChild;B;){o=B.firstChild.length;if(B.ignoreChars)o-=B.ignoreChars;if(E+o>g){n=n.body.createTextRange();if(g===E&&l<0)n.moveToElementText(B.previousSibling);
else{n.moveToElementText(B);n.collapse();n.moveEnd("character",g-E)}E=n.text.length;n.moveEnd(j,l);D=g+n.text.length-E;break}E=o+E;B=B.nextSibling}z&&v.removeChild(z);return D},_getOffsetToX:function(g){return this._getBoundsAtOffset(g).left},_getPadding:function(g){var j,l,n,o;if(g.currentStyle){j=g.currentStyle.paddingLeft;l=g.currentStyle.paddingTop;n=g.currentStyle.paddingRight;o=g.currentStyle.paddingBottom}else if(this._frameWindow.getComputedStyle){g=this._frameWindow.getComputedStyle(g,null);
j=g.getPropertyValue("padding-left");l=g.getPropertyValue("padding-top");n=g.getPropertyValue("padding-right");o=g.getPropertyValue("padding-bottom")}return{left:parseInt(j,10),top:parseInt(l,10),right:parseInt(n,10),bottom:parseInt(o,10)}},_getScroll:function(){var g=this._viewDiv;return{x:g.scrollLeft,y:g.scrollTop}},_getSelection:function(){return this._selection.clone()},_getTopIndex:function(g){var j=this._topChild;if(g&&this._getClientHeight()>this._getLineHeight()){g=j.getBoundingClientRect();
var l=this._getViewPadding(),n=this._viewDiv.getBoundingClientRect();if(g.top<n.top+l.top)j=this._getLineNext(j)||j}return j.lineIndex},_getXToOffset:function(g,j){function l(Q){var S,W,ca,fa;if(!Q._rectsCache){S=Q.getClientRects();W=[S.length];for(ca=0;ca<S.length;ca++){fa=S[ca];W[ca]={left:fa.left-E+K,top:fa.top,right:fa.right-E+K,bottom:fa.bottom}}Q._rectsCache=W}S=Q._rectsCache;W=[S.length];for(ca=0;ca<S.length;ca++){fa=S[ca];W[ca]={left:fa.left-K,top:fa.top,right:fa.right-K,bottom:fa.bottom}}return W}
var n=this._model,o=n.getLineStart(g),r=n.getLineEnd(g);if(o===r)return o;var v=this._frameDocument,z=this._clientDiv,B,D=this._getLineNode(g);D||(D=B=this._createLine(z,null,v,g,n));g=this._getLineBoundingClientRect(D);if(j<g.left)j=g.left;if(j>g.right)j=g.right;var E=0,F;if(c<9){F=D.getClientRects();n=F[0].left;for(var J=1;J<F.length;J++)n=Math.min(F[J].left,n);E=n-g.left}var K=this._getScroll().x,O=c?window.screen.logicalXDPI:1,R=c?window.screen.deviceXDPI:1;g=o;n=D.firstChild;a:for(;n;){J=n.firstChild;
D=J.length;if(n.ignoreChars)D-=n.ignoreChars;F=l(n);for(var X=0;X<F.length;X++){var P=F[X];if(P.left<=j&&j<P.right){if(c||s){v=s?v.createRange():v.body.createTextRange();X=D;for(var da=-1;X-da>1;){var A=Math.floor((X+da)/2);F=da+1;P=A===D-1&&n.ignoreChars?J.length:A+1;if(s){v.setStart(J,F);v.setEnd(J,P)}else{v.moveToElementText(n);v.move("character",F);v.moveEnd("character",P-F)}F=v.getClientRects();for(var C=false,H=0;H<F.length;H++){P=F[H];var N=P.right*O/R-E;if(P.left*O/R-E<=j&&j<N){C=true;break}}if(C)X=
A;else da=A}g+=X;F=X;P=X===D-1&&n.ignoreChars?J.length:X+1;if(s){v.setStart(J,F);v.setEnd(J,P)}else{v.moveToElementText(n);v.move("character",F);v.moveEnd("character",P-F)}P=v.getClientRects()[0];j>P.left*O/R-E+(P.right-P.left)*O/R/2&&g++}else{F=[];for(O=0;O<D;O++){F.push("<span>");O===D-1?F.push(J.data.substring(O)):F.push(J.data.substring(O,O+1));F.push("</span>")}n.innerHTML=F.join("");for(F=n.firstChild;F;){P=F.getBoundingClientRect();if(P.left<=j&&j<P.right){j>P.left+(P.right-P.left)/2&&g++;
break}g++;F=F.nextSibling}if(!B){n.innerHTML="";n.appendChild(J);j=this._getSelection();if(g<=j.start&&j.start<g+D||g<=j.end&&j.end<g+D)this._updateDOMSelection()}}break a}}g+=D;n=n.nextSibling}B&&z.removeChild(B);return Math.min(r,Math.max(o,g))},_getYToLine:function(g){var j=this._getViewPadding(),l=this._viewDiv.getBoundingClientRect();g-=l.top+j.top;j=this._getLineHeight();g=Math.floor((g+this._getScroll().y)/j);j=this._model.getLineCount();return Math.max(0,Math.min(j-1,g))},_getOffsetBounds:function(g){var j=
this._model.getLineAtOffset(g),l=this._getLineHeight(),n=this._getScroll(),o=this._getViewPadding(),r=this._viewDiv.getBoundingClientRect();g=this._getBoundsAtOffset(g);j=j*l-n.y+r.top+o.top;return{left:g.left,top:j,right:g.right,bottom:j+l}},_hitOffset:function(g,j,l){var n=this._getOffsetBounds(g);g=n.left;var o=n.right,r=n.top;n=n.bottom;g-=20;r-=20;o+=20;n+=20;return g<=j&&j<=o&&r<=l&&l<=n},_hookEvents:function(){var g=this;this._modelListener={onChanging:function(v,z,B,D,E,F){g._onModelChanging(v,
z,B,D,E,F)},onChanged:function(v,z,B,D,E){g._onModelChanged(v,z,B,D,E)}};this._model.addListener(this._modelListener);this._mouseMoveClosure=function(v){return g._handleMouseMove(v)};this._mouseUpClosure=function(v){return g._handleMouseUp(v)};var j=this._clientDiv,l=this._viewDiv,n=this._frameDocument.body,o=this._handlers=[],r=m?this._textArea:c||d?this._clientDiv:this._frameWindow;o.push({target:c<9?this._frame:this._frameWindow,type:"resize",handler:function(v){return g._handleResize(v)}});o.push({target:r,
type:"blur",handler:function(v){return g._handleBlur(v)}});o.push({target:r,type:"focus",handler:function(v){return g._handleFocus(v)}});o.push({target:l,type:"scroll",handler:function(v){return g._handleScroll(v)}});if(m){j=this._touchDiv;n=this._textArea;o.push({target:n,type:"keydown",handler:function(v){return g._handleKeyDown(v)}});o.push({target:n,type:"input",handler:function(v){return g._handleInput(v)}});o.push({target:n,type:"textInput",handler:function(v){return g._handleTextInput(v)}});
o.push({target:j,type:"touchstart",handler:function(v){return g._handleTouchStart(v)}});o.push({target:j,type:"touchmove",handler:function(v){return g._handleTouchMove(v)}});o.push({target:j,type:"touchend",handler:function(v){return g._handleTouchEnd(v)}})}else{l=this._overlayDiv||this._clientDiv;o.push({target:j,type:"keydown",handler:function(v){return g._handleKeyDown(v)}});o.push({target:j,type:"keypress",handler:function(v){return g._handleKeyPress(v)}});o.push({target:j,type:"keyup",handler:function(v){return g._handleKeyUp(v)}});
o.push({target:j,type:"selectstart",handler:function(v){return g._handleSelectStart(v)}});o.push({target:j,type:"contextmenu",handler:function(v){return g._handleContextMenu(v)}});o.push({target:j,type:"copy",handler:function(v){return g._handleCopy(v)}});o.push({target:j,type:"cut",handler:function(v){return g._handleCut(v)}});o.push({target:j,type:"paste",handler:function(v){return g._handlePaste(v)}});o.push({target:l,type:"mousedown",handler:function(v){return g._handleMouseDown(v)}});o.push({target:n,
type:"mousedown",handler:function(v){return g._handleBodyMouseDown(v)}});o.push({target:l,type:"dragstart",handler:function(v){return g._handleDragStart(v)}});o.push({target:l,type:"dragover",handler:function(v){return g._handleDragOver(v)}});o.push({target:l,type:"drop",handler:function(v){return g._handleDrop(v)}});c&&o.push({target:this._frameDocument,type:"activate",handler:function(v){return g._handleDocFocus(v)}});d&&o.push({target:this._frameDocument,type:"focus",handler:function(v){return g._handleDocFocus(v)}});
if(!c&&!e)o.push({target:this._viewDiv,type:d?"DOMMouseScroll":"mousewheel",handler:function(v){return g._handleMouseWheel(v)}});d&&!t&&o.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(v){return g._handleDataModified(v)}});this._overlayDiv&&o.push({target:this._overlayDiv,type:"contextmenu",handler:function(v){return g._handleContextMenu(v)}});u||o.push({target:this._clientDiv,type:"dblclick",handler:function(v){return g._handleDblclick(v)}})}for(j=0;j<o.length;j++){n=
o[j];b(n.target,n.type,n.handler,n.capture)}},_init:function(g){var j=g.parent;if(typeof j==="string")j=window.document.getElementById(j);if(!j)throw"no parent";this._parent=j;this._model=g.model?g.model:new orion.textview.TextModel;this.readonly=g.readonly===true;this._selection=new x(0,0,false);this._eventTable=new w;this._maxLineWidth=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;for(this._imeOffset=-1;j.hasChildNodes();)j.removeChild(j.lastChild);var l=j.document||j.ownerDocument;this._parentDocument=l;var n=l.createElement("IFRAME");this._frame=n;n.frameBorder="0px";n.style.width="100%";n.style.height="100%";n.scrolling="no";n.style.border=
"0px";j.appendChild(n);var o=[];o.push("<!DOCTYPE html>");o.push("<html>");o.push("<head>");c<9&&o.push("<meta http-equiv='X-UA-Compatible' content='IE=EmulateIE7'/>");o.push("<style>");o.push(".viewContainer {font-family: monospace; font-size: 10pt;}");o.push(".view {padding: 1px 2px;}");o.push(".viewContent {}");o.push("</style>");if(g.stylesheet)for(var r=typeof g.stylesheet==="string"?[g.stylesheet]:g.stylesheet,v=0;v<r.length;v++)try{var z=new XMLHttpRequest;z.overrideMimeType&&z.overrideMimeType("text/css");
z.open("GET",r[v],false);z.send(null);o.push("<style>");o.push(z.responseText);o.push("</style>")}catch(B){o.push("<link rel='stylesheet' type='text/css' href='");o.push(r[v]);o.push("'></link>")}o.push("</head>");o.push("<body spellcheck='false'></body>");o.push("</html>");this._frameWindow=r=n.contentWindow;this._frameDocument=n=r.document;n.open();n.write(o.join(""));n.close();o=n.body;o.className="viewContainer";o.style.margin="0px";o.style.borderWidth="0px";o.style.padding="0px";if(m){this._touchDiv=
v=l.createElement("DIV");v.style.position="absolute";v.style.border="0px";v.style.padding="0px";v.style.margin="0px";v.style.zIndex="2";v.style.overflow="hidden";v.style.background="transparent";v.style.WebkitUserSelect="none";j.appendChild(v);this._textArea=j=l.createElement("TEXTAREA");j.style.position="absolute";j.style.whiteSpace="pre";j.style.left="-1000px";j.tabIndex=1;j.autocapitalize=false;j.autocorrect=false;j.className="viewContainer";j.style.background="transparent";j.style.color="transparent";
j.style.border="0px";j.style.padding="0px";j.style.margin="0px";j.style.borderRadius="0px";j.style.WebkitAppearance="none";j.style.WebkitTapHighlightColor="transparent";v.appendChild(j)}l=n.createElement("DIV");l.className="view";this._viewDiv=l;l.id="viewDiv";l.tabIndex=-1;l.style.overflow="auto";l.style.position="absolute";l.style.top="0px";l.style.borderWidth="0px";l.style.margin="0px";l.style.MozOutline="none";l.style.outline="none";o.appendChild(l);this._scrollDiv=j=n.createElement("DIV");j.id=
"scrollDiv";j.style.margin="0px";j.style.borderWidth="0px";j.style.padding="0px";l.appendChild(j);this._fullSelection=g.fullSelection===undefined||g.fullSelection;if(c<9)this._fullSelection=false;if(m||this._fullSelection&&!i){this._hightlightRGB="Highlight";this._selDiv1=l=n.createElement("DIV");l.id="selDiv1";l.style.position="fixed";l.style.borderWidth="0px";l.style.margin="0px";l.style.padding="0px";l.style.MozOutline="none";l.style.outline="none";l.style.background=this._hightlightRGB;l.style.width=
"0px";l.style.height="0px";j.appendChild(l);this._selDiv2=v=n.createElement("DIV");v.id="selDiv2";v.style.position="fixed";v.style.borderWidth="0px";v.style.margin="0px";v.style.padding="0px";v.style.MozOutline="none";v.style.outline="none";v.style.background=this._hightlightRGB;v.style.width="0px";v.style.height="0px";j.appendChild(v);this._selDiv3=z=n.createElement("DIV");z.id="selDiv3";z.style.position="fixed";z.style.borderWidth="0px";z.style.margin="0px";z.style.padding="0px";z.style.MozOutline=
"none";z.style.outline="none";z.style.background=this._hightlightRGB;z.style.width="0px";z.style.height="0px";j.appendChild(z);if(d&&p){r=r.getComputedStyle(z,null).getPropertyValue("background-color");switch(r){case "rgb(119, 141, 168)":r="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":r="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":r="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":r="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":r="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":r=
"rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":r="rgb(232, 184, 255)";break;default:r="rgb(180, 213, 255)";break}this._hightlightRGB=r;l.style.background=r;v.style.background=r;z.style.background=r;n.styleSheets[0].insertRule("::-moz-selection {background: "+r+"; }",0)}}r=n.createElement("DIV");r.className="viewContent";this._clientDiv=r;r.id="clientDiv";r.style.whiteSpace="pre";r.style.position="fixed";r.style.borderWidth="0px";r.style.margin="0px";r.style.padding="0px";r.style.MozOutline="none";
r.style.outline="none";if(m)r.style.WebkitTapHighlightColor="transparent";j.appendChild(r);if(d){this._overlayDiv=n=n.createElement("DIV");n.id="overlayDiv";n.style.position=r.style.position;n.style.borderWidth=r.style.borderWidth;n.style.margin=r.style.margin;n.style.padding=r.style.padding;n.style.cursor="text";n.style.zIndex="1";j.appendChild(n)}if(!m)r.contentEditable="true";this._lineHeight=this._calculateLineHeight();this._viewPadding=this._calculatePadding();if(c)o.style.lineHeight=this._lineHeight+
"px";if(g.tabSize)if(e)r.style.OTabSize=g.tabSize+"";else if(d>=4)r.style.MozTabSize=g.tabSize+"";else if(g.tabSize!==8)this._tabSize=g.tabSize;this._createActions();this._hookEvents();this._updatePage()},_modifyContent:function(g,j){if(!(this.readonly&&!g._code)){this.onVerify(g);if(!(g.text===null||g.text===undefined)){var l=this._model;if(g._ignoreDOMSelection)this._ignoreDOMSelection=true;l.setText(g.text,g.start,g.end);if(g._ignoreDOMSelection)this._ignoreDOMSelection=false;if(j){j=this._getSelection();
j.setCaret(g.start+g.text.length);this._setSelection(j,true)}this.onModify({})}}},_onModelChanged:function(g,j,l,n,o){this.onModelChanged({start:g,removedCharCount:j,addedCharCount:l,removedLineCount:n,addedLineCount:o});var r=this._getSelection();if(r.end>g){if(r.end>g&&r.start<g+j)r.setCaret(g+l);else{r.start+=l-j;r.end+=l-j}this._setSelection(r,false,false)}g=this._model.getLineAtOffset(g);for(j=this._getLineNext();j;){l=j.lineIndex;if(g<=l&&l<=g+n)j.lineChanged=true;if(l>g+n)j.lineIndex=l+o-n;
j=this._getLineNext(j)}if(g<=this._maxLineIndex&&this._maxLineIndex<=g+n){this._maxLineIndex=-1;this._maxLineWidth=0}this._updatePage()},_onModelChanging:function(g,j,l,n,o,r){this.onModelChanging({text:g,start:j,removedCharCount:l,addedCharCount:n,removedLineCount:o,addedLineCount:r})},_queueUpdatePage:function(){if(!this._updateTimer){var g=this;this._updateTimer=setTimeout(function(){g._updateTimer=null;g._updatePage()},0)}},_resizeTouchDiv:function(){for(var g=this._viewDiv.getBoundingClientRect(),
j=this._frame.getBoundingClientRect(),l=this._frame;l;){if(l.style&&l.style.top)break;l=l.parentNode}var n=j.top;if(l)n-=l.getBoundingClientRect().top;else n+=this._parentDocument.body.scrollTop;for(l=this._frame;l;){if(l.style&&l.style.left)break;l=l.parentNode}j=j.left;if(l)j-=l.getBoundingClientRect().left;else j+=this._parentDocument.body.scrollLeft;l=this._touchDiv;l.style.left=j+g.left+"px";l.style.top=n+g.top+"px";l.style.width=g.width+"px";l.style.height=g.height+"px"},_scrollView:function(g,
j){this._ensureCaretVisible=false;var l=this._viewDiv;if(g)l.scrollLeft+=g;if(j)l.scrollTop+=j},_setClipboardText:function(g,j){var l;if(this._frameWindow.clipboardData){l=[];this._convertDelimiter(g,function(B){l.push(B)},function(){l.push(q)});return this._frameWindow.clipboardData.setData("Text",l.join(""))}if(k||d||!j){var n=this._frameWindow,o=this._frameDocument,r=o.createElement("PRE");r.style.position="fixed";r.style.left="-1000px";this._convertDelimiter(g,function(B){r.appendChild(o.createTextNode(B))},
function(){r.appendChild(o.createElement("BR"))});r.appendChild(o.createTextNode(" "));this._clientDiv.appendChild(r);g=o.createRange();g.setStart(r.firstChild,0);g.setEndBefore(r.lastChild);n=n.getSelection();n.rangeCount>0&&n.removeAllRanges();n.addRange(g);var v=this;n=function(){v._clientDiv.removeChild(r);v._updateDOMSelection()};g=false;this._ignoreCopy=true;try{g=o.execCommand("copy",false,null)}catch(z){}this._ignoreCopy=false;if(!g)if(j){setTimeout(n,0);return false}n();return true}if(j&&
j.clipboardData){l=[];this._convertDelimiter(g,function(B){l.push(B)},function(){l.push(q)});return j.clipboardData.setData("text/plain",l.join(""))}},_setDOMSelection:function(g,j,l,n){for(var o=this._frameWindow,r=this._frameDocument,v,z,B,D,E=0,F=g.firstChild,J,K,O=this._model.getLine(g.lineIndex).length;F;){J=F.firstChild;K=J.length;if(F.ignoreChars)K-=F.ignoreChars;if(E+K>j||E+K>=O){v=J;z=j-E;if(F.ignoreChars&&K>0&&z===K)z+=F.ignoreChars;break}E+=K;F=F.nextSibling}E=0;F=l.firstChild;for(var R=
this._model.getLine(l.lineIndex).length;F;){J=F.firstChild;K=J.length;if(F.ignoreChars)K-=F.ignoreChars;if(K+E>n||E+K>=R){B=J;D=n-E;if(F.ignoreChars&&K>0&&D===K)D+=F.ignoreChars;break}E+=K;F=F.nextSibling}this._setDOMFullSelection(g,j,O,l,n,R);if(!m)if(o.getSelection){r=r.createRange();r.setStart(v,z);r.setEnd(B,D);B=o.getSelection();this._ignoreSelect=false;B.rangeCount>0&&B.removeAllRanges();B.addRange(r);this._ignoreSelect=true}else if(r.selection){o=r.body;r=r.createElement("DIV");o.appendChild(r);
o.removeChild(r);r=o.createTextRange();r.moveToElementText(v.parentNode);r.moveStart("character",z);v=o.createTextRange();v.moveToElementText(B.parentNode);v.moveStart("character",D);r.setEndPoint("EndToStart",v);this._ignoreSelect=false;r.select();this._ignoreSelect=true}},_setDOMFullSelection:function(g,j,l,n,o,r){var v=this._model;if(this._selDiv1){var z,B;z=this._getLineBoundingClientRect(g);if(j===0)B=z.left;else if(j>=l)B=z.right;else{this._ignoreDOMSelection=true;B=this._getBoundsAtOffset(v.getLineStart(g.lineIndex)+
j).left;this._ignoreDOMSelection=false}if(l=this._textArea){l.selectionStart=l.selectionEnd=0;var D=this._frame.getBoundingClientRect(),E=this._touchDiv.getBoundingClientRect(),F=this._viewDiv.getBoundingClientRect();l.style.left=!(F.left<=B&&B<=F.left+F.width&&F.top<=z.top&&z.top<=F.top+F.height)||!(g===n&&j===o)?"-1000px":B-4+D.left-E.left+"px";l.style.top=z.top+D.top-E.top+"px";l.style.width="6px";l.style.height=z.bottom-z.top+"px"}l=this._selDiv1;l.style.width="0px";l.style.height="0px";l=this._selDiv2;
l.style.width="0px";l.style.height="0px";l=this._selDiv3;l.style.width="0px";l.style.height="0px";if(!(g===n&&j===o)){D=m?2:0;E=D+"px blue solid";F=this._getViewPadding();var J=this._clientDiv.getBoundingClientRect(),K=this._viewDiv.getBoundingClientRect();j=K.left+F.left;l=J.right;F=K.top+F.top;J=J.bottom;K=this._getLineBoundingClientRect(n);if(o===0)o=K.left;else if(o>=r)o=K.right;else{this._ignoreDOMSelection=true;o=this._getBoundsAtOffset(v.getLineStart(n.lineIndex)+o).left;this._ignoreDOMSelection=
false}r=this._selDiv1;B=Math.min(l,Math.max(j,B));v=Math.min(J,Math.max(F,z.top));var O=l;z=Math.min(J,Math.max(F,z.bottom));r.style.left=B+"px";r.style.top=v+"px";r.style.width=Math.max(0,O-B)+"px";r.style.height=Math.max(0,z-v)+(m?1:0)+"px";if(m){r.style.borderLeft=E;r.style.borderRight="0px"}if(g===n){O=Math.min(o,l);r.style.width=Math.max(0,O-B-D*2)+"px";if(m)r.style.borderRight=E}else{g=Math.min(J,Math.max(F,K.top));n=Math.min(l,Math.max(j,o));B=Math.min(J,Math.max(F,K.bottom));o=this._selDiv3;
o.style.left=j+"px";o.style.top=g+"px";o.style.width=Math.max(0,n-j-D)+"px";o.style.height=Math.max(0,B-g)+"px";if(m)o.style.borderRight=E;if(g-z>0){n=this._selDiv2;n.style.left=j+"px";n.style.top=z+"px";n.style.width=Math.max(0,l-j)+"px";n.style.height=Math.max(0,g-z)+(m?1:0)+"px"}}}}},_setGrab:function(g){if(g!==this._grabControl)if(g){b(g,"mousemove",this._mouseMoveClosure);b(g,"mouseup",this._mouseUpClosure);g.setCapture&&g.setCapture();this._grabControl=g}else{f(this._grabControl,"mousemove",
this._mouseMoveClosure);f(this._grabControl,"mouseup",this._mouseUpClosure);this._grabControl.releaseCapture&&this._grabControl.releaseCapture();this._grabControl=null}},_setSelection:function(g,j,l){if(g){this._columnX=-1;if(l===undefined)l=true;var n=this._selection;if(!n.equals(g)){this._selection=g;this.onSelection({oldValue:{start:n.start,end:n.end},newValue:{start:g.start,end:g.end}})}if(j)l=!this._showCaret();l&&this._updateDOMSelection()}},_setSelectionTo:function(g,j,l){var n=this._model,
o=this._getSelection();j=this._getYToLine(j);if(this._clickCount===1){n=this._getXToOffset(j,g);o.extend(n);l||o.collapse()}else{if((this._clickCount&1)===0){n=this._getXToOffset(j,g);if(this._doubleClickSelection)if(n>=this._doubleClickSelection.start){l=this._doubleClickSelection.start;n=this._getOffset(n,"wordend",+1)}else{l=this._getOffset(n,"word",-1);n=this._doubleClickSelection.end}else{l=this._getOffset(n,"word",-1);n=this._getOffset(l,"wordend",+1)}}else if(this._doubleClickSelection){g=
n.getLineAtOffset(this._doubleClickSelection.start);if(j>=g){l=n.getLineStart(g);n=n.getLineEnd(j)}else{l=n.getLineStart(j);n=n.getLineEnd(g)}}else{l=n.getLineStart(j);n=n.getLineEnd(j)}o.setCaret(l);o.extend(n)}this._setSelection(o,true,true)},_showCaret:function(){var g=this._model,j=this._getSelection(),l=this._getScroll(),n=j.getCaret(),o=j.start,r=j.end,v=g.getLineAtOffset(o),z=g.getLineAtOffset(r),B=Math.max(Math.max(o,g.getLineStart(z)),r-1),D=this._getViewPadding(),E=this._getClientWidth(),
F=D.left;D=D.left+E;var J=this._getBoundsAtOffset(n===o?o:B),K=J.left,O=J.right,R=E/4;if(!j.isEmpty()&&v===z){J=this._getBoundsAtOffset(n===r?o:B);if(E-R>(n===o?J.right-K:O-J.left)){if(K>J.left)K=J.left;if(O<J.right)O=J.right}}j=this._viewDiv.getBoundingClientRect();K-=j.left;O-=j.left;j=0;if(K<F)j=Math.min(K-F,-R);if(O>D)j=Math.min(this._scrollDiv.scrollWidth-l.x-E,Math.max(O-D,R));F=0;K=this._getTopIndex(true);O=this._getBottomIndex(true);g=g.getLineAtOffset(n);D=this._getClientHeight();if(!(K<=
g&&g<=O)){K=this._getLineHeight();v=(z-v)*K;F=g*K;F-=l.y;if(F+K>D){F-=D-K;if(n===o&&o!==r)F+=Math.min(D-K,v)}else if(n===r)F-=Math.min(D-K,v)}if(j!==0||F!==0){this._scrollView(j,F);if(D!==this._getClientHeight()||E!==this._getClientWidth())this._showCaret();else this._ensureCaretVisible=true;return true}return false},_startIME:function(){if(this._imeOffset===-1){var g=this._getSelection();g.isEmpty()||this._modifyContent({text:"",start:g.start,end:g.end},true);this._imeOffset=g.start}},_unhookEvents:function(){this._model.removeListener(this._modelListener);
this._mouseUpClosure=this._mouseMoveClosure=this._modelListener=null;for(var g=0;g<this._handlers.length;g++){var j=this._handlers[g];f(j.target,j.type,j.handler)}this._handlers=null},_updateDOMSelection:function(){if(!this._ignoreDOMSelection){var g=this._getSelection(),j=this._model,l=j.getLineAtOffset(g.start),n=j.getLineAtOffset(g.end),o=this._getLineNext();if(o){var r=this._getLinePrevious(),v;if(l<o.lineIndex){v=o;l=0}else if(l>r.lineIndex){v=r;l=0}else{v=this._getLineNode(l);l=g.start-j.getLineStart(l)}if(n<
o.lineIndex){o=o;g=0}else if(n>r.lineIndex){o=r;g=0}else{o=this._getLineNode(n);g=g.end-j.getLineStart(n)}this._setDOMSelection(v,l,o,g)}}},_updatePage:function(){function g(C){if(C){for(var H=K+v.top+v.bottom,N=C.firstChild.rows[0].cells,Q=0;Q<N.length;Q++){var S=N[Q].firstChild,W=B;if(S._ruler.getOverview()==="page")W+=O;S.style.top=-W+"px";S.style.height=H+W+"px"}C.style.height=H+"px"}}if(this._updateTimer){clearTimeout(this._updateTimer);this._updateTimer=null}var j=this._frameDocument,l=this._getFrameWidth(),
n=this._getFrameHeight();j.body.style.width=l+"px";j.body.style.height=n+"px";var o=this._viewDiv,r=this._clientDiv,v=this._getViewPadding();o.style.height=Math.max(0,n-v.top-v.bottom)+"px";var z=this._model,B=this._getLineHeight();n=this._getScroll().y;var D=Math.max(0,n)/B,E=Math.floor(D),F=Math.max(0,E-1);n=Math.round((D-F)*B);var J=z.getLineCount(),K=this._getClientHeight(),O=Math.round((D-E)*B);D=Math.floor((K+O)/B);D=Math.min(E+D,J-1);var R=Math.min(D+1,J-1);this._partialY=O;for(var X,P=r.firstChild;P;){X=
P.lineIndex;var da=P.nextSibling;if(!(F<=X&&X<=R)||P.lineChanged||P.lineIndex===-1)if(this._mouseWheelLine===P){P.style.display="none";P.lineIndex=-1}else r.removeChild(P);P=da}P=this._getLineNext();da=j.createDocumentFragment();for(X=F;X<=R;X++)if(!P||P.lineIndex>X)this._createLine(da,null,j,X,z);else{if(da.firstChild){r.insertBefore(da,P);da=j.createDocumentFragment()}P=this._getLineNext(P)}da.firstChild&&r.insertBefore(da,P);if(i)r.style.width=(524287).toString()+"px";for(P=this._getLineNext();P;){j=
P.lineWidth;if(j===undefined){j=this._getLineBoundingClientRect(P);j=P.lineWidth=j.right-j.left}if(j>=this._maxLineWidth){this._maxLineWidth=j;this._maxLineIndex=P.lineIndex}if(P.lineIndex===E)this._topChild=P;if(P.lineIndex===D)this._bottomChild=P;P=this._getLineNext(P)}this._updateRuler(this._leftDiv,E,D);this._updateRuler(this._rightDiv,E,D);j=this._leftDiv?this._leftDiv.scrollWidth:0;E=this._rightDiv?this._rightDiv.scrollWidth:0;o.style.left=j+"px";o.style.width=Math.max(0,l-j-E-v.left-v.right)+
"px";if(this._rightDiv)this._rightDiv.style.left=l-E+"px";E=this._scrollDiv;l=J*B;E.style.height=l+"px";o=this._getClientWidth();J=z=Math.max(this._maxLineWidth,o);if(!c||c>=9)z+=v.right;E.style.width=z+"px";E=this._getScroll();F=z=E.x;D=n;P=z+o;R=n+K;if(F===0)F-=v.left;if(D===0)D-=v.top;if(P===J)P+=v.right;if(E.y+K===l)R+=v.bottom;r.style.clip="rect("+D+"px,"+P+"px,"+R+"px,"+F+"px)";r.style.left=-z+j+v.left+"px";r.style.top=-n+v.top+"px";r.style.width=(i?J:o+z)+"px";r.style.height=K+n+"px";if(n=
this._overlayDiv){n.style.clip=r.style.clip;n.style.left=r.style.left;n.style.top=r.style.top;n.style.width=r.style.width;n.style.height=r.style.height}g(this._leftDiv);g(this._rightDiv);if(m){var A=this;setTimeout(function(){A._resizeTouchDiv()},0)}this._updateDOMSelection();r=this._ensureCaretVisible;this._ensureCaretVisible=false;if(K!==this._getClientHeight()){this._updatePage();r&&this._showCaret()}},_updateRuler:function(g,j,l){if(g){g=g.firstChild.rows[0].cells;for(var n=this._getLineHeight(),
o=this._frameDocument,r=this._getViewPadding(),v=0;v<g.length;v++){var z=g[v].firstChild,B=z._ruler;z.rulerChanged&&this._applyStyle(B.getStyle(),z);var D,E=z.firstChild;if(E){D=E;E=E.nextSibling}else{D=o.createElement("DIV");D.style.visibility="hidden";z.appendChild(D)}var F;if(z.rulerChanged)if(D){F=-1;this._applyStyle(B.getStyle(F),D);D.innerHTML=B.getHTML(F);D.lineIndex=F;D.style.height=n+r.top+"px"}var J;if(B.getOverview()==="page"){for(;E;){F=E.lineIndex;D=E.nextSibling;if(!(j<=F&&F<=l)||E.lineChanged)z.removeChild(E);
E=D}E=z.firstChild.nextSibling;J=document.createDocumentFragment();for(F=j;F<=l;F++)if(!E||E.lineIndex>F){D=o.createElement("DIV");this._applyStyle(B.getStyle(F),D);D.innerHTML=B.getHTML(F);D.lineIndex=F;D.style.height=n+"px";J.appendChild(D)}else{if(J.firstChild){z.insertBefore(J,E);J=document.createDocumentFragment()}if(E)E=E.nextSibling}J.firstChild&&z.insertBefore(J,E)}else{E=this._getClientHeight()+r.top+r.bottom-34;F=this._model.getLineCount();var K=E/F;if(z.rulerChanged){for(F=z.childNodes.length;F>
1;){z.removeChild(z.lastChild);F--}var O=B.getAnnotations();J=document.createDocumentFragment();for(var R=0;R<O.length;R++){F=O[R];D=o.createElement("DIV");this._applyStyle(B.getStyle(F),D);D.style.position="absolute";D.style.top=17+n+Math.floor(F*K)+"px";D.innerHTML=B.getHTML(F);D.lineIndex=F;J.appendChild(D)}z.appendChild(J)}else if(z._oldTrackHeight!==E)for(D=z.firstChild?z.firstChild.nextSibling:null;D;){D.style.top=17+n+Math.floor(D.lineIndex*K)+"px";D=D.nextSibling}z._oldTrackHeight=E}z.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});var examples=examples||{};examples.textview=examples.textview||{};
examples.textview.TextStyler=function(){function b(s,q){this.commentStart="/*";this.commentEnd="*/";var x=[];switch(q){case "java":x=a;break;case "js":x=f;break;case "css":x=c;break}this.whitespacesVisible=false;this.highlightCaretLine=true;this._scanner=new y(x,this.whitespacesVisible);if(q==="css")this._scanner.isCSS=true;this._whitespaceScanner=new u;this.view=s;this.commentOffset=0;this.commentOffsets=[];this._matchingBracket=this._currentBracket=undefined;s.addEventListener("Selection",this,
this._onSelection);s.addEventListener("ModelChanged",this,this._onModelChanged);s.addEventListener("Destroy",this,this._onDestroy);s.addEventListener("LineStyle",this,this._onLineStyle);s.redrawLines()}var f=["break","continue","do","for","new","this","case","default","else","function","in","return","typeof","while","comment","delete","export","if","switch","var","with","abstract","implements","protected","public","interface","static","synchronized","false","throws","final","null","transient","package",
"true","goto","private","catch","enum","throw","class","extends","try","const","finally","debugger","super","undefined"],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"],d={styleClass:"token_comment"},e={styleClass:"token_javadoc"},k={styleClass:"token_string"},h={styleClass:"token_keyword"},i={styleClass:"token_space"},m={styleClass:"token_tab"},p={styleClass:(document.selection&&window.ActiveXObject&&/MSIE/.test(navigator.userAgent)?document.documentMode:undefined)<9?"token_bracket":"token_bracket_outline"},t={styleClass:"line_caret"},
y=function(){function s(q,x){this.keywords=q;this.whitespacesVisible=x;this.setText("")}s.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},_read:function(){if(this.offset<this.text.length)return this.text.charCodeAt(this.offset++);return-1},_unread:function(q){q!==-1&&this.offset--},nextToken:function(){for(this.startOffset=
this.offset;;){var q=this._read();switch(q){case -1:return null;case 47:q=this._read();if(q===47)for(;;){q=this._read();if(q===-1||q===10){this._unread(q);return 4}}this._unread(q);return 1;case 39:for(;;){q=this._read();switch(q){case 39:return 3;case -1:this._unread(q);return 3;case 92:this._read();break}}break;case 34:for(;;){q=this._read();switch(q){case 34:return 3;case -1:this._unread(q);return 3;case 92:this._read();break}}break;case 32:case 9:if(this.whitespacesVisible)return q===32?7:6;do q=
this._read();while(q===32||q===9);this._unread(q);return 5;default:var x=this.isCSS;if(97<=q&&q<=122||65<=q&&q<=90||q===95||48<=q&&q<=57||45===q&&x){var w=this.offset-1;do q=this._read();while(97<=q&&q<=122||65<=q&&q<=90||q===95||48<=q&&q<=57||45===q&&x);this._unread(q);q=this.text.substring(w,this.offset);for(x=0;x<this.keywords.length;x++)if(this.keywords[x]===q)return 2}return 1}}},setText:function(q){this.text=q;this.startOffset=this.offset=0}};return s}(),u=function(){function s(){y.call(this,
null,true)}s.prototype=new y(null);s.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var q=this._read();switch(q){case -1:return null;case 32:return 7;case 9:return 6;default:do q=this._read();while(!(q===32||q===9||q===-1));this._unread(q);return 1}}};return s}();b.prototype={destroy:function(){var s=this.view;if(s){s.removeEventListener("Selection",this,this._onSelection);s.removeEventListener("ModelChanged",this,this._onModelChanged);s.removeEventListener("Destroy",this,this._onDestroy);
s.removeEventListener("LineStyle",this,this._onLineStyle);this.view=null}},setHighlightCaretLine:function(s){this.highlightCaretLine=s},setWhitespacesVisible:function(s){this.whitespacesVisible=s;this._scanner.whitespacesVisible=s},_binarySearch:function(s,q,x,w){for(;w-x>2;){var g=w+x>>1>>1<<1;if(s[g+1]>q)w=g;else x=g}return w},_computeComments:function(s){if(!(s<=this.commentOffset)){var q=this.view.getModel(),x=q.getCharCount();q=q.getText(this.commentOffset,s);this.commentOffsets.length>1&&this.commentOffsets[this.commentOffsets.length-
1]===x&&this.commentOffsets.length--;for(var w=0;w<q.length;){var g=(this.commentOffsets.length&1)===0,j=g?this.commentStart:this.commentEnd;w=q.indexOf(j,w);if(w!==-1)this.commentOffsets.push(this.commentOffset+(g?w:w+j.length));else break;w=w+j.length}(this.commentOffsets.length&1)===1&&this.commentOffsets.push(x);this.commentOffset=s}},_getCommentRanges:function(s,q){this._computeComments(q);var x=this.commentOffsets.length;s=this._binarySearch(this.commentOffsets,s,-1,x);if(s>=x)return[];if(this.commentOffsets[s]>
q)return[];x=Math.min(x-2,this._binarySearch(this.commentOffsets,q,s-1,x));if(this.commentOffsets[x]>q)x=Math.max(s,x-2);return this.commentOffsets.slice(s,x+2)},_getLineStyle:function(s){if(this.highlightCaretLine){var q=this.view,x=q.getModel();q=q.getSelection();if(q.start===q.end&&x.getLineAtOffset(q.start)===s)return t}return null},_getStyles:function(s,q){for(var x=q+s.length,w=this.view.getModel(),g=this._getCommentRanges(q,x),j=[],l=q,n=0;n<g.length;n+=2){var o=g[n];l<o&&this._parse(s.substring(l-
q,o-q),l,j);var r=d;if(g[n+1]-o>this.commentStart.length+this.commentEnd.length){var v=o+this.commentStart.length;if(w.getText(v,v+1)==="*")r=e}if(this.whitespacesVisible){l=Math.max(l,o);o=Math.min(x,g[n+1]);this._parseWhitespace(s.substring(l-q,o-q),l,j,r)}else j.push({start:g[n],end:g[n+1],style:r});l=g[n+1]}l<x&&this._parse(s.substring(l-q,x-q),l,j);return j},_parse:function(s,q,x){var w=this._scanner;for(w.setText(s);s=w.nextToken();){var g=w.getStartOffset()+q,j=null;if(g===this._matchingBracket)j=
p;else switch(s){case 2:j=h;break;case 3:if(this.whitespacesVisible){this._parseWhitespace(w.getData(),g,x,k);continue}else j=k;break;case 4:if(this.whitespacesVisible){this._parseWhitespace(w.getData(),g,x,d);continue}else j=d;break;case 6:if(this.whitespacesVisible)j=m;break;case 7:if(this.whitespacesVisible)j=i;break}x.push({start:g,end:w.getOffset()+q,style:j})}},_parseWhitespace:function(s,q,x,w){var g=this._whitespaceScanner;for(g.setText(s);s=g.nextToken();){var j=g.getStartOffset()+q,l=w;
switch(s){case 6:l=m;break;case 7:l=i;break}x.push({start:j,end:g.getOffset()+q,style:l})}},_findBrackets:function(s,q,x,w,g,j){for(var l=[],n=this._getCommentRanges(g,j),o=g,r=this._scanner,v,z=0;z<n.length;z+=2){v=n[z];if(o<v)for(r.setText(x.substring(o-g,v-g));r.nextToken();)if(r.getDataLength()===1){v=r.getData();v===s&&l.push(r.getStartOffset()+o-g+w);v===q&&l.push(-(r.getStartOffset()+o-g+w))}o=n[z+1]}if(o<j)for(r.setText(x.substring(o-g,j-g));r.nextToken();)if(r.getDataLength()===1){v=r.getData();
v===s&&l.push(r.getStartOffset()+o-g+w);v===q&&l.push(-(r.getStartOffset()+o-g+w))}return l},_onDestroy:function(){this.destroy()},_onLineStyle:function(s){s.style=this._getLineStyle(s.lineIndex);s.ranges=this._getStyles(s.lineText,s.lineStart)},_onSelection:function(s){var q=s.oldValue,x=s.newValue;s=this.view;var w=s.getModel(),g;if(this._matchingBracket!==undefined){g=w.getLineAtOffset(this._matchingBracket);s.redrawLines(g,g+1);this._matchingBracket=this._currentBracket=undefined}if(this.highlightCaretLine){var j=
w.getLineAtOffset(q.start);g=w.getLineAtOffset(x.start);var l=x.start===x.end;q=q.start===q.end;if(!(j===g&&q&&l)){q&&s.redrawLines(j,j+1);if((j!==g||!q)&&l)s.redrawLines(g,g+1)}}if(!(x.start!==x.end||x.start===0)){j=s.getCaretOffset();if(j!==0){l="{}()[]<>";q=w.getText(j-1,j);var n=l.indexOf(q,0);if(n!==-1){x=n&1?l.substring(n-1,n):l.substring(n+1,n+2);g=w.getLineAtOffset(j);l=w.getLine(g);var o=w.getLineStart(g),r=w.getLineEnd(g);l=this._findBrackets(q,x,l,o,o,r);for(r=0;r<l.length;r++){o=l[r]>=
0?1:-1;if(l[r]*o===j-1){j=1;this._currentBracket=l[r]*o;if(n&1){for(r--;r>=0;r--){o=l[r]>=0?1:-1;j+=o;if(j===0){this._matchingBracket=l[r]*o;s.redrawLines(g,g+1);return}}for(g-=1;g>=0;){l=w.getLine(g);o=w.getLineStart(g);r=w.getLineEnd(g);l=this._findBrackets(q,x,l,o,o,r);for(n=l.length-1;n>=0;n--){o=l[n]>=0?1:-1;j+=o;if(j===0){this._matchingBracket=l[n]*o;s.redrawLines(g,g+1);return}}g--}}else{for(r++;r<l.length;r++){o=l[r]>=0?1:-1;j+=o;if(j===0){this._matchingBracket=l[r]*o;s.redrawLines(g,g+1);
return}}g+=1;for(n=w.getLineCount();g<n;){l=w.getLine(g);o=w.getLineStart(g);r=w.getLineEnd(g);l=this._findBrackets(q,x,l,o,o,r);for(r=0;r<l.length;r++){o=l[r]>=0?1:-1;j+=o;if(j===0){this._matchingBracket=l[r]*o;s.redrawLines(g,g+1);return}}g++}}break}}}}}},_onModelChanged:function(s){var q=s.start,x=s.removedCharCount;s=s.addedCharCount;if(this._matchingBracket&&q<this._matchingBracket)this._matchingBracket+=s+x;if(this._currentBracket&&q<this._currentBracket)this._currentBracket+=s+x;if(!(q>=this.commentOffset)){var w=
this.view.getModel(),g=this.commentOffsets.length,j=Math.max(this.commentStart.length-1,this.commentEnd.length-1);if(g===0)this.commentOffset=Math.max(0,q-j);else{var l=w.getCharCount(),n=l-s+x,o=this._binarySearch(this.commentOffsets,q,-1,g),r=q+x,v=this._binarySearch(this.commentOffsets,r,o-1,g),z;if(o>0)z=this.commentOffsets[--o];else{z=Math.max(0,Math.min(this.commentOffsets[o],q)-j);--o}var B;g=l;if(v+1<this.commentOffsets.length){B=this.commentOffsets[++v];if(r>B-this.commentEnd.length)if(v+
2<this.commentOffsets.length){v+=2;B=this.commentOffsets[v];g=B+1;if(g>q)g+=s-x}else this.commentOffset=B=Math.min(n,r+j)}else{this.commentOffset=B=Math.min(n,r+j);if(v>0&&v===this.commentOffsets.length)v=this.commentOffsets.length-1}if(z>q)z+=s-x;if(B>q)B+=s-x;this.commentOffsets.length>1&&this.commentOffsets[this.commentOffsets.length-1]===n&&this.commentOffsets.length--;n=0;j=[];w=w.getText(z,B);if(this.commentOffset<B)this.commentOffset=B;for(;n<w.length;){r=(B=(o+1+j.length&1)===0)?this.commentStart:
this.commentEnd;n=w.indexOf(r,n);if(n!==-1)j.push(z+(B?n:n+r.length));else break;n=n+r.length}z=v-o!==j.length;if(!z)for(w=0;w<j.length;w++){n=this.commentOffsets[o+1+w];if(n>q)n+=s-x;if(n!==j[w]){z=true;break}}v=[o+1,v-o].concat(j);Array.prototype.splice.apply(this.commentOffsets,v);for(o=o+1+j.length;o<this.commentOffsets.length;o++)this.commentOffsets[o]+=s-x;(this.commentOffsets.length&1)===1&&this.commentOffsets.push(l);z&&this.view.redrawRange(q+s,g)}}}};return b}();
typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("examples/textview/textStyler",[],function(){return examples.textview});
define("orion/compare/compare-container",["dojo","orion/compare/diff-parser","orion/compare/rulers","orion/compare/compare-model","orion/compare/compare-m-model","orion/editor/contentAssist","orion/editorCommands","orion/editor/editor","orion/editor/editorFeatures","orion/globalCommands","orion/breadcrumbs","orion/compare/gap-model","orion/commands","orion/textview/textModel","orion/textview/textView","examples/textview/textStyler"],function(b,f,a,c,d,e,k,h,i,m,p,t,y,u,s,q){var x={};x.CompareContainer=
function(){function w(){this._diffParser=new f.DiffParser;this._input=this._diff=null}w.prototype={_getLineDelim:function(){return"\n"},setDiffProvider:function(g){this._diffProvider=g},getFileDiff:function(g,j,l,n){var o=this;this._diffProvider.getDiffContent(g,function(r){o._diff=o._conflict?r.split("diff --git")[1]:r;n?o.setEditor(this._input,o._diff,n):o.getFileURI(g,j,l)},l)},getFileURI:function(g,j,l){var n=this;this._diffProvider.getDiffFileURI(g,function(o){n._oldFileURI=o.Git.Old;n._newFileURI=
o.Git.New;n.getFileContent(o.Git.Old,l);j&&j(o.Git.New,o.Git.Old)},l)},getFileContent:function(g,j){var l=this;l._registry.getService("orion.core.file").then(function(n){n.read(g).then(function(o){this._input=o;l.setEditor(o,l._diff)},function(o,r){if(o.status===404){this._input="";l.setEditor("",l._diff)}else j&&j(o,r)})})},parseMapper:function(g,j,l,n){var o=this._getLineDelim(g,j);this._diffParser.setLineDelim(o);g=this._diffParser.parse(g,j,l,n);j=this._diffParser.getDiffArray();return{delim:o,
mapper:g.mapper,output:g.outPutFile,diffArray:j}},resolveDiff:function(g,j,l,n){var o=g;g=g.split("?");if(g.length===2){o=g[0];g=g[1].split("=");if(g.length===2&&g[0]==="conflict"&&g[1]==="true")this._conflict=true}this._diffURI=o;this.getFileDiff(o,j,l,n)},resolveDiffonSave:function(){this.getFileDiff(this._diffURI,null,null,true)},_initDiffPosition:function(g){var j=g.getModel();if(j&&j.getAnnotations){j=j.getAnnotations();if(j.length>0){j=j[0][0];var l=g.getLineHeight(),n=g.getClientArea();l=Math.floor(n.height/
l/3);g.setTopIndex(j-l>0?j-l:0)}}}};return w}();x.SBSCompareContainer=function(){function w(g,j,l){this._textViewRight=this._textViewLeft=null;this._registry=g;this._leftEditorDivId=j;this._rightEditorDivId=l}w.prototype=new x.CompareContainer;w.prototype.setEditor=function(g,j){j=this.parseMapper(g,j);if(this._textViewLeft&&this._textViewRight)if(j.delim===this._textViewLeft.getModel().getLineDelimiter()){this._textViewLeft.getModel().init(j.mapper);this._textViewLeft.setText(j.output);this._textViewRight.getModel().init(j.mapper);
this._textViewRight.setText(g);this._initDiffPosition(this._textViewLeft);return}var l=new u.TextModel(j.output,j.delim);l=new c.CompareTextModel(l,{mapper:j.mapper,columnIndex:0},new t.GapLineFeeder(j.delim));g=new u.TextModel(g,j.delim);g={parent:this._rightEditorDivId,model:new c.CompareTextModel(g,{mapper:j.mapper,columnIndex:1},new t.GapLineFeeder(j.delim)),readonly:true,stylesheet:"/orion/compare/editor.css"};this._textViewRight=new s.TextView(g);this._textViewRight.addRuler(new a.LineNumberCompareRuler(0,
"left",{styleClass:"ruler_lines"},{styleClass:"ruler_lines_odd"},{styleClass:"ruler_lines_even"}));this._textViewLeft=new s.TextView({parent:this._leftEditorDivId,model:l,readonly:true,stylesheet:"/orion/compare/editor.css"});this._textViewLeft.addRuler(new a.LineNumberCompareRuler(0,"left",{styleClass:"ruler_lines"},{styleClass:"ruler_lines_odd"},{styleClass:"ruler_lines_even"}));var n=this;this._textViewLeft.addEventListener("LineStyle",window,function(o){var r=o.lineIndex;r=n._editorLeft.getModel().getLineType(r);
if(r==="added")o.style={style:{backgroundColor:"#99EE99"}};else if(r==="changed")o.style={style:{backgroundColor:"#FFDD88"}};else if(r==="removed"||r==="changed_gap")o.style={style:{backgroundColor:"#DDDDDD"}}});this._textViewLeft.addEventListener("Scroll",window,function(){n._editorRight.setTopPixel(n._editorLeft.getTopPixel())});this._textViewLeft.redrawRange();this._textViewRight.addEventListener("LineStyle",window,function(o){var r=o.lineIndex;r=n._editorRight.getModel().getLineType(r);if(r===
"removed")o.style={style:{backgroundColor:"#EE9999"}};else if(r==="changed")o.style={style:{backgroundColor:"#FFDD88"}};else if(r==="added"||r==="changed_gap")o.style={style:{backgroundColor:"#DDDDDD"}}});this._textViewRight.addEventListener("Scroll",window,function(){n._editorLeft.setTopPixel(n._editorRight.getTopPixel())});this._textViewRight.addRuler(new x.CompareOverviewRuler("right",{styleClass:"ruler_overview"}));this._initDiffPosition(this._textViewLeft);this._textViewRight.redrawRange()};
return w}();x.CompareSyntaxHighlighter=function(){function w(){this.styler=null}w.prototype={highlight:function(g,j){if(this.styler){this.styler.destroy();this.styler=null}if(g){g=g.split(".");if(g.length>0)switch(g.pop().toLowerCase()){case "js":this.styler=new q.TextStyler(j,"js");break;case "java":this.styler=new q.TextStyler(j,"java");break;case "html":break;case "xml":break;case "css":this.styler=new q.TextStyler(j,"css");break}}}};return w}();x.DiffStyler=function(){function w(g,j){this._compareMatchRenderer=
g;this._textView=j}w.prototype={highlight:function(g){this._textView&&this._textView.removeEventListener("LineStyle",this,this._onLineStyle);if(g)this._textView=g;this._textView&&!this._textView.getModel().isMapperEmpty()&&this._textView.addEventListener("LineStyle",this,this._onLineStyle)},_onLineStyle:function(g){var j=this._textView,l=g.lineIndex,n=j.getModel().getLineType(l);l=n.type;var o=j.getModel().getAnnotationIndexByMapper(n.mapperIndex);n=(j=j.getModel().isMapperConflict(n.mapperIndex))?
"#EEB4B4":"#DDDDDD";var r="url('/images/diff-border.png')";if(o===this._compareMatchRenderer.getCurrentAnnotationIndex()){n=j?"#F08080":"#BBBBBB";r="url('/images/diff-border-sel.png')"}if(l==="top-only")g.style={style:{backgroundImage:r,backgroundRepeat:"repeat-x"}};else if(l!=="unchanged")g.style={style:{backgroundColor:n}}}};return w}();x.CompareMergeStyler=function(){function w(g){this._syntaxHighlither=new x.CompareSyntaxHighlighter;this._diffHighlither=new x.DiffStyler(g)}w.prototype={highlight:function(g,
j){this._syntaxHighlither.highlight(g,j);this._diffHighlither.highlight(j)}};return w}();x.CompareMergeContainer=function(){function w(g,j,l,n,o,r){this.setDiffProvider(j);this._uiFactory=r;this.readonly=g;this._registry=l;this._commandService=n;this._leftEditorDivId=this._uiFactory.getEditorParentDivId(true);this._fileClient=o;this._rightEditorDivId=this._uiFactory.getEditorParentDivId(false);this.initCommands();var v=this;this._inputManager={filePath:"",getInput:function(){return this.filePath},
setDirty:function(z){if(z)this._lastTitle&&this._lastTitle.charAt(0)!=="*"&&this.setTitle("*"+this._lastTitle);else this._lastTitle&&this._lastTitle.charAt(0)==="*"&&this.setTitle(this._lastTitle.substring(1))},setInput:function(z){o.read(z,true).then(b.hitch(this,function(B){this._fileMetadata=B;this.setTitle(B.Location)}),b.hitch(this,function(B){console.error("Error loading file metadata: "+B.message);this.setTitle(z)}));this.lastFilePath=z},setTitle:function(z){var B=z.lastIndexOf("/"),D=z;if(B!==
-1){D="Compare "+D.substring(B+1);if(z.charAt(0)==="*")D="*"+D}this._lastTitle=D;window.document.title=D;if(B=b.byId("location")){b.empty(B);new p.BreadCrumbs({container:"location",resource:this._fileMetadata});if(z.charAt(0)==="*")b.create("b",null,B,"last").innerHTML="*"}},afterSave:function(){v.resolveDiffonSave()}};this._compareMatchRenderer=new a.CompareMatchRenderer(document.getElementById(this._uiFactory.getDiffCanvasDivId()));this._highlighter=[];this._highlighter.push(new x.CompareMergeStyler(this._compareMatchRenderer));
this._highlighter.push(new x.CompareMergeStyler(this._compareMatchRenderer));this.initEditorContainers("\n","fetching...","fetching...",[])}w.prototype=new x.CompareContainer;w.prototype.initEditorContainers=function(g,j,l,n,o,r,v){this._editorLeft=this.createEditorContainer(j,g,n,0,this._leftEditorDivId,this._uiFactory.getStatusDivId(true),this.readonly,o,r);m.generateDomCommandsInBanner(this._commandService,this._editorLeft,"pageActions",true);this._textViewLeft=this._editorLeft.getTextView();this._editorRight=
this.createEditorContainer(l,g,n,1,this._rightEditorDivId,this._uiFactory.getStatusDivId(false),true,o,v);this._textViewRight=this._editorRight.getTextView();g=new a.CompareMergeOverviewRuler(this._compareMatchRenderer,"right",{styleClass:"ruler_overview"});this._textViewRight.addRuler(g);this._compareMatchRenderer.setOverviewRuler(g);var z=this;window.onbeforeunload=function(){if(z._editorLeft.isDirty())return"There are unsaved changes."}};w.prototype.initCommands=function(){var g=this,j=new y.Command({name:"Next Diff",
image:"/images/move_down.gif",id:"orion.compare.nextDiff",groupId:"orion.compareGroup",callback:function(){g.nextDiff()}}),l=new y.Command({name:"Previous Diff",image:"/images/move_up.gif",id:"orion.compare.prevDiff",groupId:"orion.compareGroup",callback:function(){g.prevDiff()}}),n=new y.Command({name:"Copy Current Change From Right to left",image:"/images/leftarrow.gif",id:"orion.compare.copyToLeft",groupId:"orion.compareGroup",callback:function(){g.copyToLeft()}});this._commandService.addCommand(l,
"dom");this._commandService.addCommand(j,"dom");this._commandService.addCommand(n,"dom");this._commandService.registerCommandContribution("orion.compare.prevDiff",3,"rightContainerCommands");this._commandService.registerCommandContribution("orion.compare.nextDiff",2,"rightContainerCommands");this.readonly||this._commandService.registerCommandContribution("orion.compare.copyToLeft",1,"rightContainerCommands");this._commandService.renderCommands("rightContainerCommands","dom",g,g,"image")};w.prototype.nextDiff=
function(){this._compareMatchRenderer.nextDiff()};w.prototype.prevDiff=function(){this._compareMatchRenderer.prevDiff()};w.prototype.copyToLeft=function(){this._compareMatchRenderer.copyToLeft()};w.prototype.createEditorContainer=function(g,j,l,n,o,r,v,z,B){var D=b.byId(o),E=this;g=new u.TextModel(g,j);var F=new d.CompareMergeModel(g,{mapper:l,columnIndex:n}),J="";l=v?new i.UndoFactory:new k.UndoCommandFactory(E._registry,E._commandService,"pageActions");l=new h.Editor({textViewFactory:function(){return new s.TextView({parent:D,
model:F,readonly:v,stylesheet:"/orion/compare/editor.css",tabSize:4})},undoStackFactory:l,contentAssistFactory:function(K){return new e.ContentAssist(K,"contentassist")},keyBindingFactory:function(K,O,R,X){if(!v){(new k.EditorCommandFactory(E._registry,E._commandService,E._fileClient,E._inputManager,"pageActions")).generateEditorCommands(K);var P=new i.TextActions(K,R);O.push(P);K=new i.SourceCodeActions(K,R,X);O.push(K)}},statusReporter:function(K,O){if(r){J=O?"ERROR: "+K:K;b.byId(r).innerHTML=""+
J}},domNode:D});l.installTextView();if(!v){inputManager=this._inputManager;b.connect(l,"onDirtyChange",inputManager,inputManager.setDirty)}g=l.getTextView();if(z&&B){z=B.split("?")[0];l.onInputChange(z);this._highlighter[n].highlight(z,l)}g.addRuler(new a.LineNumberCompareRuler(0,"left",{styleClass:"ruler_lines"},{styleClass:"ruler_lines_odd"},{styleClass:"ruler_lines_even"}));if(n===0){g.getModel().addListener(E._compareMatchRenderer);g.addEventListener("Scroll",window,function(){if(E._compareMatchRenderer){E._compareMatchRenderer.matchPositionFrom(true);
E._compareMatchRenderer.render()}})}else g.addEventListener("Scroll",window,function(){E._compareMatchRenderer&&E._compareMatchRenderer.render()});return l};w.prototype.setEditor=function(g,j,l){j=this.parseMapper(g,j,this._conflict,l);if(this._editorLeft)if(l){this._textViewLeft.getModel().init(j.mapper);this._textViewRight.getModel().init(j.mapper);this._textViewLeft.redrawRange();this._textViewRight.redrawRange()}else{this._inputManager.filePath=this._newFileURI;this._textViewLeft.getModel().init(j.mapper);
this._textViewRight.getModel().init(j.mapper);l=this._oldFileURI.split("?")[0];this._editorRight.onInputChange(l,null,g);this._highlighter[1].highlight(l,this._textViewRight);g=this._newFileURI.split("?")[0];this._editorLeft.onInputChange(g,null,j.output);this._highlighter[0].highlight(g,this._textViewLeft);this.readonly||this._inputManager.setInput(g,this._editorLeft)}else this.initEditorContainers(j.delim,j.output,g,j.mapper,true,this._newFileURI,this._oldFileURI);this._compareMatchRenderer.init(j.mapper,
this._textViewLeft,this._textViewRight);this._compareMatchRenderer.matchPositionFromAnnotation(-1)};return w}();x.InlineCompareContainer=function(){function w(g,j,l){this.setDiffProvider(g);this._registry=j;this._editorDivId=l;this.initEditorContainers("","\n",[],[])}w.prototype=new x.CompareContainer;w.prototype.addRulers=function(){if(this._textView&&!this._hasRuler){this._textView.addRuler(this._rulerOrigin);this._textView.addRuler(this._rulerNew);this._textView.addRuler(this._overview);this._hasRuler=
true}};w.prototype.removeRulers=function(){if(this._textView&&this._hasRuler){this._textView.removeRuler(this._rulerOrigin);this._textView.removeRuler(this._rulerNew);this._textView.removeRuler(this._overview);this._hasRuler=false}};w.prototype.destroyEditor=function(){if(this._textView){this._textView.getModel().init([],[]);this._textView.setText("");this.removeRulers()}};w.prototype.createEditorContainer=function(g,j,l,n,o,r){var v=b.byId(this._editorDivId);g=new u.TextModel(g,j);var z=new c.CompareTextModel(g,
{mapper:l,columnIndex:0},new c.DiffLineFeeder(n,j));j=new i.UndoFactory;j=new h.Editor({textViewFactory:function(){return new s.TextView({parent:v,model:z,readonly:true,stylesheet:"/orion/compare/editor.css",tabSize:4})},undoStackFactory:j,keyBindingFactory:function(){},statusReporter:function(){},domNode:v});j.installTextView();o&&r&&j.onInputChange(r.split("?")[0]);o=j.getTextView();this._rulerOrigin=new a.LineNumberCompareRuler(1,"left",{styleClass:"ruler_lines"},{styleClass:"ruler_lines_odd"},
{styleClass:"ruler_lines_even"});this._rulerNew=new a.LineNumberCompareRuler(0,"left",{styleClass:"ruler_lines"},{styleClass:"ruler_lines_odd"},{styleClass:"ruler_lines_even"});this._overview=new a.CompareOverviewRuler("right",{styleClass:"ruler_overview"});o.addEventListener("LineStyle",this,this._onLineStyle);return j};w.prototype.initEditorContainers=function(g,j,l,n,o){this._editor=this.createEditorContainer(j,g,l,n,o);this._textView=this._editor.getTextView()};w.prototype._onLineStyle=function(g){var j=
g.lineIndex;j=this._textView.getModel().getLineType(j);if(j==="added")g.style={style:{backgroundColor:"#99EE99"}};else if(j==="removed")g.style={style:{backgroundColor:"#EE9999"}}};w.prototype.setEditor=function(g,j){j=this.parseMapper(g,j,false,true);if(this._textView){this.addRulers();this._textView.getModel().init([],[]);this._textView.setText("");this._textView.getModel().init(j.mapper,j.diffArray);this._textView.setText(g)}else this.initEditorContainers(j.delim,g,j.mapper,j.diffArray,true,this._newFileURI);
this._initDiffPosition(this._textView)};return w}();return x});
define("compare",["dojo","orion/serviceregistry","orion/preferences","orion/pluginregistry","orion/status","orion/commands","orion/fileClient","orion/searchClient","orion/globalCommands","orion/compare/compare-features","orion/compare/diff-provider","orion/compare/compare-container","dojo/parser","dojo/hash","dijit/layout/BorderContainer","dijit/layout/ContentPane"],function(b,f,a,c,d,e,k,h,i,m,p,t){function y(){return b.queryToObject(window.location.search.slice(1)).readonly!=null}function u(q,x,
w){if(w.getTitleDivId(true)&&w.getTitleDivId(false)){b.place(document.createTextNode(q),w.getTitleDivId(true),"only");b.place(document.createTextNode(x),w.getTitleDivId(false),"only")}}function s(q,x,w){if(w.getTitleDivId(true)&&w.getTitleDivId(false)){q=typeof q.message==="string"?q.message:x.xhr.statusText;b.place(document.createTextNode(q),w.getTitleDivId(true),"only");b.place(document.createTextNode(q),w.getTitleDivId(false),"only");b.style(w.getTitleDivId(true),"color","red");b.style(w.getTitleDivId(false),
"color","red")}}b.addOnLoad(function(){document.body.style.visibility="visible";b.parser.parse();var q=new f.ServiceRegistry;new c.PluginRegistry(q);for(var x=new e.CommandService({serviceRegistry:q}),w=new a.PreferencesService(q,"/prefs/user"),g=new h.Searcher({serviceRegistry:q}),j=q.getServiceReferences("orion.core.file"),l,n=0;n<j.length;n++){for(var o={},r=j[n].getPropertyNames(),v=0;v<r.length;v++)o[r[v]]=j[n].getProperty(r[v]);if((new RegExp(o.pattern)).test(b.hash()))l=j[n]}q.getService(l).then(function(z){var B=
new k.FileClient(z);i.generateBanner("toolbar",q,x,w,g);var D=new m.CompareMergeUIFactory({parentDivID:"compareContainer",showTitle:true,showLineStatus:true});D.buildUI();var E=y();compareMergeContainer=new t.CompareMergeContainer(E,new p.DiffProvider(q),q,x,B,D);compareMergeContainer.resolveDiff(b.hash(),function(F,J){u(F,J,D)},function(F,J){s(F,J,D)});b.subscribe("/dojo/hashchange",compareMergeContainer,function(){compareMergeContainer=new t.CompareMergeContainer(E,new p.DiffProvider(q),q,x,B,D);
compareMergeContainer.resolveDiff(b.hash(),function(F,J){u(F,J,D)},function(F,J){s(F,J,D)})})})})});