diff --git a/README.md b/README.md
index f041f7620..8e58ed94a 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,10 @@
[](https://gitter.im/eclipse/che?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[](https://travis-ci.org/codenvy/che-plugins)
-[](https://github.com/codenvy/che-plugins)
-[](https://github.com/codenvy/che-plugins/tags)
+[](https://github.com/codenvy/che/blob/master/LICENSE)
+[](https://github.com/codenvy/che-plugins/tree/master)
+[](https://github.com/codenvy/che-plugins/tree/4.0)
+
## About Eclipse Che
High performance, open source developer environments in the cloud.
diff --git a/plugin-angularjs/README.md b/plugin-angularjs/README.md
index c4fea7387..b2abeb2bf 100644
--- a/plugin-angularjs/README.md
+++ b/plugin-angularjs/README.md
@@ -13,3 +13,6 @@ npm is bundled with nodejs which can be downloaded from there : http://nodejs.or
* Yeoman (and dependencies can be installed with the command line : npm install -g yo)
more details on http://yeoman.io/gettingstarted.html
+Drag & drop following button to http://my.che.url/dashboard/#/admin/plugins to install this plug-in:
+
+[](http://eclipse.org/che/?install&uri=mvn:org.eclipse.che.plugin:angularjs-assembly:zip:CURRENT)
diff --git a/plugin-angularjs/api/client/pom.xml b/plugin-angularjs/api/client/pom.xml
index 2bec3c84e..0c306b0fa 100644
--- a/plugin-angularjs/api/client/pom.xml
+++ b/plugin-angularjs/api/client/pom.xml
@@ -16,7 +16,7 @@
angularjs-api
org.eclipse.che.plugin
- 3.12.2-SNAPSHOT
+ 3.14.2-SNAPSHOT
angularjs-api-client
jar
diff --git a/plugin-angularjs/api/pom.xml b/plugin-angularjs/api/pom.xml
index 7e7479f44..4efa16336 100644
--- a/plugin-angularjs/api/pom.xml
+++ b/plugin-angularjs/api/pom.xml
@@ -16,7 +16,7 @@
angularjs-parent
org.eclipse.che.plugin
- 3.12.2-SNAPSHOT
+ 3.14.2-SNAPSHOT
angularjs-api
pom
diff --git a/plugin-angularjs/api/server/pom.xml b/plugin-angularjs/api/server/pom.xml
index b2a4db7eb..900a7b7e1 100644
--- a/plugin-angularjs/api/server/pom.xml
+++ b/plugin-angularjs/api/server/pom.xml
@@ -16,7 +16,7 @@
angularjs-api
org.eclipse.che.plugin
- 3.12.2-SNAPSHOT
+ 3.14.2-SNAPSHOT
angularjs-api-server
jar
@@ -25,7 +25,6 @@
org.eclipse.che.core
che-core-api-project
- ${che.core.version}
diff --git a/plugin-angularjs/assembly/pom.xml b/plugin-angularjs/assembly/pom.xml
new file mode 100644
index 000000000..7243a658f
--- /dev/null
+++ b/plugin-angularjs/assembly/pom.xml
@@ -0,0 +1,84 @@
+
+
+
+ 4.0.0
+
+ angularjs-parent
+ org.eclipse.che.plugin
+ 3.14.2-SNAPSHOT
+
+ angularjs-assembly
+ che-plugin
+ Che Plugin :: AngularJS :: Assembly
+
+
+ org.eclipse.che.plugin
+ angularjs-api-client
+
+
+ org.eclipse.che.plugin
+ angularjs-api-server
+
+
+ org.eclipse.che.plugin
+ angularjs-completion-dto
+
+
+ org.eclipse.che.plugin
+ angularjs-completion-dto-gen
+
+
+ org.eclipse.che.plugin
+ angularjs-core-client
+
+
+ org.eclipse.che.plugin
+ angularjs-core-server
+
+
+ org.eclipse.che.plugin
+ angularjs-template-angular-seed
+
+
+ org.eclipse.che.plugin
+ angularjs-template-gulp-angularjs-starter
+
+
+ org.eclipse.che.plugin
+ angularjs-template-yeoman
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+
+
+ analyze
+
+ true
+
+
+
+
+
+ org.eclipse.che.core
+ che-core-maven-plugin
+ ${che.core.version}
+ true
+
+
+
+
diff --git a/plugin-angularjs/completion/dto-gen/pom.xml b/plugin-angularjs/completion/dto-gen/pom.xml
index 0ad716c68..a081c12e8 100644
--- a/plugin-angularjs/completion/dto-gen/pom.xml
+++ b/plugin-angularjs/completion/dto-gen/pom.xml
@@ -16,7 +16,7 @@
angularjs-completion
org.eclipse.che.plugin
- 3.12.2-SNAPSHOT
+ 3.14.2-SNAPSHOT
angularjs-completion-dto-gen
jar
@@ -25,48 +25,66 @@
${project.build.directory}/generated-sources/dto/
+
+ com.google.code.gson
+ gson
+ provided
+
com.google.gwt
gwt-user
- ${com.google.gwt.version}
+ provided
+
+
+ com.google.inject
+ guice
provided
org.eclipse.che.core
che-core-api-builder
- ${che.core.version}
+ provided
+
+
+ org.eclipse.che.core
+ che-core-api-dto
provided
org.eclipse.che.core
che-core-api-project
- ${che.core.version}
provided
org.eclipse.che.core
che-core-api-runner
- ${che.core.version}
+ provided
+
+
+ org.eclipse.che.core
+ che-core-commons-gwt
provided
org.eclipse.che.core
che-core-ide-api
- ${che.core.version}
provided
org.eclipse.che.plugin
angularjs-completion-dto
- ${project.version}
provided
org.eclipse.che.plugin
che-plugin-builder-ext-builder
- ${project.version}
provided
+
+ com.google.gwt
+ gwt-dev
+ test
+
src/main/java
diff --git a/plugin-angularjs/completion/dto/pom.xml b/plugin-angularjs/completion/dto/pom.xml
index 8c6aa9565..1018af293 100644
--- a/plugin-angularjs/completion/dto/pom.xml
+++ b/plugin-angularjs/completion/dto/pom.xml
@@ -16,7 +16,7 @@
angularjs-completion
org.eclipse.che.plugin
- 3.12.2-SNAPSHOT
+ 3.14.2-SNAPSHOT
angularjs-completion-dto
jar
@@ -25,31 +25,31 @@
org.eclipse.che.core
che-core-api-builder
- ${che.core.version}
+ provided
+
+
+ org.eclipse.che.core
+ che-core-api-dto
provided
org.eclipse.che.core
che-core-api-project
- ${che.core.version}
provided
org.eclipse.che.core
che-core-api-runner
- ${che.core.version}
provided
org.eclipse.che.core
che-core-ide-api
- ${che.core.version}
provided
org.eclipse.che.plugin
che-plugin-builder-ext-builder
- ${project.version}
provided
diff --git a/plugin-angularjs/completion/parser/pom.xml b/plugin-angularjs/completion/parser/pom.xml
index fd89381a2..846d6b5c8 100644
--- a/plugin-angularjs/completion/parser/pom.xml
+++ b/plugin-angularjs/completion/parser/pom.xml
@@ -16,7 +16,7 @@
angularjs-completion
org.eclipse.che.plugin
- 3.12.2-SNAPSHOT
+ 3.14.2-SNAPSHOT
angularjs-completion-parser
jar
@@ -25,19 +25,16 @@
org.eclipse.che.core
che-core-api-dto
- ${che.core.version}
provided
org.eclipse.che.plugin
angularjs-completion-dto
- ${project.version}
provided
org.eclipse.che.plugin
angularjs-completion-dto-gen
- ${project.version}
provided
diff --git a/plugin-angularjs/completion/pom.xml b/plugin-angularjs/completion/pom.xml
index e9eafb8e4..4bb622966 100644
--- a/plugin-angularjs/completion/pom.xml
+++ b/plugin-angularjs/completion/pom.xml
@@ -16,7 +16,7 @@
angularjs-parent
org.eclipse.che.plugin
- 3.12.2-SNAPSHOT
+ 3.14.2-SNAPSHOT
angularjs-completion
pom
diff --git a/plugin-angularjs/core/client/pom.xml b/plugin-angularjs/core/client/pom.xml
index fd3c06fac..f587bcbdf 100644
--- a/plugin-angularjs/core/client/pom.xml
+++ b/plugin-angularjs/core/client/pom.xml
@@ -16,100 +16,135 @@
angularjs-core
org.eclipse.che.plugin
- 3.12.2-SNAPSHOT
+ 3.14.2-SNAPSHOT
angularjs-core-client
jar
Che Plugin :: AngularJS :: Core :: Client
+
+ com.google.gwt
+ gwt-elemental
+ provided
+
com.google.gwt
gwt-user
- ${com.google.gwt.version}
+ provided
+
+
+ com.google.gwt.inject
+ gin
+ provided
+
+
+ com.google.inject
+ guice
+ provided
+
+
+ javax.inject
+ javax.inject
+ provided
+
+
+ javax.validation
+ validation-api
provided
org.eclipse.che.core
che-core-api-builder
- ${che.core.version}
+ provided
+
+
+ org.eclipse.che.core
+ che-core-api-core
provided
org.eclipse.che.core
che-core-api-project
- ${che.core.version}
provided
org.eclipse.che.core
che-core-api-runner
- ${che.core.version}
+ provided
+
+
+ org.eclipse.che.core
+ che-core-client-gwt-builder
+ provided
+
+
+ org.eclipse.che.core
+ che-core-client-gwt-project
provided
org.eclipse.che.core
che-core-commons-gwt
- ${che.core.version}
provided
org.eclipse.che.core
che-core-ide-api
- ${che.core.version}
provided
org.eclipse.che.core
che-core-ide-jseditor
- ${che.core.version}
provided
org.eclipse.che.plugin
angularjs-completion-dto
- ${project.version}
provided
org.eclipse.che.plugin
angularjs-completion-dto-gen
- ${project.version}
provided
org.eclipse.che.plugin
che-plugin-builder-ext-builder
- ${project.version}
provided
org.eclipse.che.plugin
che-plugin-runner-ext-runner
- ${project.version}
provided
org.eclipse.che.plugin
che-plugin-web-ext-web
- ${project.version}
provided
+
+ org.vectomatic
+ lib-gwt-svg
+ provided
+
+
+ com.google.gwt
+ gwt-dev
+ test
+
com.googlecode.gwt-test-utils
gwt-test-utils
- ${com.googlecode.gwt-test-utils.version}
test
junit
junit
- ${junit.version}
test
org.mockito
mockito-core
- ${org.mockito.version}
test
@@ -150,6 +185,15 @@
true
+
+ com.mycila
+ license-maven-plugin
+
+
+ **/esprima.js
+
+
+
diff --git a/plugin-angularjs/core/client/src/main/java/org/eclipse/che/plugin/angularjs/core/client/wizard/AngularJsProjectWizardRegistrar.java b/plugin-angularjs/core/client/src/main/java/org/eclipse/che/plugin/angularjs/core/client/wizard/AngularJsProjectWizardRegistrar.java
index 6d8e8fdd4..0192d6fde 100644
--- a/plugin-angularjs/core/client/src/main/java/org/eclipse/che/plugin/angularjs/core/client/wizard/AngularJsProjectWizardRegistrar.java
+++ b/plugin-angularjs/core/client/src/main/java/org/eclipse/che/plugin/angularjs/core/client/wizard/AngularJsProjectWizardRegistrar.java
@@ -16,7 +16,7 @@
import com.google.inject.Inject;
import com.google.inject.Provider;
-import javax.annotation.Nonnull;
+import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
@@ -36,17 +36,17 @@ public AngularJsProjectWizardRegistrar() {
wizardPages = new ArrayList<>();
}
- @Nonnull
+ @NotNull
public String getProjectTypeId() {
return ANGULAR_JS_ID;
}
- @Nonnull
+ @NotNull
public String getCategory() {
return CATEGORY_JS;
}
- @Nonnull
+ @NotNull
public List>> getWizardPages() {
return wizardPages;
}
diff --git a/plugin-angularjs/core/client/src/main/java/org/eclipse/che/plugin/angularjs/core/client/wizard/BasicJsProjectWizardRegistrar.java b/plugin-angularjs/core/client/src/main/java/org/eclipse/che/plugin/angularjs/core/client/wizard/BasicJsProjectWizardRegistrar.java
index 02a84aa37..1eb59a163 100644
--- a/plugin-angularjs/core/client/src/main/java/org/eclipse/che/plugin/angularjs/core/client/wizard/BasicJsProjectWizardRegistrar.java
+++ b/plugin-angularjs/core/client/src/main/java/org/eclipse/che/plugin/angularjs/core/client/wizard/BasicJsProjectWizardRegistrar.java
@@ -16,7 +16,7 @@
import com.google.inject.Inject;
import com.google.inject.Provider;
-import javax.annotation.Nonnull;
+import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
import static org.eclipse.che.plugin.angularjs.core.client.share.Const.BASIC_JS_ID;
@@ -35,17 +35,17 @@ public BasicJsProjectWizardRegistrar() {
wizardPages = new ArrayList<>();
}
- @Nonnull
+ @NotNull
public String getProjectTypeId() {
return BASIC_JS_ID;
}
- @Nonnull
+ @NotNull
public String getCategory() {
return CATEGORY_JS;
}
- @Nonnull
+ @NotNull
public List>> getWizardPages() {
return wizardPages;
}
diff --git a/plugin-angularjs/core/client/src/main/java/org/eclipse/che/plugin/angularjs/core/client/wizard/GruntJsProjectWizardRegistrar.java b/plugin-angularjs/core/client/src/main/java/org/eclipse/che/plugin/angularjs/core/client/wizard/GruntJsProjectWizardRegistrar.java
index 276d30c28..1a700af4c 100644
--- a/plugin-angularjs/core/client/src/main/java/org/eclipse/che/plugin/angularjs/core/client/wizard/GruntJsProjectWizardRegistrar.java
+++ b/plugin-angularjs/core/client/src/main/java/org/eclipse/che/plugin/angularjs/core/client/wizard/GruntJsProjectWizardRegistrar.java
@@ -17,7 +17,7 @@
import com.google.inject.Inject;
import com.google.inject.Provider;
-import javax.annotation.Nonnull;
+import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
@@ -34,17 +34,17 @@ public GruntJsProjectWizardRegistrar() {
wizardPages = new ArrayList<>();
}
- @Nonnull
+ @NotNull
public String getProjectTypeId() {
return Const.GRUNT_JS_ID;
}
- @Nonnull
+ @NotNull
public String getCategory() {
return Const.CATEGORY_JS;
}
- @Nonnull
+ @NotNull
public List>> getWizardPages() {
return wizardPages;
}
diff --git a/plugin-angularjs/core/client/src/main/java/org/eclipse/che/plugin/angularjs/core/client/wizard/GulpJsProjectWizardRegistrar.java b/plugin-angularjs/core/client/src/main/java/org/eclipse/che/plugin/angularjs/core/client/wizard/GulpJsProjectWizardRegistrar.java
index 1bcf87f68..330958756 100644
--- a/plugin-angularjs/core/client/src/main/java/org/eclipse/che/plugin/angularjs/core/client/wizard/GulpJsProjectWizardRegistrar.java
+++ b/plugin-angularjs/core/client/src/main/java/org/eclipse/che/plugin/angularjs/core/client/wizard/GulpJsProjectWizardRegistrar.java
@@ -17,7 +17,7 @@
import com.google.inject.Inject;
import com.google.inject.Provider;
-import javax.annotation.Nonnull;
+import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
@@ -34,17 +34,17 @@ public GulpJsProjectWizardRegistrar() {
wizardPages = new ArrayList<>();
}
- @Nonnull
+ @NotNull
public String getProjectTypeId() {
return Const.GULP_JS_ID;
}
- @Nonnull
+ @NotNull
public String getCategory() {
return Const.CATEGORY_JS;
}
- @Nonnull
+ @NotNull
public List>> getWizardPages() {
return wizardPages;
}
diff --git a/plugin-angularjs/core/client/src/main/resources/org/eclipse/che/plugin/angularjs/core/client/esprima/esprima.js b/plugin-angularjs/core/client/src/main/resources/org/eclipse/che/plugin/angularjs/core/client/esprima/esprima.js
index 4408ce87a..673bd7fec 100644
--- a/plugin-angularjs/core/client/src/main/resources/org/eclipse/che/plugin/angularjs/core/client/esprima/esprima.js
+++ b/plugin-angularjs/core/client/src/main/resources/org/eclipse/che/plugin/angularjs/core/client/esprima/esprima.js
@@ -1,13 +1,3 @@
-/*
- * Copyright (c) 2014 Codenvy, S.A.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Codenvy, S.A. - initial API and implementation
- */
/*
Copyright (C) 2012 Ariya Hidayat
Copyright (C) 2012 Mathias Bynens
@@ -38,7 +28,7 @@
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/*jslint bitwise:true */
+/*jslint bitwise:true plusplus:true */
/*global esprima:true, exports:true,
throwError: true, createLiteral: true, generateStatement: true,
parseAssignmentExpression: true, parseBlock: true, parseExpression: true,
@@ -51,22 +41,19 @@
'use strict';
var Token,
+ TokenName,
Syntax,
PropertyKind,
Messages,
Regex,
- Precedence,
- BinaryPrecedence,
source,
- allowIn,
strict,
index,
lineNumber,
lineStart,
length,
buffer,
- base,
- indent,
+ state,
extra;
Token = {
@@ -80,6 +67,16 @@
StringLiteral: 8
};
+ TokenName = {};
+ TokenName[Token.BooleanLiteral] = 'Boolean';
+ TokenName[Token.EOF] = '';
+ TokenName[Token.Identifier] = 'Identifier';
+ TokenName[Token.Keyword] = 'Keyword';
+ TokenName[Token.NullLiteral] = 'Null';
+ TokenName[Token.NumericLiteral] = 'Numeric';
+ TokenName[Token.Punctuator] = 'Punctuator';
+ TokenName[Token.StringLiteral] = 'String';
+
Syntax = {
AssignmentExpression: 'AssignmentExpression',
ArrayExpression: 'ArrayExpression',
@@ -129,64 +126,57 @@
Set: 4
};
+ // Error messages should be identical to V8.
Messages = {
- UnexpectedToken: 'Unexpected token %0',
- UnexpectedNumber: 'Unexpected number',
- UnexpectedString: 'Unexpected string',
- UnexpectedIdentifier: 'Unexpected identifier',
- UnexpectedReserved: 'Unexpected reserved word',
- UnexpectedEOS: 'Unexpected end of input',
- NewlineAfterThrow: 'Illegal newline after throw',
+ UnexpectedToken: 'Unexpected token %0',
+ UnexpectedNumber: 'Unexpected number',
+ UnexpectedString: 'Unexpected string',
+ UnexpectedIdentifier: 'Unexpected identifier',
+ UnexpectedReserved: 'Unexpected reserved word',
+ UnexpectedEOS: 'Unexpected end of input',
+ NewlineAfterThrow: 'Illegal newline after throw',
InvalidRegExp: 'Invalid regular expression',
- UnterminatedRegExp: 'Invalid regular expression: missing /',
- NoCatchOrFinally: 'Missing catch or finally after try',
- StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode',
- StrictVarName: 'Variable name may not be eval or arguments in strict mode',
- StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode',
- StrictFunctionName: 'Function name may not be eval or arguments in strict mode',
- StrictOctalLiteral: 'Octal literals are not allowed in strict mode.',
- StrictDelete: 'Delete of an unqualified identifier in strict mode.',
- StrictDuplicateProperty: 'Duplicate data property in object literal not allowed in strict mode',
- StrictAccessorDataProperty: 'Object literal may not have data and accessor property with the same name',
- StrictAccessorGetSet: 'Object literal may not have multiple get/set accessors with the same name',
- StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode',
- StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode',
- StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode'
- };
-
- Precedence = {
- Sequence: 0,
- Assignment: 1,
- Conditional: 2,
- LogicalOR: 3,
- LogicalAND: 4,
- LogicalXOR: 5,
- BitwiseOR: 6,
- BitwiseAND: 7,
- Equality: 8,
- Relational: 9,
- BitwiseSHIFT: 10,
- Additive: 11,
- Multiplicative: 12,
- Unary: 13,
- Postfix: 14,
- Call: 15,
- New: 16,
- Member: 17,
- Primary: 18
+ UnterminatedRegExp: 'Invalid regular expression: missing /',
+ InvalidLHSInAssignment: 'Invalid left-hand side in assignment',
+ InvalidLHSInForIn: 'Invalid left-hand side in for-in',
+ NoCatchOrFinally: 'Missing catch or finally after try',
+ UnknownLabel: 'Undefined label \'%0\'',
+ Redeclaration: '%0 \'%1\' has already been declared',
+ IllegalContinue: 'Illegal continue statement',
+ IllegalBreak: 'Illegal break statement',
+ IllegalReturn: 'Illegal return statement',
+ StrictModeWith: 'Strict mode code may not include a with statement',
+ StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode',
+ StrictVarName: 'Variable name may not be eval or arguments in strict mode',
+ StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode',
+ StrictParamDupe: 'Strict mode function may not have duplicate parameter names',
+ StrictFunctionName: 'Function name may not be eval or arguments in strict mode',
+ StrictOctalLiteral: 'Octal literals are not allowed in strict mode.',
+ StrictDelete: 'Delete of an unqualified identifier in strict mode.',
+ StrictDuplicateProperty: 'Duplicate data property in object literal not allowed in strict mode',
+ AccessorDataProperty: 'Object literal may not have data and accessor property with the same name',
+ AccessorGetSet: 'Object literal may not have multiple get/set accessors with the same name',
+ StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode',
+ StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode',
+ StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode',
+ StrictReservedWord: 'Use of future reserved word in strict mode'
};
// See also tools/generate-unicode-regex.py.
Regex = {
- NonAsciiIdentifierStart: new RegExp('[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376-\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E-\u066F\u0671-\u06D3\u06D5\u06E5-\u06E6\u06EE-\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4-\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0-\u0AE1\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B35-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58-\u0C59\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0-\u0CE1\u0CF1-\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32-\u0E33\u0E40-\u0E46\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065-\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE-\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5-\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A-\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]'),
- NonAsciiIdentifierPart: new RegExp('[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376-\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0\u08A2-\u08AC\u08E4-\u08FE\u0900-\u0963\u0966-\u096F\u0971-\u0977\u0979-\u097F\u0981-\u0983\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7-\u09C8\u09CB-\u09CE\u09D7\u09DC-\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A3C\u0A3E-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47-\u0B48\u0B4B-\u0B4D\u0B56-\u0B57\u0B5C-\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82-\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C58-\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C82-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5-\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1-\u0CF2\u0D02-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2-\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18-\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772-\u1773\u1780-\u17D3\u17D7\u17DC-\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191C\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1D00-\u1DE6\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C-\u200D\u203F-\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA697\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAA7B\uAA80-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABEA\uABEC-\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE26\uFE33-\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]')
+ NonAsciiIdentifierStart: new RegExp('[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]'),
+ NonAsciiIdentifierPart: new RegExp('[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0300-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u0483-\u0487\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u05d0-\u05ea\u05f0-\u05f2\u0610-\u061a\u0620-\u0669\u066e-\u06d3\u06d5-\u06dc\u06df-\u06e8\u06ea-\u06fc\u06ff\u0710-\u074a\u074d-\u07b1\u07c0-\u07f5\u07fa\u0800-\u082d\u0840-\u085b\u08a0\u08a2-\u08ac\u08e4-\u08fe\u0900-\u0963\u0966-\u096f\u0971-\u0977\u0979-\u097f\u0981-\u0983\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bc-\u09c4\u09c7\u09c8\u09cb-\u09ce\u09d7\u09dc\u09dd\u09df-\u09e3\u09e6-\u09f1\u0a01-\u0a03\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a59-\u0a5c\u0a5e\u0a66-\u0a75\u0a81-\u0a83\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abc-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ad0\u0ae0-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3c-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5c\u0b5d\u0b5f-\u0b63\u0b66-\u0b6f\u0b71\u0b82\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd0\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c58\u0c59\u0c60-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbc-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0cde\u0ce0-\u0ce3\u0ce6-\u0cef\u0cf1\u0cf2\u0d02\u0d03\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d-\u0d44\u0d46-\u0d48\u0d4a-\u0d4e\u0d57\u0d60-\u0d63\u0d66-\u0d6f\u0d7a-\u0d7f\u0d82\u0d83\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e01-\u0e3a\u0e40-\u0e4e\u0e50-\u0e59\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb9\u0ebb-\u0ebd\u0ec0-\u0ec4\u0ec6\u0ec8-\u0ecd\u0ed0-\u0ed9\u0edc-\u0edf\u0f00\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e-\u0f47\u0f49-\u0f6c\u0f71-\u0f84\u0f86-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1049\u1050-\u109d\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u135d-\u135f\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176c\u176e-\u1770\u1772\u1773\u1780-\u17d3\u17d7\u17dc\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1820-\u1877\u1880-\u18aa\u18b0-\u18f5\u1900-\u191c\u1920-\u192b\u1930-\u193b\u1946-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u19d0-\u19d9\u1a00-\u1a1b\u1a20-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1aa7\u1b00-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1bf3\u1c00-\u1c37\u1c40-\u1c49\u1c4d-\u1c7d\u1cd0-\u1cd2\u1cd4-\u1cf6\u1d00-\u1de6\u1dfc-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u200c\u200d\u203f\u2040\u2054\u2071\u207f\u2090-\u209c\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d7f-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2de0-\u2dff\u2e2f\u3005-\u3007\u3021-\u302f\u3031-\u3035\u3038-\u303c\u3041-\u3096\u3099\u309a\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua62b\ua640-\ua66f\ua674-\ua67d\ua67f-\ua697\ua69f-\ua6f1\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua827\ua840-\ua873\ua880-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f7\ua8fb\ua900-\ua92d\ua930-\ua953\ua960-\ua97c\ua980-\ua9c0\ua9cf-\ua9d9\uaa00-\uaa36\uaa40-\uaa4d\uaa50-\uaa59\uaa60-\uaa76\uaa7a\uaa7b\uaa80-\uaac2\uaadb-\uaadd\uaae0-\uaaef\uaaf2-\uaaf6\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabea\uabec\uabed\uabf0-\uabf9\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff3f\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]')
};
- if (typeof Object.freeze === 'function') {
- Object.freeze(Token);
- Object.freeze(Syntax);
- Object.freeze(Messages);
- Object.freeze(Regex);
+ // Ensure the condition is true, otherwise throw an error.
+ // This is only to have a better contract semantic, i.e. another safety net
+ // to catch a logic error. The condition shall be fulfilled in normal case.
+ // Do NOT use this to enforce a certain condition on any user input.
+
+ function assert(condition, message) {
+ if (!condition) {
+ throw new Error('ASSERT: ' + message);
+ }
}
function sliceSource(from, to) {
@@ -215,9 +205,10 @@
// 7.2 White Space
function isWhiteSpace(ch) {
- // TODO Unicode "space separator"
return (ch === ' ') || (ch === '\u0009') || (ch === '\u000B') ||
- (ch === '\u000C') || (ch === '\u00A0') || (ch === '\uFEFF');
+ (ch === '\u000C') || (ch === '\u00A0') ||
+ (ch.charCodeAt(0) >= 0x1680 &&
+ '\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\uFEFF'.indexOf(ch) >= 0);
}
// 7.3 Line Terminators
@@ -259,107 +250,87 @@
return false;
}
- // 7.6.1.1 Keywords
-
- function isKeyword(id) {
+ function isStrictModeReservedWord(id) {
switch (id) {
- // Keywords.
- case 'break':
- case 'case':
- case 'catch':
- case 'continue':
- case 'debugger':
- case 'default':
- case 'delete':
- case 'do':
- case 'else':
- case 'finally':
- case 'for':
- case 'function':
- case 'if':
- case 'in':
- case 'instanceof':
- case 'new':
- case 'return':
- case 'switch':
- case 'this':
- case 'throw':
- case 'try':
- case 'typeof':
- case 'var':
- case 'void':
- case 'while':
- case 'with':
- return true;
-
- // Future reserved words.
- // 'const' is specialized as Keyword in V8.
- case 'const':
- return true;
-
- // strict mode
+ // Strict Mode reserved words.
case 'implements':
case 'interface':
- case 'let':
case 'package':
case 'private':
case 'protected':
case 'public':
case 'static':
case 'yield':
+ case 'let':
return true;
}
- return isFutureReservedWord(id);
+ return false;
}
- // Return the next character and move forward.
-
- function nextChar() {
- var ch = '\x00',
- idx = index;
- if (idx < length) {
- ch = source[idx];
- index += 1;
- }
- return ch;
+ function isRestrictedWord(id) {
+ return id === 'eval' || id === 'arguments';
}
+ // 7.6.1.1 Keywords
- function isNewlineOrSemicolon(ch) {
- return ch === ';' || ch === '\n';
- }
+ function isKeyword(id) {
+ var keyword = false;
+ switch (id.length) {
+ case 2:
+ keyword = (id === 'if') || (id === 'in') || (id === 'do');
+ break;
+ case 3:
+ keyword = (id === 'var') || (id === 'for') || (id === 'new') || (id === 'try');
+ break;
+ case 4:
+ keyword = (id === 'this') || (id === 'else') || (id === 'case') || (id === 'void') || (id === 'with');
+ break;
+ case 5:
+ keyword = (id === 'while') || (id === 'break') || (id === 'catch') || (id === 'throw');
+ break;
+ case 6:
+ keyword = (id === 'return') || (id === 'typeof') || (id === 'delete') || (id === 'switch');
+ break;
+ case 7:
+ keyword = (id === 'default') || (id === 'finally');
+ break;
+ case 8:
+ keyword = (id === 'function') || (id === 'continue') || (id === 'debugger');
+ break;
+ case 10:
+ keyword = (id === 'instanceof');
+ break;
+ }
- /**
- * rewind the lex position to the most recent newline or semicolon. If that turns out
- * to be the same position as the most recent parsing of a statement was attempted at,
- * don't rewind (because it will fail in the same way). If it turns out to be the same
- * position as where we last rewound to, don't do it. Clears the buffer and sets the
- * index in order to continue lexing from the new position.
- */
- function rewind() {
- var idx = index;
- while (idx > 0 && !isNewlineOrSemicolon(source[idx])) {
- idx--;
- }
- if (idx <= extra.statementStart) {
- return;
+ if (keyword) {
+ return true;
}
- var doRewind = false;
- if (extra.lastRewindLocation) {
- doRewind = true;
- } else {
- var v = extra.lastRewindLocation;
- if (v !== idx) {
- doRewind = true;
- }
+
+ switch (id) {
+ // Future reserved words.
+ // 'const' is specialized as Keyword in V8.
+ case 'const':
+ return true;
+
+ // For compatiblity to SpiderMonkey and ES.next
+ case 'yield':
+ case 'let':
+ return true;
}
- if (doRewind) {
- index = idx;
- buffer = null;
- extra.lastRewindLocation = index;
+
+ if (strict && isStrictModeReservedWord(id)) {
+ return true;
}
+
+ return isFutureReservedWord(id);
+ }
+
+ // Return the next character and move forward.
+
+ function nextChar() {
+ return source[index++];
}
// 7.4 Comments
@@ -374,51 +345,61 @@
ch = source[index];
if (lineComment) {
- nextChar();
+ ch = nextChar();
if (isLineTerminator(ch)) {
lineComment = false;
if (ch === '\r' && source[index] === '\n') {
- nextChar();
+ ++index;
}
- lineNumber += 1;
+ ++lineNumber;
lineStart = index;
}
} else if (blockComment) {
- nextChar();
- if (ch === '*') {
- ch = source[index];
- if (ch === '/') {
- nextChar();
- blockComment = false;
- }
- } else if (isLineTerminator(ch)) {
- if (ch === '\r' && source[index] === '\n') {
- nextChar();
+ if (isLineTerminator(ch)) {
+ if (ch === '\r' && source[index + 1] === '\n') {
+ ++index;
}
- lineNumber += 1;
+ ++lineNumber;
+ ++index;
lineStart = index;
+ if (index >= length) {
+ throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
+ }
+ } else {
+ ch = nextChar();
+ if (index >= length) {
+ throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
+ }
+ if (ch === '*') {
+ ch = source[index];
+ if (ch === '/') {
+ ++index;
+ blockComment = false;
+ }
+ }
}
} else if (ch === '/') {
ch = source[index + 1];
if (ch === '/') {
- nextChar();
- nextChar();
+ index += 2;
lineComment = true;
} else if (ch === '*') {
- nextChar();
- nextChar();
+ index += 2;
blockComment = true;
+ if (index >= length) {
+ throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
+ }
} else {
break;
}
} else if (isWhiteSpace(ch)) {
- nextChar();
+ ++index;
} else if (isLineTerminator(ch)) {
- nextChar();
- if (ch === '\r' && source[index] === '\n') {
- nextChar();
+ ++index;
+ if (ch === '\r' && source[index] === '\n') {
+ ++index;
}
- lineNumber += 1;
+ ++lineNumber;
lineStart = index;
} else {
break;
@@ -430,7 +411,7 @@
var i, len, ch, code = 0;
len = (prefix === 'u') ? 4 : 2;
- for (i = 0; i < len; i += 1) {
+ for (i = 0; i < len; ++i) {
if (index < length && isHexDigit(source[index])) {
ch = nextChar();
code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());
@@ -451,11 +432,11 @@
start = index;
if (ch === '\\') {
- nextChar();
+ ++index;
if (source[index] !== 'u') {
return;
}
- nextChar();
+ ++index;
restore = index;
ch = scanHexEscape('u');
if (ch) {
@@ -477,11 +458,11 @@
break;
}
if (ch === '\\') {
- nextChar();
+ ++index;
if (source[index] !== 'u') {
return;
}
- nextChar();
+ ++index;
restore = index;
ch = scanHexEscape('u');
if (ch) {
@@ -565,7 +546,7 @@
// Check for most common single-character punctuators.
if (ch1 === ';' || ch1 === '{' || ch1 === '}') {
- nextChar();
+ ++index;
return {
type: Token.Punctuator,
value: ch1,
@@ -576,7 +557,7 @@
}
if (ch1 === ',' || ch1 === '(' || ch1 === ')') {
- nextChar();
+ ++index;
return {
type: Token.Punctuator,
value: ch1,
@@ -609,10 +590,7 @@
if (ch1 === '>' && ch2 === '>' && ch3 === '>') {
if (ch4 === '=') {
- nextChar();
- nextChar();
- nextChar();
- nextChar();
+ index += 4;
return {
type: Token.Punctuator,
value: '>>>=',
@@ -626,9 +604,7 @@
// 3-character punctuators: === !== >>> <<= >>=
if (ch1 === '=' && ch2 === '=' && ch3 === '=') {
- nextChar();
- nextChar();
- nextChar();
+ index += 3;
return {
type: Token.Punctuator,
value: '===',
@@ -639,9 +615,7 @@
}
if (ch1 === '!' && ch2 === '=' && ch3 === '=') {
- nextChar();
- nextChar();
- nextChar();
+ index += 3;
return {
type: Token.Punctuator,
value: '!==',
@@ -652,9 +626,7 @@
}
if (ch1 === '>' && ch2 === '>' && ch3 === '>') {
- nextChar();
- nextChar();
- nextChar();
+ index += 3;
return {
type: Token.Punctuator,
value: '>>>',
@@ -665,9 +637,7 @@
}
if (ch1 === '<' && ch2 === '<' && ch3 === '=') {
- nextChar();
- nextChar();
- nextChar();
+ index += 3;
return {
type: Token.Punctuator,
value: '<<=',
@@ -678,9 +648,7 @@
}
if (ch1 === '>' && ch2 === '>' && ch3 === '=') {
- nextChar();
- nextChar();
- nextChar();
+ index += 3;
return {
type: Token.Punctuator,
value: '>>=',
@@ -695,8 +663,7 @@
if (ch2 === '=') {
if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) {
- nextChar();
- nextChar();
+ index += 2;
return {
type: Token.Punctuator,
value: ch1 + ch2,
@@ -709,8 +676,7 @@
if (ch1 === ch2 && ('+-<>&|'.indexOf(ch1) >= 0)) {
if ('+-<>&|'.indexOf(ch2) >= 0) {
- nextChar();
- nextChar();
+ index += 2;
return {
type: Token.Punctuator,
value: ch1 + ch2,
@@ -740,9 +706,8 @@
var number, start, ch;
ch = source[index];
- if (!isDecimalDigit(ch) && (ch !== '.')) {
- return;
- }
+ assert(isDecimalDigit(ch) || (ch === '.'),
+ 'Numeric literal must start with a decimal digit or a decimal point');
start = index;
number = '';
@@ -770,7 +735,7 @@
if (index < length) {
ch = source[index];
- if (isIdentifierStart(ch) || isDecimalDigit(ch)) {
+ if (isIdentifierStart(ch)) {
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
}
@@ -835,8 +800,14 @@
if (ch === 'e' || ch === 'E') {
number += nextChar();
+
+ ch = source[index];
+ if (ch === '+' || ch === '-') {
+ number += nextChar();
+ }
+
ch = source[index];
- if (ch === '+' || ch === '-' || isDecimalDigit(ch)) {
+ if (isDecimalDigit(ch)) {
number += nextChar();
while (index < length) {
ch = source[index];
@@ -856,7 +827,7 @@
if (index < length) {
ch = source[index];
- if (isIdentifierStart(ch) || isDecimalDigit(ch)) {
+ if (isIdentifierStart(ch)) {
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
}
@@ -876,11 +847,11 @@
var str = '', quote, start, ch, code, unescaped, restore, octal = false;
quote = source[index];
- if (quote !== '\'' && quote !== '"') {
- return;
- }
+ assert((quote === '\'' || quote === '"'),
+ 'String literal must starts with a quote');
+
start = index;
- nextChar();
+ ++index;
while (index < length) {
ch = nextChar();
@@ -950,9 +921,9 @@
break;
}
} else {
- lineNumber += 1;
- if (ch === '\r' && source[index] === '\n') {
- nextChar();
+ ++lineNumber;
+ if (ch === '\r' && source[index] === '\n') {
+ ++index;
}
}
} else if (isLineTerminator(ch)) {
@@ -984,9 +955,7 @@
start = index;
ch = source[index];
- if (ch !== '/') {
- return;
- }
+ assert(ch === '/', 'Regular expression literal must start with a slash');
str = nextChar();
while (index < length) {
@@ -998,15 +967,20 @@
}
} else {
if (ch === '\\') {
- str += nextChar();
+ ch = nextChar();
+ // ECMA-262 7.8.5
+ if (isLineTerminator(ch)) {
+ throwError({}, Messages.UnterminatedRegExp);
+ }
+ str += ch;
}
- if (ch === '/') {
+ else if (ch === '/') {
break;
}
- if (ch === '[') {
+ else if (ch === '[') {
classMarker = true;
}
- if (isLineTerminator(ch)) {
+ else if (isLineTerminator(ch)) {
throwError({}, Messages.UnterminatedRegExp);
}
}
@@ -1026,17 +1000,17 @@
break;
}
- nextChar();
+ ++index;
if (ch === '\\' && index < length) {
ch = source[index];
if (ch === 'u') {
- nextChar();
+ ++index;
restore = index;
ch = scanHexEscape('u');
if (ch) {
flags += ch;
str += '\\u';
- for (; restore < index; restore += 1) {
+ for (; restore < index; ++restore) {
str += source[restore];
}
} else {
@@ -1188,6 +1162,20 @@
throw error;
}
+ function throwErrorTolerant() {
+ var error;
+ try {
+ throwError.apply(null, arguments);
+ } catch (e) {
+ if (extra.errors) {
+ extra.errors.push(e);
+ } else {
+ throw e;
+ }
+ }
+ }
+
+
// Throw an exception because of the token.
function throwUnexpected(token) {
@@ -1209,15 +1197,17 @@
throwError(token, Messages.UnexpectedIdentifier);
}
- if (token.type === Token.Keyword && isFutureReservedWord(token.value)) {
- throwError(token, Messages.UnexpectedReserved);
+ if (token.type === Token.Keyword) {
+ if (isFutureReservedWord(token.value)) {
+ throwError(token, Messages.UnexpectedReserved);
+ } else if (strict && isStrictModeReservedWord(token.value)) {
+ throwError(token, Messages.StrictReservedWord);
+ }
+ throwError(token, Messages.UnexpectedToken, token.value);
}
- s = token.value;
- if (s.length > 10) {
- s = s.substr(0, 10) + '...';
- }
- throwError(token, Messages.UnexpectedToken, s);
+ // BooleanLiteral, NullLiteral, or Punctuator.
+ throwError(token, Messages.UnexpectedToken, token.value);
}
// Expect the next token to match the specified punctuator.
@@ -1277,10 +1267,6 @@
op === '|=';
}
- function isRestricted(expr) {
- return expr.type === Syntax.Identifier && (expr.name === 'eval' || expr.name === 'arguments');
- }
-
function consumeSemicolon() {
var token, line;
@@ -1303,11 +1289,25 @@
token = lookahead();
if (token.type !== Token.EOF && !match('}')) {
- if (extra.errors) {
- rewind();
- }
throwUnexpected(token);
}
+ return;
+ }
+
+ // Return true if provided expression is LeftHandSideExpression
+
+ function isLeftHandSide(expr) {
+ switch (expr.type) {
+ case 'AssignmentExpression':
+ case 'BinaryExpression':
+ case 'ConditionalExpression':
+ case 'LogicalExpression':
+ case 'SequenceExpression':
+ case 'UnaryExpression':
+ case 'UpdateExpression':
+ return false;
+ }
+ return true;
}
// 11.1.4 Array Initialiser
@@ -1318,27 +1318,21 @@
expect('[');
- while (index < length) {
- if (match(']')) {
- lex();
- break;
- }
-
+ while (!match(']')) {
if (match(',')) {
lex();
elements.push(undef);
} else {
elements.push(parseAssignmentExpression());
- if (match(']')) {
- lex();
- break;
+ if (!match(']')) {
+ expect(',');
}
-
- expect(',');
}
}
+ expect(']');
+
return {
type: Syntax.ArrayExpression,
elements: elements
@@ -1352,7 +1346,7 @@
previousStrict = strict;
body = parseFunctionSourceElements();
- if (first && strict && isRestricted(param[0])) {
+ if (first && strict && isRestrictedWord(param[0].name)) {
throwError(first, Messages.StrictParamName);
}
strict = previousStrict;
@@ -1366,104 +1360,81 @@
}
function parseObjectPropertyKey() {
- var token = lex(),
- key;
-
- switch (token.type) {
-
- case Token.StringLiteral:
- case Token.NumericLiteral:
- if (strict && token.octal) {
- throwError(token, Messages.StrictOctalLiteral);
- }
- key = createLiteral(token);
- break;
+ var token = lex();
- case Token.Identifier:
- case Token.Keyword:
- case Token.BooleanLiteral:
- case Token.NullLiteral:
- key = {
- type: Syntax.Identifier,
- name: token.value
- };
- break;
+ // Note: This function is called only from parseObjectProperty(), where
+ // EOF and Punctuator tokens are already filtered out.
- default:
- throwUnexpected(token);
+ if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) {
+ if (strict && token.octal) {
+ throwError(token, Messages.StrictOctalLiteral);
+ }
+ return createLiteral(token);
}
- return key;
+ return {
+ type: Syntax.Identifier,
+ name: token.value
+ };
}
function parseObjectProperty() {
- var token, property, key, id, param;
+ var token, key, id, param;
token = lookahead();
- switch (token.type) {
-
- case Token.Identifier:
- id = parseObjectPropertyKey();
+ if (token.type === Token.Identifier) {
- // Property Assignment: Getter and Setter.
+ id = parseObjectPropertyKey();
- if (token.value === 'get' && !match(':')) {
- key = parseObjectPropertyKey();
- expect('(');
- expect(')');
- property = {
- type: Syntax.Property,
- key: key,
- value: parsePropertyFunction([]),
- kind: 'get'
- };
- } else if (token.value === 'set' && !match(':')) {
- key = parseObjectPropertyKey();
- expect('(');
- token = lookahead();
- if (token.type !== Token.Identifier) {
- throwUnexpected(lex());
- }
- param = [ parseVariableIdentifier() ];
- expect(')');
- property = {
- type: Syntax.Property,
- key: key,
- value: parsePropertyFunction(param, token),
- kind: 'set'
- };
- } else {
- expect(':');
- property = {
- type: Syntax.Property,
- key: id,
- value: parseAssignmentExpression(),
- kind: 'init'
- };
- }
- break;
+ // Property Assignment: Getter and Setter.
- case Token.Keyword:
- case Token.BooleanLiteral:
- case Token.NullLiteral:
- case Token.StringLiteral:
- case Token.NumericLiteral:
+ if (token.value === 'get' && !match(':')) {
key = parseObjectPropertyKey();
- expect(':');
- property = {
+ expect('(');
+ expect(')');
+ return {
+ type: Syntax.Property,
+ key: key,
+ value: parsePropertyFunction([]),
+ kind: 'get'
+ };
+ } else if (token.value === 'set' && !match(':')) {
+ key = parseObjectPropertyKey();
+ expect('(');
+ token = lookahead();
+ if (token.type !== Token.Identifier) {
+ throwUnexpected(lex());
+ }
+ param = [ parseVariableIdentifier() ];
+ expect(')');
+ return {
type: Syntax.Property,
key: key,
+ value: parsePropertyFunction(param, token),
+ kind: 'set'
+ };
+ } else {
+ expect(':');
+ return {
+ type: Syntax.Property,
+ key: id,
value: parseAssignmentExpression(),
kind: 'init'
};
- break;
-
- default:
- throwUnexpected(token);
+ }
+ } else if (token.type === Token.EOF || token.type === Token.Punctuator) {
+ throwUnexpected(token);
+ } else {
+ key = parseObjectPropertyKey();
+ expect(':');
+ return {
+ type: Syntax.Property,
+ key: key,
+ value: parseAssignmentExpression(),
+ kind: 'init'
+ };
}
-
- return property;
}
function parseObjectInitialiser() {
@@ -1471,51 +1442,43 @@
expect('{');
- while (index < length) {
-
- token = lookahead();
- if (token.type === Token.Punctuator && token.value === '}') {
- lex();
- break;
- }
-
+ while (!match('}')) {
property = parseObjectProperty();
- if (strict) {
- if (property.key.type === Syntax.Identifier) {
- name = property.key.name;
- } else {
- name = toString(property.key.value);
- }
- kind = (property.kind === 'init') ? PropertyKind.Data : (property.kind === 'get') ? PropertyKind.Get : PropertyKind.Set;
- if (map.hasOwnProperty(name)) {
- if (map[name] === PropertyKind.Data) {
- if (kind === PropertyKind.Data) {
- throwError({}, Messages.StrictDuplicateProperty);
- } else {
- throwError({}, Messages.StrictAccessorDataProperty);
- }
- } else {
- if (kind === PropertyKind.Data) {
- throwError({}, Messages.StrictAccessorDataProperty);
- } else if (map[name] & kind) {
- throwError({}, Messages.StrictAccessorGetSet);
- }
+
+ if (property.key.type === Syntax.Identifier) {
+ name = property.key.name;
+ } else {
+ name = toString(property.key.value);
+ }
+ kind = (property.kind === 'init') ? PropertyKind.Data : (property.kind === 'get') ? PropertyKind.Get : PropertyKind.Set;
+ if (Object.prototype.hasOwnProperty.call(map, name)) {
+ if (map[name] === PropertyKind.Data) {
+ if (strict && kind === PropertyKind.Data) {
+ throwErrorTolerant({}, Messages.StrictDuplicateProperty);
+ } else if (kind !== PropertyKind.Data) {
+ throwError({}, Messages.AccessorDataProperty);
}
- map[name] |= kind;
} else {
- map[name] = kind;
+ if (kind === PropertyKind.Data) {
+ throwError({}, Messages.AccessorDataProperty);
+ } else if (map[name] & kind) {
+ throwError({}, Messages.AccessorGetSet);
+ }
}
+ map[name] |= kind;
+ } else {
+ map[name] = kind;
}
+
properties.push(property);
- token = lookahead();
- if (token.type === Token.Punctuator && token.value === '}') {
- lex();
- break;
+ if (!match('}')) {
+ expect(',');
}
- expect(',');
}
+ expect('}');
+
return {
type: Syntax.ObjectExpression,
properties: properties
@@ -1538,7 +1501,7 @@
if (type === Token.StringLiteral || type === Token.NumericLiteral) {
if (strict && token.octal) {
- throwError(token, Messages.StrictOctalLiteral);
+ throwErrorTolerant(token, Messages.StrictOctalLiteral);
}
return createLiteral(lex());
}
@@ -1578,7 +1541,7 @@
if (match('(')) {
lex();
- expr = parseExpression();
+ state.lastParenthesized = expr = parseExpression();
expect(')');
return expr;
}
@@ -1612,87 +1575,10 @@
return args;
}
- // TODO refactor
- /**
- * From a position 'idx' in the source this function moves back through the source until
- * it finds a non-whitespace (including newlines) character. It will jump over block comments.
- * Returns an object with properties: index - the index it rewound to. lineChange - boolean indicating
- * if a line was crossed during rewind.
- */
- function rewindToInterestingChar(idx) {
- var done = false;
- var lineChange = false;
- var ch;
- while (!done) {
- ch = source[idx];
- if (ch === '/') {
- // possibly rewind over a block comment
- if (idx > 2 && source[idx - 1] === '*') {
- // it is, let's reverse over it
- idx = idx - 2;
- var skippedComment = false;
- while (!skippedComment) {
- ch = source[idx];
- if (ch === '*') {
- if (idx > 0 && source[idx - 1] === '/') {
- skippedComment = true;
- }
- } else if (ch === '\n') {
- lineChange = true;
- }
- if (idx === 0) {
- skippedComment = true; // error scenario, hit front of array before finding /*
- }
- idx--;
- }
- } else {
- done = true;
- }
- } else if (ch === '\n') {
- lineChange = true;
- } else if (!isWhiteSpace(ch)) {
- done = true;
- }
- if (!done) {
- idx--;
- }
- }
- return {"index": idx, "lineChange": lineChange};
- }
-
- /**
- * When a problem occurs in parseNonComputedProperty, attempt to reposition
- * the lexer to continue processing.
- * Example: '(foo.)' we will hit the ')' instead of discovering a property and consuming the ')'
- * will cause the parse of the paretheses to fail, so 'unconsume' it.
- * Basically rewind by one token if punctuation (type 7) is hit and the char before it was
- * a dot. This will enable the enclosing parse rule to consume the punctuation.
- */
- function attemptRecoveryNonComputedProperty(token) {
- if (token.value && token.type === Token.Punctuator) {
- var rewindInfo = rewindToInterestingChar(index - token.value.length - 1);
- var idx = rewindInfo.index;
- var ch = source[idx];
- // Check if worth rewinding
- // Special case:
- // "foo.\n(foo())\n" - don't really want that to parse as "foo(foo())"
- if (ch === '.' && rewindInfo.lineChange && token.value === '(') {
- // do not recover in this case
- } else if (ch === '.') {
- index = idx + 1;
- buffer = null;
- }
- }
- }
-
-
function parseNonComputedProperty() {
var token = lex();
if (!isIdentifierName(token)) {
- if (extra.errors) {
- attemptRecoveryNonComputedProperty(token);
- }
throwUnexpected(token);
}
@@ -1801,7 +1687,7 @@
if ((match('++') || match('--')) && !peekLineTerminator()) {
// 11.3.1, 11.3.2
- if (strict && isRestricted(expr)) {
+ if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {
throwError({}, Messages.StrictLHSPostfix);
}
expr = {
@@ -1824,7 +1710,7 @@
token = lex();
expr = parseUnaryExpression();
// 11.4.4, 11.4.5
- if (strict && isRestricted(expr)) {
+ if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {
throwError({}, Messages.StrictLHSPrefix);
}
expr = {
@@ -1852,7 +1738,7 @@
argument: parseUnaryExpression()
};
if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) {
- throwError({}, Messages.StrictDelete);
+ throwErrorTolerant({}, Messages.StrictDelete);
}
return expr;
}
@@ -1910,16 +1796,15 @@
return expr;
}
-
// 11.8 Relational Operators
function parseRelationalExpression() {
var expr, previousAllowIn;
- previousAllowIn = allowIn;
- allowIn = true;
+ previousAllowIn = state.allowIn;
+ state.allowIn = true;
expr = parseShiftExpression();
- allowIn = previousAllowIn;
+ state.allowIn = previousAllowIn;
if (match('<') || match('>') || match('<=') || match('>=')) {
expr = {
@@ -1928,7 +1813,7 @@
left: expr,
right: parseRelationalExpression()
};
- } else if (allowIn && matchKeyword('in')) {
+ } else if (state.allowIn && matchKeyword('in')) {
lex();
expr = {
type: Syntax.BinaryExpression,
@@ -2059,10 +1944,10 @@
if (match('?')) {
lex();
- previousAllowIn = allowIn;
- allowIn = true;
+ previousAllowIn = state.allowIn;
+ state.allowIn = true;
consequent = parseAssignmentExpression();
- allowIn = previousAllowIn;
+ state.allowIn = previousAllowIn;
expect(':');
expr = {
@@ -2084,8 +1969,13 @@
expr = parseConditionalExpression();
if (matchAssign()) {
+ // LeftHandSideExpression
+ if (state.lastParenthesized !== expr && !isLeftHandSide(expr)) {
+ throwError({}, Messages.InvalidLHSInAssignment);
+ }
+
// 11.13.1
- if (strict && isRestricted(expr)) {
+ if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {
throwError({}, Messages.StrictLHSAssignment);
}
@@ -2178,8 +2068,8 @@
init = null;
// 12.2.1
- if (strict && isRestricted(id)) {
- throwError({}, Messages.StrictVarName);
+ if (strict && isRestrictedWord(id.name)) {
+ throwErrorTolerant({}, Messages.StrictVarName);
}
if (kind === 'const') {
@@ -2270,20 +2160,6 @@
};
}
- /**
- * add the error if not already reported.
- */
- function pushError(error) {
- var len = extra.errors.length;
- for (var e = 0; e < len; e++) {
- var existingError = extra.errors[e];
- if (existingError.index === error.index && existingError.message === error.message) {
- return; // do not add duplicate
- }
- }
- extra.errors.push(error);
- }
-
// 12.5 If statement
function parseIfStatement() {
@@ -2295,32 +2171,9 @@
test = parseExpression();
- // needs generalizing to a 'expect A but don't consume if you hit B or C'
- try {
- expect(')');
- } catch (e) {
- if (extra.errors) {
- pushError(e);
- // If a { was hit instead of a ) then don't consume it, let us assume a ')' was
- // missed and the consequent block is OK
- if (source[e.index] === '{') {
- index = e.index;
- buffer = null;
- // activating this block will mean the following statement is parsed as a consequent.
- // without it the statement is considered not at all part of the if at all
- // } else {
- // rewind();
- }
- } else {
- throw e;
- }
- }
+ expect(')');
consequent = parseStatement();
- // required because of the check in wrapTracking that returns nothing if node is undefined
- if (!consequent) {
- consequent = null;
- }
if (matchKeyword('else')) {
lex();
@@ -2340,12 +2193,17 @@
// 12.6 Iteration Statements
function parseDoWhileStatement() {
- var body, test;
+ var body, test, oldInIteration;
expectKeyword('do');
+ oldInIteration = state.inIteration;
+ state.inIteration = true;
+
body = parseStatement();
+ state.inIteration = oldInIteration;
+
expectKeyword('while');
expect('(');
@@ -2366,7 +2224,7 @@
}
function parseWhileStatement() {
- var test, body;
+ var test, body, oldInIteration;
expectKeyword('while');
@@ -2376,8 +2234,13 @@
expect(')');
+ oldInIteration = state.inIteration;
+ state.inIteration = true;
+
body = parseStatement();
+ state.inIteration = oldInIteration;
+
return {
type: Syntax.WhileStatement,
test: test,
@@ -2396,7 +2259,7 @@
}
function parseForStatement() {
- var init, test, update, left, right, body;
+ var init, test, update, left, right, body, oldInIteration;
init = test = update = null;
@@ -2408,9 +2271,9 @@
lex();
} else {
if (matchKeyword('var') || matchKeyword('let')) {
- allowIn = false;
+ state.allowIn = false;
init = parseForVariableDeclaration();
- allowIn = true;
+ state.allowIn = true;
if (init.declarations.length === 1 && matchKeyword('in')) {
lex();
@@ -2419,11 +2282,15 @@
init = null;
}
} else {
- allowIn = false;
+ state.allowIn = false;
init = parseExpression();
- allowIn = true;
+ state.allowIn = true;
if (matchKeyword('in')) {
+ // LeftHandSideExpression
+ if (matchKeyword('in') && (state.lastParenthesized !== init && !isLeftHandSide(init))) {
+ throwError({}, Messages.InvalidLHSInForIn);
+ }
lex();
left = init;
right = parseExpression();
@@ -2450,8 +2317,13 @@
expect(')');
+ oldInIteration = state.inIteration;
+ state.inIteration = true;
+
body = parseStatement();
+ state.inIteration = oldInIteration;
+
if (typeof left === 'undefined') {
return {
type: Syntax.ForStatement,
@@ -2481,6 +2353,11 @@
// Optimize the most common form: 'continue;'.
if (source[index] === ';') {
lex();
+
+ if (!state.inIteration) {
+ throwError({}, Messages.IllegalContinue);
+ }
+
return {
type: Syntax.ContinueStatement,
label: null
@@ -2488,6 +2365,10 @@
}
if (peekLineTerminator()) {
+ if (!state.inIteration) {
+ throwError({}, Messages.IllegalContinue);
+ }
+
return {
type: Syntax.ContinueStatement,
label: null
@@ -2497,10 +2378,18 @@
token = lookahead();
if (token.type === Token.Identifier) {
label = parseVariableIdentifier();
+
+ if (!Object.prototype.hasOwnProperty.call(state.labelSet, label.name)) {
+ throwError({}, Messages.UnknownLabel, label.name);
+ }
}
consumeSemicolon();
+ if (label === null && !state.inIteration) {
+ throwError({}, Messages.IllegalContinue);
+ }
+
return {
type: Syntax.ContinueStatement,
label: label
@@ -2517,6 +2406,11 @@
// Optimize the most common form: 'break;'.
if (source[index] === ';') {
lex();
+
+ if (!(state.inIteration || state.inSwitch)) {
+ throwError({}, Messages.IllegalBreak);
+ }
+
return {
type: Syntax.BreakStatement,
label: null
@@ -2524,6 +2418,10 @@
}
if (peekLineTerminator()) {
+ if (!(state.inIteration || state.inSwitch)) {
+ throwError({}, Messages.IllegalBreak);
+ }
+
return {
type: Syntax.BreakStatement,
label: null
@@ -2533,10 +2431,18 @@
token = lookahead();
if (token.type === Token.Identifier) {
label = parseVariableIdentifier();
+
+ if (!Object.prototype.hasOwnProperty.call(state.labelSet, label.name)) {
+ throwError({}, Messages.UnknownLabel, label.name);
+ }
}
consumeSemicolon();
+ if (label === null && !(state.inIteration || state.inSwitch)) {
+ throwError({}, Messages.IllegalBreak);
+ }
+
return {
type: Syntax.BreakStatement,
label: label
@@ -2550,6 +2456,10 @@
expectKeyword('return');
+ if (!state.inFunctionBody) {
+ throwErrorTolerant({}, Messages.IllegalReturn);
+ }
+
// 'return' followed by a space and an identifier is very common.
if (source[index] === ' ') {
if (isIdentifierStart(source[index + 1])) {
@@ -2589,6 +2499,10 @@
function parseWithStatement() {
var object, body;
+ if (strict) {
+ throwErrorTolerant({}, Messages.StrictModeWith);
+ }
+
expectKeyword('with');
expect('(');
@@ -2608,10 +2522,20 @@
// 12.10 The swith statement
- function parseSwitchCase(test) {
- var consequent = [],
+ function parseSwitchCase() {
+ var test,
+ consequent = [],
statement;
+ if (matchKeyword('default')) {
+ lex();
+ test = null;
+ } else {
+ expectKeyword('case');
+ test = parseExpression();
+ }
+ expect(':');
+
while (index < length) {
if (match('}') || matchKeyword('default') || matchKeyword('case')) {
break;
@@ -2631,7 +2555,7 @@
}
function parseSwitchStatement() {
- var discriminant, cases, test;
+ var discriminant, cases, oldInSwitch;
expectKeyword('switch');
@@ -2653,23 +2577,18 @@
cases = [];
+ oldInSwitch = state.inSwitch;
+ state.inSwitch = true;
+
while (index < length) {
if (match('}')) {
break;
}
-
- if (matchKeyword('default')) {
- lex();
- test = null;
- } else {
- expectKeyword('case');
- test = parseExpression();
- }
- expect(':');
-
- cases.push(parseSwitchCase(test));
+ cases.push(parseSwitchCase());
}
+ state.inSwitch = oldInSwitch;
+
expect('}');
return {
@@ -2711,8 +2630,8 @@
if (!match(')')) {
param = parseExpression();
// 12.14.1
- if (strict && isRestricted(param)) {
- throwError({}, Messages.StrictCatchVariable);
+ if (strict && param.type === Syntax.Identifier && isRestrictedWord(param.name)) {
+ throwErrorTolerant({}, Messages.StrictCatchVariable);
}
}
expect(')');
@@ -2769,10 +2688,11 @@
function parseStatement() {
var token = lookahead(),
- expr;
+ expr,
+ labeledBody;
if (token.type === Token.EOF) {
- return;
+ throwUnexpected(token);
}
if (token.type === Token.Punctuator) {
@@ -2826,18 +2746,26 @@
expr = parseExpression();
// 12.12 Labelled Statements
- if (expr && (expr.type === Syntax.Identifier) && match(':')) {
+ if ((expr.type === Syntax.Identifier) && match(':')) {
lex();
+
+ if (Object.prototype.hasOwnProperty.call(state.labelSet, expr.name)) {
+ throwError({}, Messages.Redeclaration, 'Label', expr.name);
+ }
+
+ state.labelSet[expr.name] = true;
+ labeledBody = parseStatement();
+ delete state.labelSet[expr.name];
+
return {
type: Syntax.LabeledStatement,
label: expr,
- body: parseStatement()
+ body: labeledBody
};
}
consumeSemicolon();
-
return {
type: Syntax.ExpressionStatement,
expression: expr
@@ -2847,7 +2775,8 @@
// 13 Function Definition
function parseFunctionSourceElements() {
- var sourceElement, sourceElements = [], token, directive, firstRestricted;
+ var sourceElement, sourceElements = [], token, directive, firstRestricted,
+ oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody;
expect('{');
@@ -2876,6 +2805,16 @@
}
}
+ oldLabelSet = state.labelSet;
+ oldInIteration = state.inIteration;
+ oldInSwitch = state.inSwitch;
+ oldInFunctionBody = state.inFunctionBody;
+
+ state.labelSet = {};
+ state.inIteration = false;
+ state.inSwitch = false;
+ state.inFunctionBody = true;
+
while (index < length) {
if (match('}')) {
break;
@@ -2889,6 +2828,11 @@
expect('}');
+ state.labelSet = oldLabelSet;
+ state.inIteration = oldInIteration;
+ state.inSwitch = oldInSwitch;
+ state.inFunctionBody = oldInFunctionBody;
+
return {
type: Syntax.BlockStatement,
body: sourceElements
@@ -2896,35 +2840,53 @@
}
function parseFunctionDeclaration() {
- var id, param, params = [], body, token, firstRestricted, message, previousStrict;
+ var id, param, params = [], body, token, firstRestricted, message, previousStrict, paramSet;
expectKeyword('function');
token = lookahead();
id = parseVariableIdentifier();
- if (isRestricted(id)) {
- if (strict) {
+ if (strict) {
+ if (isRestrictedWord(token.value)) {
throwError(token, Messages.StrictFunctionName);
- } else {
+ }
+ } else {
+ if (isRestrictedWord(token.value)) {
firstRestricted = token;
message = Messages.StrictFunctionName;
+ } else if (isStrictModeReservedWord(token.value)) {
+ firstRestricted = token;
+ message = Messages.StrictReservedWord;
}
}
expect('(');
if (!match(')')) {
+ paramSet = {};
while (index < length) {
token = lookahead();
param = parseVariableIdentifier();
if (strict) {
- if (isRestricted(param)) {
+ if (isRestrictedWord(token.value)) {
throwError(token, Messages.StrictParamName);
}
- } else if (!firstRestricted && isRestricted(param)) {
- firstRestricted = token;
- message = Messages.StrictParamName;
+ if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) {
+ throwError(token, Messages.StrictParamDupe);
+ }
+ } else if (!firstRestricted) {
+ if (isRestrictedWord(token.value)) {
+ firstRestricted = token;
+ message = Messages.StrictParamName;
+ } else if (isStrictModeReservedWord(token.value)) {
+ firstRestricted = token;
+ message = Messages.StrictReservedWord;
+ } else if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) {
+ firstRestricted = token;
+ message = Messages.StrictParamDupe;
+ }
}
params.push(param);
+ paramSet[param.name] = true;
if (match(')')) {
break;
}
@@ -2950,19 +2912,24 @@
}
function parseFunctionExpression() {
- var token, id = null, firstRestricted, message, param, params = [], body, previousStrict;
+ var token, id = null, firstRestricted, message, param, params = [], body, previousStrict, paramSet;
expectKeyword('function');
if (!match('(')) {
token = lookahead();
id = parseVariableIdentifier();
- if (isRestricted(id)) {
- if (strict) {
+ if (strict) {
+ if (isRestrictedWord(token.value)) {
throwError(token, Messages.StrictFunctionName);
- } else {
+ }
+ } else {
+ if (isRestrictedWord(token.value)) {
firstRestricted = token;
message = Messages.StrictFunctionName;
+ } else if (isStrictModeReservedWord(token.value)) {
+ firstRestricted = token;
+ message = Messages.StrictReservedWord;
}
}
}
@@ -2970,18 +2937,31 @@
expect('(');
if (!match(')')) {
+ paramSet = {};
while (index < length) {
token = lookahead();
param = parseVariableIdentifier();
if (strict) {
- if (isRestricted(param)) {
+ if (isRestrictedWord(token.value)) {
throwError(token, Messages.StrictParamName);
}
- } else if (!firstRestricted && isRestricted(param)) {
- firstRestricted = token;
- message = Messages.StrictParamName;
+ if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) {
+ throwError(token, Messages.StrictParamDupe);
+ }
+ } else if (!firstRestricted) {
+ if (isRestrictedWord(token.value)) {
+ firstRestricted = token;
+ message = Messages.StrictParamName;
+ } else if (isStrictModeReservedWord(token.value)) {
+ firstRestricted = token;
+ message = Messages.StrictReservedWord;
+ } else if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) {
+ firstRestricted = token;
+ message = Messages.StrictParamDupe;
+ }
}
params.push(param);
+ paramSet[param.name] = true;
if (match(')')) {
break;
}
@@ -3009,12 +2989,7 @@
// 14 Program
function parseSourceElement() {
- var token;
-
- token = lookahead();
- if (token.type === Token.EOF) {
- return;
- }
+ var token = lookahead();
if (token.type === Token.Keyword) {
switch (token.value) {
@@ -3024,11 +2999,13 @@
case 'function':
return parseFunctionDeclaration();
default:
- break;
+ return parseStatement();
}
}
- return parseStatement();
+ if (token.type !== Token.EOF) {
+ return parseStatement();
+ }
}
function parseSourceElements() {
@@ -3083,9 +3060,7 @@
// the comments is active.
function addComment(start, end, type, value) {
- if (typeof start !== 'number') {
- return;
- }
+ assert(typeof start === 'number', 'Comment must have valid position');
// Because the way the actual token is scanned, often the comments
// (if any) are skipped twice during the lexical analysis.
@@ -3116,88 +3091,82 @@
if (lineComment) {
ch = nextChar();
- if (isLineTerminator(ch)) {
+ if (index >= length) {
+ lineComment = false;
+ comment += ch;
+ addComment(start, index, 'Line', comment);
+ } else if (isLineTerminator(ch)) {
lineComment = false;
- addComment(start, index - 1, 'Line', comment);
+ addComment(start, index, 'Line', comment);
if (ch === '\r' && source[index] === '\n') {
- nextChar();
+ ++index;
}
- lineNumber += 1;
- lineStart = index + 1;
+ ++lineNumber;
+ lineStart = index;
comment = '';
} else {
comment += ch;
}
} else if (blockComment) {
- ch = nextChar();
- comment += ch;
- if (ch === '*') {
- ch = source[index];
- if (ch === '/') {
- comment = comment.substr(0, comment.length - 1);
- blockComment = false;
- nextChar();
- addComment(start, index - 1, 'Block', comment);
- comment = '';
+ if (isLineTerminator(ch)) {
+ if (ch === '\r' && source[index + 1] === '\n') {
+ ++index;
+ comment += '\r\n';
+ } else {
+ comment += ch;
}
- } else if (isLineTerminator(ch)) {
- if (ch === '\r' && source[index] === '\n') {
- nextChar();
+ ++lineNumber;
+ ++index;
+ lineStart = index;
+ if (index >= length) {
+ throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
+ }
+ } else {
+ ch = nextChar();
+ if (index >= length) {
+ throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
+ }
+ comment += ch;
+ if (ch === '*') {
+ ch = source[index];
+ if (ch === '/') {
+ comment = comment.substr(0, comment.length - 1);
+ blockComment = false;
+ ++index;
+ addComment(start, index, 'Block', comment);
+ comment = '';
+ }
}
- lineNumber += 1;
- lineStart = index + 1;
}
} else if (ch === '/') {
ch = source[index + 1];
if (ch === '/') {
start = index;
- nextChar();
- nextChar();
+ index += 2;
lineComment = true;
} else if (ch === '*') {
start = index;
- nextChar();
- nextChar();
+ index += 2;
blockComment = true;
+ if (index >= length) {
+ throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
+ }
} else {
break;
}
} else if (isWhiteSpace(ch)) {
- nextChar();
+ ++index;
} else if (isLineTerminator(ch)) {
- nextChar();
- if (ch === '\r' && source[index] === '\n') {
- nextChar();
+ ++index;
+ if (ch === '\r' && source[index] === '\n') {
+ ++index;
}
- lineNumber += 1;
- lineStart = index + 1;
+ ++lineNumber;
+ lineStart = index;
} else {
break;
}
}
-
- addComment(start, index, (blockComment) ? 'Block' : 'Line', comment);
- }
-
- function tokenTypeAsString(type) {
- switch (type) {
- case Token.BooleanLiteral:
- return 'Boolean';
- case Token.Identifier:
- return 'Identifier';
- case Token.Keyword:
- return 'Keyword';
- case Token.NullLiteral:
- return 'Null';
- case Token.NumericLiteral:
- return 'Numeric';
- case Token.Punctuator:
- return 'Punctuator';
- case Token.StringLiteral:
- return 'String';
- default:
- throw new Error('Unknown token type');
- }
}
function collectToken() {
@@ -3206,10 +3175,10 @@
value;
if (token.type !== Token.EOF) {
- range = [token.range[0], token.range[1] - 1];
+ range = [token.range[0], token.range[1]];
value = sliceSource(token.range[0], token.range[1]);
extra.tokens.push({
- type: tokenTypeAsString(token.type),
+ type: TokenName[token.type],
value: value,
range: range
});
@@ -3239,7 +3208,7 @@
extra.tokens.push({
type: 'RegularExpression',
value: regex.literal,
- range: [pos, index - 1]
+ range: [pos, index]
});
return regex;
@@ -3270,34 +3239,21 @@
}
function visit(node) {
- if (range) {
- if (isBinary(node.left) && (typeof node.left.range === 'undefined')) {
- visit(node.left);
- }
- if (isBinary(node.right) && (typeof node.right.range === 'undefined')) {
- visit(node.right);
- }
-
- // Expression enclosed in brackets () already has the correct range.
- if (typeof node.range === 'undefined') {
- node.range = [node.left.range[0], node.right.range[1]];
- }
+ if (isBinary(node.left)) {
+ visit(node.left);
+ }
+ if (isBinary(node.right)) {
+ visit(node.right);
}
- if (loc) {
- if (isBinary(node.left) && (typeof node.left.loc === 'undefined')) {
- visit(node.left);
- }
- if (isBinary(node.right) && (typeof node.right.loc === 'undefined')) {
- visit(node.right);
- }
-
- if (typeof node.loc === 'undefined') {
- node.loc = {
- start: node.left.loc.start,
- end: node.right.loc.end
- };
- }
+ if (range && typeof node.range === 'undefined') {
+ node.range = [node.left.range[0], node.right.range[1]];
+ }
+ if (loc && typeof node.loc === 'undefined') {
+ node.loc = {
+ start: node.left.loc.start,
+ end: node.right.loc.end
+ };
}
}
@@ -3314,36 +3270,35 @@
};
node = parseFunction.apply(null, arguments);
- if (typeof node === 'undefined') {
- return;
- }
+ if (typeof node !== 'undefined') {
- if (range) {
- rangeInfo[1] = index - 1;
- node.range = rangeInfo;
- }
-
- if (loc) {
- locInfo.end = {
- line: lineNumber,
- column: index - lineStart
- };
- node.loc = locInfo;
- }
+ if (range) {
+ rangeInfo[1] = index;
+ node.range = rangeInfo;
+ }
- if (isBinary(node)) {
- visit(node);
- }
+ if (loc) {
+ locInfo.end = {
+ line: lineNumber,
+ column: index - lineStart
+ };
+ node.loc = locInfo;
+ }
- if (node.type === Syntax.MemberExpression) {
- if (typeof node.object.range !== 'undefined') {
- node.range[0] = node.object.range[0];
+ if (isBinary(node)) {
+ visit(node);
}
- if (typeof node.object.loc !== 'undefined') {
- node.loc.start = node.object.loc.start;
+
+ if (node.type === Syntax.MemberExpression) {
+ if (typeof node.object.range !== 'undefined') {
+ node.range[0] = node.object.range[0];
+ }
+ if (typeof node.object.loc !== 'undefined') {
+ node.loc.start = node.object.loc.start;
+ }
}
+ return node;
}
- return node;
};
};
@@ -3353,29 +3308,6 @@
var wrapTracking;
- function wrapThrow(parseFunction) {
- return function () {
- try {
- return parseFunction.apply(null, arguments);
- } catch (e) {
- pushError(e);
- return null;
- }
- };
- }
-
- function wrapThrowParseStatement(parseFunction) {
- return function () {
- extra.statementStart = index; // record where attempting to parse statement from
- try {
- return parseFunction.apply(null, arguments);
- } catch (e) {
- pushError(e);
-// return null;
- }
- };
- }
-
if (extra.comments) {
extra.skipComment = skipComment;
skipComment = scanComment;
@@ -3386,7 +3318,7 @@
createLiteral = createRawLiteral;
}
- if (extra.range || extra.loc || extra.errors) {
+ if (extra.range || extra.loc) {
wrapTracking = wrapTrackingFunction(extra.range, extra.loc);
@@ -3426,7 +3358,6 @@
extra.parseUnaryExpression = parseUnaryExpression;
extra.parseVariableDeclaration = parseVariableDeclaration;
extra.parseVariableIdentifier = parseVariableIdentifier;
- extra.consumeSemicolon = consumeSemicolon;
parseAdditiveExpression = wrapTracking(extra.parseAdditiveExpression);
parseAssignmentExpression = wrapTracking(extra.parseAssignmentExpression);
@@ -3466,14 +3397,6 @@
parseVariableIdentifier = wrapTracking(extra.parseVariableIdentifier);
}
- if (extra.errors) {
- parseStatement = wrapThrowParseStatement(parseStatement);
- parseExpression = wrapThrow(parseExpression);
- // this enables 'foo.' to return something
- parseNonComputedProperty = wrapThrow(parseNonComputedProperty);
- consumeSemicolon = wrapThrow(consumeSemicolon);
- }
-
if (typeof extra.tokens !== 'undefined') {
extra.advance = advance;
extra.scanRegExp = scanRegExp;
@@ -3492,7 +3415,7 @@
createLiteral = extra.createLiteral;
}
- if (extra.range || extra.loc || extra.errors) {
+ if (extra.range || extra.loc) {
parseAdditiveExpression = extra.parseAdditiveExpression;
parseAssignmentExpression = extra.parseAssignmentExpression;
parseBitwiseANDExpression = extra.parseBitwiseANDExpression;
@@ -3529,11 +3452,6 @@
parseUnaryExpression = extra.parseUnaryExpression;
parseVariableDeclaration = extra.parseVariableDeclaration;
parseVariableIdentifier = extra.parseVariableIdentifier;
- consumeSemicolon = extra.consumeSemicolon;
- }
-
- if (typeof extra.lex === 'function') {
- lex = extra.lex;
}
if (typeof extra.scanRegExp === 'function') {
@@ -3546,14 +3464,19 @@
var length = str.length,
result = [],
i;
- for (i = 0; i < length; i += 1) {
+ for (i = 0; i < length; ++i) {
result[i] = str.charAt(i);
}
return result;
}
function parse(code, options) {
- var program;
+ var program, toString;
+
+ toString = String;
+ if (typeof code !== 'string' && !(code instanceof String)) {
+ code = toString(code);
+ }
source = code;
index = 0;
@@ -3561,7 +3484,14 @@
lineStart = 0;
length = source.length;
buffer = null;
- allowIn = true;
+ state = {
+ allowIn: true,
+ labelSet: {},
+ lastParenthesized: null,
+ inFunctionBody: false,
+ inIteration: false,
+ inSwitch: false
+ };
extra = {};
if (typeof options !== 'undefined') {
@@ -3617,878 +3547,31 @@
return program;
}
- // Executes visitor on the object and its children (recursively).
-
- function traverse(object, visitor, master) {
- var key, child, parent, path;
-
- parent = (typeof master === 'undefined') ? [] : master;
-
- if (visitor.call(null, object, parent) === false) {
- return;
- }
- for (key in object) {
- if (object.hasOwnProperty(key)) {
- child = object[key];
- path = [ object ];
- path.push(parent);
- if (typeof child === 'object' && child !== null) {
- traverse(child, visitor, path);
- }
- }
- }
- }
-
- // Insert a prolog in the body of every function.
- // It will be in the form of a function call:
- //
- // traceName(object);
- //
- // where the object contains the following properties:
- //
- // 'name' holds the name of the function
- // 'lineNumber' holds the starting line number of the function block
- // 'range' contains the index-based range of the function
- //
- // The name of the function represents the associated reference for
- // the function (deduced on a best-effort basis if it is not
- // a function declaration).
- //
- // If traceName is a function instead of a string, it will be invoked and
- // the result will be used as the entire prolog. The arguments for the
- // invocation are the function name, range, and location info.
-
- function traceFunctionEntrance(traceName) {
-
- return function (code) {
- var tree,
- functionList,
- param,
- signature,
- pos,
- i;
-
-
- tree = parse(code, { range: true, loc: true });
-
- functionList = [];
- traverse(tree, function (node, path) {
- var parent;
- if (node.type === Syntax.FunctionDeclaration) {
- functionList.push({
- name: node.id.name,
- range: node.range,
- loc: node.loc,
- blockStart: node.body.range[0]
- });
- } else if (node.type === Syntax.FunctionExpression) {
- parent = path[0];
- if (parent.type === Syntax.AssignmentExpression) {
- if (typeof parent.left.range !== 'undefined') {
- functionList.push({
- name: code.slice(parent.left.range[0],
- parent.left.range[1] + 1),
- range: node.range,
- loc: node.loc,
- blockStart: node.body.range[0]
- });
- }
- } else if (parent.type === Syntax.VariableDeclarator) {
- functionList.push({
- name: parent.id.name,
- range: node.range,
- loc: node.loc,
- blockStart: node.body.range[0]
- });
- } else if (parent.type === Syntax.CallExpression) {
- functionList.push({
- name: parent.id ? parent.id.name : '[Anonymous]',
- range: node.range,
- loc: node.loc,
- blockStart: node.body.range[0]
- });
- } else if (typeof parent.length === 'number') {
- functionList.push({
- name: parent.id ? parent.id.name : '[Anonymous]',
- range: node.range,
- loc: node.loc,
- blockStart: node.body.range[0]
- });
- } else if (typeof parent.key !== 'undefined') {
- if (parent.key.type === 'Identifier') {
- if (parent.value === node && parent.key.name) {
- functionList.push({
- name: parent.key.name,
- range: node.range,
- loc: node.loc,
- blockStart: node.body.range[0]
- });
- }
- }
- }
- }
- });
-
- // Insert the instrumentation code from the last entry.
- // This is to ensure that the range for each entry remains valid)
- // (it won't shift due to some new inserting string before the range).
- for (i = functionList.length - 1; i >= 0; i -= 1) {
- param = {
- name: functionList[i].name,
- range: functionList[i].range,
- loc: functionList[i].loc
- };
- if (typeof traceName === 'function') {
- signature = traceName.call(null, param);
- } else {
- signature = traceName + '({ ';
- signature += 'name: \'' + functionList[i].name + '\', ';
- if (typeof functionList[i].loc !== 'undefined') {
- signature += 'lineNumber: ' + functionList[i].loc.start.line + ', ';
- }
- signature += 'range: [' + functionList[i].range[0] + ', ' +
- functionList[i].range[1] + '] ';
- signature += '});';
- }
- pos = functionList[i].blockStart + 1;
- code = code.slice(0, pos) + '\n' + signature + code.slice(pos, code.length);
- }
-
- return code;
- };
- }
-
- function modify(code, modifiers) {
- var i;
-
- if (Object.prototype.toString.call(modifiers) === '[object Array]') {
- for (i = 0; i < modifiers.length; i += 1) {
- code = modifiers[i].call(null, code);
- }
- } else if (typeof modifiers === 'function') {
- code = modifiers.call(null, code);
- } else {
- throw new Error('Wrong use of esprima.modify() function');
- }
-
- return code;
- }
-
- function unicodeEscape(ch) {
- var result, i;
- result = ch.charCodeAt(0).toString(16);
- for (i = result.length; i < 4; i += 1) {
- result = '0' + result;
- }
- return '\\u' + result;
- }
-
- function escapeString(str) {
- var result = '', i, len, ch;
-
- if (typeof str[0] === 'undefined') {
- str = stringToArray(str);
- }
-
- for (i = 0, len = str.length; i < len; i += 1) {
- ch = str[i];
- if ('\'\\\b\f\n\r\t'.indexOf(ch) >= 0) {
- result += '\\';
- switch (ch) {
- case '\'':
- result += '\'';
- break;
- case '\\':
- result += '\\';
- break;
- case '\b':
- result += 'b';
- break;
- case '\f':
- result += 'f';
- break;
- case '\n':
- result += 'n';
- break;
- case '\r':
- result += 'r';
- break;
- case '\t':
- result += 't';
- break;
- }
- } else if (ch < ' ' || ch.charCodeAt(0) >= 0x80) {
- result += unicodeEscape(ch);
- } else {
- result += ch;
- }
- }
-
- return '\'' + result + '\'';
- }
-
- BinaryPrecedence = {
- '||': Precedence.LogicalOR,
- '&&': Precedence.LogicalAND,
- '^': Precedence.LogicalXOR,
- '|': Precedence.BitwiseOR,
- '&': Precedence.BitwiseAND,
- '==': Precedence.Equality,
- '!=': Precedence.Equality,
- '===': Precedence.Equality,
- '!==': Precedence.Equality,
- '<': Precedence.Relational,
- '>': Precedence.Relational,
- '<=': Precedence.Relational,
- '>=': Precedence.Relational,
- 'in': Precedence.Relational,
- 'instanceof': Precedence.Relational,
- '<<': Precedence.BitwiseSHIFT,
- '>>': Precedence.BitwiseSHIFT,
- '>>>': Precedence.BitwiseSHIFT,
- '+': Precedence.Additive,
- '-': Precedence.Additive,
- '*': Precedence.Multiplicative,
- '%': Precedence.Multiplicative,
- '/': Precedence.Multiplicative
- };
-
- function addIndent(stmt) {
- return base + stmt;
- }
-
- function parenthesize(text, current, should) {
- return (current < should) ? '(' + text + ')' : text;
- }
-
- function maybeBlock(stmt, suffix) {
- var previousBase, result;
+ // Sync with package.json.
+ exports.version = '1.0.0-dev';
- if (stmt.type === Syntax.BlockStatement) {
- result = ' ' + generateStatement(stmt);
- if (suffix) {
- return result + ' ';
- }
- return result;
- }
+ exports.parse = parse;
- if (stmt.type === Syntax.EmptyStatement) {
- result = ';';
- } else {
- previousBase = base;
- base += indent;
- result = '\n' + addIndent(generateStatement(stmt));
- base = previousBase;
- }
+ // Deep copy.
+ exports.Syntax = (function () {
+ var name, types = {};
- if (suffix) {
- return result + addIndent('\n');
+ if (typeof Object.create === 'function') {
+ types = Object.create(null);
}
- return result;
- }
- function generateFunctionBody(node) {
- var result, i, len;
- result = '(';
- for (i = 0, len = node.params.length; i < len; i += 1) {
- result += node.params[i].name;
- if ((i + 1) < len) {
- result += ', ';
+ for (name in Syntax) {
+ if (Syntax.hasOwnProperty(name)) {
+ types[name] = Syntax[name];
}
}
- return result + ')' + maybeBlock(node.body);
- }
-
- function generateExpression(expr, precedence) {
- var result, currentPrecedence, previousBase, i, len, raw;
-
- if (!precedence) {
- precedence = Precedence.SequenceExpression;
- }
-
- switch (expr.type) {
- case Syntax.SequenceExpression:
- result = '';
- for (i = 0, len = expr.expressions.length; i < len; i += 1) {
- result += generateExpression(expr.expressions[i], Precedence.Assignment);
- if ((i + 1) < len) {
- result += ', ';
- }
- }
- result = parenthesize(result, Precedence.Sequence, precedence);
- break;
-
- case Syntax.AssignmentExpression:
- result = parenthesize(
- generateExpression(expr.left) + ' ' + expr.operator + ' ' +
- generateExpression(expr.right, Precedence.Assignment),
- Precedence.Assignment,
- precedence
- );
- break;
-
- case Syntax.ConditionalExpression:
- result = parenthesize(
- generateExpression(expr.test, Precedence.LogicalOR) + ' ? ' +
- generateExpression(expr.consequent, Precedence.Assignment) + ' : ' +
- generateExpression(expr.alternate, Precedence.Assignment),
- Precedence.Conditional,
- precedence
- );
- break;
-
- case Syntax.LogicalExpression:
- case Syntax.BinaryExpression:
- currentPrecedence = BinaryPrecedence[expr.operator];
-
- result = generateExpression(expr.left, currentPrecedence) +
- ' ' + expr.operator + ' ' +
- generateExpression(expr.right, currentPrecedence + 1);
- if (expr.operator === 'in') {
- // TODO parenthesize only in allowIn = false case
- result = '(' + result + ')';
- } else {
- result = parenthesize(result, currentPrecedence, precedence);
- }
- break;
-
- case Syntax.CallExpression:
- result = '';
- for (i = 0, len = expr['arguments'].length; i < len; i += 1) {
- result += generateExpression(expr['arguments'][i], Precedence.Assignment);
- if ((i + 1) < len) {
- result += ', ';
- }
- }
- result = parenthesize(
- generateExpression(expr.callee, Precedence.Call) + '(' + result + ')',
- Precedence.Call,
- precedence
- );
- break;
- case Syntax.NewExpression:
- result = '';
- for (i = 0, len = expr['arguments'].length; i < len; i += 1) {
- result += generateExpression(expr['arguments'][i], Precedence.Assignment);
- if ((i + 1) < len) {
- result += ', ';
- }
- }
- result = parenthesize(
- 'new ' + generateExpression(expr.callee, Precedence.New) + '(' + result + ')',
- Precedence.New,
- precedence
- );
- break;
-
- case Syntax.MemberExpression:
- result = generateExpression(expr.object, Precedence.Call);
- if (expr.computed) {
- result += '[' + generateExpression(expr.property) + ']';
- } else {
- if (expr.object.type === Syntax.Literal && typeof expr.object.value === 'number') {
- if (result.indexOf('.') < 0) {
- if (!/[eExX]/.test(result) && !(result.length >= 2 && result[0] === '0')) {
- result += '.';
- }
- }
- }
- result += '.' + expr.property.name;
- }
- result = parenthesize(result, Precedence.Member, precedence);
- break;
-
- case Syntax.UnaryExpression:
- result = expr.operator;
- if (result.length > 2) {
- result += ' ';
- }
- result = parenthesize(
- result + generateExpression(expr.argument, Precedence.Unary),
- Precedence.Unary,
- precedence
- );
- break;
-
- case Syntax.UpdateExpression:
- if (expr.prefix) {
- result = parenthesize(
- expr.operator +
- generateExpression(expr.argument, Precedence.Unary),
- Precedence.Unary,
- precedence
- );
- } else {
- result = parenthesize(
- generateExpression(expr.argument, Precedence.Postfix) +
- expr.operator,
- Precedence.Postfix,
- precedence
- );
- }
- break;
-
- case Syntax.FunctionExpression:
- result = 'function ';
- if (expr.id) {
- result += expr.id.name;
- }
- result += generateFunctionBody(expr);
- break;
-
- case Syntax.ArrayExpression:
- if (!expr.elements.length) {
- result = '[]';
- break;
- }
- result = '[\n';
- previousBase = base;
- base += indent;
- for (i = 0, len = expr.elements.length; i < len; i += 1) {
- if (!expr.elements[i]) {
- result += addIndent('');
- if ((i + 1) === len) {
- result += ',';
- }
- } else {
- result += addIndent(generateExpression(expr.elements[i], Precedence.Assignment));
- }
- if ((i + 1) < len) {
- result += ',\n';
- }
- }
- base = previousBase;
- result += '\n' + addIndent(']');
- break;
-
- case Syntax.Property:
- if (expr.kind === 'get' || expr.kind === 'set') {
- result = expr.kind + ' ' + generateExpression(expr.key) +
- generateFunctionBody(expr.value);
- } else {
- result = generateExpression(expr.key) + ': ' +
- generateExpression(expr.value, Precedence.Assignment);
- }
- break;
-
- case Syntax.ObjectExpression:
- if (!expr.properties.length) {
- result = '{}';
- break;
- }
- result = '{\n';
- previousBase = base;
- base += indent;
- for (i = 0, len = expr.properties.length; i < len; i += 1) {
- result += addIndent(generateExpression(expr.properties[i]));
- if ((i + 1) < len) {
- result += ',\n';
- }
- }
- base = previousBase;
- result += '\n' + addIndent('}');
- break;
-
- case Syntax.ThisExpression:
- result = 'this';
- break;
-
- case Syntax.Identifier:
- result = expr.name;
- break;
-
- case Syntax.Literal:
- if (expr.hasOwnProperty('raw')) {
- try {
- raw = parse(expr.raw).body[0].expression;
- if (raw.type === Syntax.Literal) {
- if (raw.value === expr.value) {
- result = expr.raw;
- break;
- }
- }
- } catch (e) {
- // not use raw property
- }
- }
-
- if (expr.value === null) {
- result = 'null';
- break;
- }
-
- if (typeof expr.value === 'string') {
- result = escapeString(expr.value);
- break;
- }
-
- if (typeof expr.value === 'number' && expr.value === Infinity) {
- // Infinity is variable
- result = '1e+1000';
- break;
- }
-
- result = expr.value.toString();
- break;
-
- default:
- break;
- }
-
- if (!result) {
- throw new Error('Unknown expression type: ' + expr.type);
+ if (typeof Object.freeze === 'function') {
+ Object.freeze(types);
}
- return result;
- }
-
- function generateStatement(stmt) {
- var i, len, result, previousBase;
-
- switch (stmt.type) {
- case Syntax.BlockStatement:
- result = '{\n';
-
- previousBase = base;
- base += indent;
- for (i = 0, len = stmt.body.length; i < len; i += 1) {
- result += addIndent(generateStatement(stmt.body[i])) + '\n';
- }
- base = previousBase;
-
- result += addIndent('}');
- break;
-
- case Syntax.BreakStatement:
- if (stmt.label) {
- result = 'break ' + stmt.label.name + ';';
- } else {
- result = 'break;';
- }
- break;
-
- case Syntax.ContinueStatement:
- if (stmt.label) {
- result = 'continue ' + stmt.label.name + ';';
- } else {
- result = 'continue;';
- }
- break;
-
- case Syntax.DoWhileStatement:
- result = 'do' + maybeBlock(stmt.body, true) + 'while (' + generateExpression(stmt.test) + ');';
- break;
- case Syntax.CatchClause:
- previousBase = base;
- base += indent;
- result = ' catch (' + generateExpression(stmt.param) + ')';
- base = previousBase;
- result += maybeBlock(stmt.body);
- break;
-
- case Syntax.DebuggerStatement:
- result = 'debugger;';
- break;
-
- case Syntax.EmptyStatement:
- result = ';';
- break;
-
- case Syntax.ExpressionStatement:
- result = generateExpression(stmt.expression);
- // 12.4 '{', 'function' is not allowed in this position.
- // wrap espression with parentheses
- if (result[0] === '{' || result.indexOf('function ') === 0) {
- result = '(' + result + ');';
- } else {
- result += ';';
- }
- break;
-
- case Syntax.VariableDeclarator:
- if (stmt.init) {
- result = stmt.id.name + ' = ' + generateExpression(stmt.init, Precedence.AssignmentExpression);
- } else {
- result = stmt.id.name;
- }
- break;
-
- case Syntax.VariableDeclaration:
- result = stmt.kind + ' ';
- // special path for
- // var x = function () {
- // };
- if (stmt.declarations.length === 1 && stmt.declarations[0].init &&
- stmt.declarations[0].init.type === Syntax.FunctionExpression) {
- result += generateStatement(stmt.declarations[0]);
- } else {
- previousBase = base;
- base += indent;
- for (i = 0, len = stmt.declarations.length; i < len; i += 1) {
- result += generateStatement(stmt.declarations[i]);
- if ((i + 1) < len) {
- result += ', ';
- }
- }
- base = previousBase;
- }
- result += ';';
- break;
-
- case Syntax.ThrowStatement:
- result = 'throw ' + generateExpression(stmt.argument) + ';';
- break;
-
- case Syntax.TryStatement:
- result = 'try' + maybeBlock(stmt.block);
- for (i = 0, len = stmt.handlers.length; i < len; i += 1) {
- result += generateStatement(stmt.handlers[i]);
- }
- if (stmt.finalizer) {
- result += ' finally' + maybeBlock(stmt.finalizer);
- }
- break;
-
- case Syntax.SwitchStatement:
- previousBase = base;
- base += indent;
- result = 'switch (' + generateExpression(stmt.discriminant) + ') {\n';
- base = previousBase;
- if (stmt.cases) {
- for (i = 0, len = stmt.cases.length; i < len; i += 1) {
- result += addIndent(generateStatement(stmt.cases[i])) + '\n';
- }
- }
- result += addIndent('}');
- break;
-
- case Syntax.SwitchCase:
- previousBase = base;
- base += indent;
- if (stmt.test) {
- result = 'case ' + generateExpression(stmt.test) + ':';
- } else {
- result = 'default:';
- }
-
- i = 0;
- len = stmt.consequent.length;
- if (len && stmt.consequent[0].type === Syntax.BlockStatement) {
- result += maybeBlock(stmt.consequent[0]);
- i = 1;
- }
-
- for (; i < len; i += 1) {
- result += '\n' + addIndent(generateStatement(stmt.consequent[i]));
- }
-
- base = previousBase;
- break;
-
- case Syntax.IfStatement:
- if (stmt.alternate) {
- if (stmt.alternate.type === Syntax.IfStatement) {
- previousBase = base;
- base += indent;
- result = 'if (' + generateExpression(stmt.test) + ')';
- base = previousBase;
- result += maybeBlock(stmt.consequent, true) + 'else ' + generateStatement(stmt.alternate);
- } else {
- previousBase = base;
- base += indent;
- result = 'if (' + generateExpression(stmt.test) + ')';
- base = previousBase;
- result += maybeBlock(stmt.consequent, true) + 'else' + maybeBlock(stmt.alternate);
- }
- } else {
- previousBase = base;
- base += indent;
- result = 'if (' + generateExpression(stmt.test) + ')';
- base = previousBase;
- result += maybeBlock(stmt.consequent);
- }
- break;
-
- case Syntax.ForStatement:
- previousBase = base;
- base += indent;
- result = 'for (';
- if (stmt.init) {
- if (stmt.init.type === Syntax.VariableDeclaration) {
- result += generateStatement(stmt.init);
- } else {
- result += generateExpression(stmt.init) + ';';
- }
- } else {
- result += ';';
- }
-
- if (stmt.test) {
- result += ' ' + generateExpression(stmt.test) + ';';
- } else {
- result += ';';
- }
-
- if (stmt.update) {
- result += ' ' + generateExpression(stmt.update) + ')';
- } else {
- result += ')';
- }
- base = previousBase;
-
- result += maybeBlock(stmt.body);
- break;
-
- case Syntax.ForInStatement:
- result = 'for (';
- if (stmt.left.type === Syntax.VariableDeclaration) {
- previousBase = base;
- base += indent + indent;
- result += stmt.left.kind + ' ' + generateStatement(stmt.left.declarations[0]);
- base = previousBase;
- } else {
- previousBase = base;
- base += indent;
- result += generateExpression(stmt.left);
- base = previousBase;
- }
-
- previousBase = base;
- base += indent;
- result += ' in ' + generateExpression(stmt.right) + ')';
- base = previousBase;
- result += maybeBlock(stmt.body);
- break;
-
- case Syntax.LabeledStatement:
- result = stmt.label.name + ':' + maybeBlock(stmt.body);
- break;
-
- case Syntax.Program:
- result = '';
- for (i = 0, len = stmt.body.length; i < len; i += 1) {
- result += generateStatement(stmt.body[i]);
- if ((i + 1) < len) {
- result += '\n';
- }
- }
- break;
-
- case Syntax.FunctionDeclaration:
- result = 'function ';
- if (stmt.id) {
- result += stmt.id.name;
- }
- result += generateFunctionBody(stmt);
- break;
-
- case Syntax.ReturnStatement:
- if (stmt.argument) {
- result = 'return ' + generateExpression(stmt.argument) + ';';
- } else {
- result = 'return;';
- }
- break;
-
- case Syntax.WhileStatement:
- previousBase = base;
- base += indent;
- result = 'while (' + generateExpression(stmt.test) + ')';
- base = previousBase;
- result += maybeBlock(stmt.body);
- break;
-
- case Syntax.WithStatement:
- previousBase = base;
- base += indent;
- result = 'with (' + generateExpression(stmt.object) + ')';
- base = previousBase;
- result += maybeBlock(stmt.body);
- break;
-
- default:
- break;
- }
-
- if (!result) {
- throw new Error('Unknown statement type: ' + stmt.type);
- }
- return result;
- }
-
- function generate(node, options) {
- if (typeof options !== 'undefined') {
- base = options.base || '';
- indent = options.indent || ' ';
- } else {
- base = '';
- indent = ' ';
- }
-
- switch (node.type) {
- case Syntax.BlockStatement:
- case Syntax.BreakStatement:
- case Syntax.CatchClause:
- case Syntax.ContinueStatement:
- case Syntax.DoWhileStatement:
- case Syntax.DebuggerStatement:
- case Syntax.EmptyStatement:
- case Syntax.ExpressionStatement:
- case Syntax.ForStatement:
- case Syntax.ForInStatement:
- case Syntax.FunctionDeclaration:
- case Syntax.IfStatement:
- case Syntax.LabeledStatement:
- case Syntax.Program:
- case Syntax.ReturnStatement:
- case Syntax.SwitchStatement:
- case Syntax.SwitchCase:
- case Syntax.ThrowStatement:
- case Syntax.TryStatement:
- case Syntax.VariableDeclaration:
- case Syntax.VariableDeclarator:
- case Syntax.WhileStatement:
- case Syntax.WithStatement:
- return generateStatement(node);
-
- case Syntax.AssignmentExpression:
- case Syntax.ArrayExpression:
- case Syntax.BinaryExpression:
- case Syntax.CallExpression:
- case Syntax.ConditionalExpression:
- case Syntax.FunctionExpression:
- case Syntax.Identifier:
- case Syntax.Literal:
- case Syntax.LogicalExpression:
- case Syntax.MemberExpression:
- case Syntax.NewExpression:
- case Syntax.ObjectExpression:
- case Syntax.Property:
- case Syntax.SequenceExpression:
- case Syntax.ThisExpression:
- case Syntax.UnaryExpression:
- case Syntax.UpdateExpression:
- return generateExpression(node);
-
- default:
- break;
- }
- throw new Error('Unknown node type: ' + node.type);
- }
-
- // Sync with package.json.
- exports.version = '0.9.9-dev';
-
- exports.parse = parse;
-
- exports.modify = modify;
-
- exports.generate = generate;
-
- exports.Tracer = {
- FunctionEntrance: traceFunctionEntrance
- };
+ return types;
+ }());
}(typeof exports === 'undefined' ? (esprima = {}) : exports));
/* vim: set sw=4 ts=4 et tw=80 : */
diff --git a/plugin-angularjs/core/pom.xml b/plugin-angularjs/core/pom.xml
index 50be6cc2b..fa1f86c4e 100644
--- a/plugin-angularjs/core/pom.xml
+++ b/plugin-angularjs/core/pom.xml
@@ -16,7 +16,7 @@
angularjs-parent
org.eclipse.che.plugin
- 3.12.2-SNAPSHOT
+ 3.14.2-SNAPSHOT
angularjs-core
pom
diff --git a/plugin-angularjs/core/server/pom.xml b/plugin-angularjs/core/server/pom.xml
index 4a1f883ae..9d2f9a9ad 100644
--- a/plugin-angularjs/core/server/pom.xml
+++ b/plugin-angularjs/core/server/pom.xml
@@ -16,60 +16,87 @@
angularjs-core
org.eclipse.che.plugin
- 3.12.2-SNAPSHOT
+ 3.14.2-SNAPSHOT
angularjs-core-server
jar
Che Plugin :: AngularJS :: Core :: Server
+
+ org.eclipse.che.core
+ che-core-api-core
+
+
+ com.google.inject
+ guice
+ provided
+
+
+ com.google.inject.extensions
+ guice-multibindings
+ provided
+
+
+ javax.inject
+ javax.inject
+ provided
+
org.eclipse.che.core
che-core-api-builder
- ${che.core.version}
provided
org.eclipse.che.core
che-core-api-project
- ${che.core.version}
provided
org.eclipse.che.core
che-core-api-runner
- ${che.core.version}
provided
org.eclipse.che.core
che-core-commons-gwt
- ${che.core.version}
+ provided
+
+
+ org.eclipse.che.core
+ che-core-commons-inject
provided
org.eclipse.che.core
che-core-ide-api
- ${che.core.version}
provided
org.eclipse.che.plugin
angularjs-api-server
- ${project.version}
provided
org.eclipse.che.plugin
angularjs-completion-dto
- ${project.version}
provided
org.eclipse.che.plugin
angularjs-completion-dto-gen
- ${project.version}
provided
+
+ junit
+ junit
+ ${junit.version}
+ test
+
+
+ org.eclipse.che.core
+ che-core-api-vfs
+ test
+
src/main/java
diff --git a/plugin-angularjs/core/server/src/main/java/com/codenvy/plugin/angularjs/core/server/ProjectTypeModule.java b/plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/server/ProjectTypeModule.java
similarity index 76%
rename from plugin-angularjs/core/server/src/main/java/com/codenvy/plugin/angularjs/core/server/ProjectTypeModule.java
rename to plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/server/ProjectTypeModule.java
index 43f9ef322..af79faee6 100644
--- a/plugin-angularjs/core/server/src/main/java/com/codenvy/plugin/angularjs/core/server/ProjectTypeModule.java
+++ b/plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/server/ProjectTypeModule.java
@@ -8,14 +8,14 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package com.codenvy.plugin.angularjs.core.server;
+package org.eclipse.che.plugin.angularjs.core.server;
import org.eclipse.che.api.project.server.type.ProjectType;
import org.eclipse.che.inject.DynaModule;
-import com.codenvy.plugin.angularjs.core.server.project.type.AngularJSProjectType;
-import com.codenvy.plugin.angularjs.core.server.project.type.BasicJSProjectType;
-import com.codenvy.plugin.angularjs.core.server.project.type.GruntJSProjectType;
-import com.codenvy.plugin.angularjs.core.server.project.type.GulpJSProjectType;
+import org.eclipse.che.plugin.angularjs.core.server.project.type.AngularJSProjectType;
+import org.eclipse.che.plugin.angularjs.core.server.project.type.BasicJSProjectType;
+import org.eclipse.che.plugin.angularjs.core.server.project.type.grunt.GruntJSProjectType;
+import org.eclipse.che.plugin.angularjs.core.server.project.type.gulp.GulpJSProjectType;
import com.google.inject.AbstractModule;
import com.google.inject.multibindings.Multibinder;
diff --git a/plugin-angularjs/core/server/src/main/java/com/codenvy/plugin/angularjs/core/server/project/type/AngularJSProjectType.java b/plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/server/project/type/AngularJSProjectType.java
similarity index 60%
rename from plugin-angularjs/core/server/src/main/java/com/codenvy/plugin/angularjs/core/server/project/type/AngularJSProjectType.java
rename to plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/server/project/type/AngularJSProjectType.java
index eb51817ae..a51c97543 100644
--- a/plugin-angularjs/core/server/src/main/java/com/codenvy/plugin/angularjs/core/server/project/type/AngularJSProjectType.java
+++ b/plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/server/project/type/AngularJSProjectType.java
@@ -8,11 +8,13 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package com.codenvy.plugin.angularjs.core.server.project.type;
+package org.eclipse.che.plugin.angularjs.core.server.project.type;
+import org.eclipse.che.plugin.angularjs.core.shared.ProjectAttributes;
import org.eclipse.che.api.project.server.type.ProjectType;
import org.eclipse.che.ide.Constants;
+import javax.inject.Inject;
import javax.inject.Singleton;
import java.util.Arrays;
@@ -23,11 +25,13 @@
@Singleton
public class AngularJSProjectType extends ProjectType {
- public AngularJSProjectType() {
- super("AngularJS", "AngularJS Project", true, false);
- addConstantDefinition(Constants.LANGUAGE, Constants.LANGUAGE, "javascript");
- addConstantDefinition(Constants.FRAMEWORK, Constants.FRAMEWORK, "AngularJS");
+ @Inject
+ public AngularJSProjectType(JSValueProviderFactory jsValueProviderFactory) {
+ super(ProjectAttributes.ANGULAR_JS_ID, ProjectAttributes.ANGULAR_JS_NAME, true, false);
+ addConstantDefinition(Constants.LANGUAGE, Constants.LANGUAGE, ProjectAttributes.PROGRAMMING_LANGUAGE);
+ addConstantDefinition(Constants.FRAMEWORK, Constants.FRAMEWORK, ProjectAttributes.ANGULAR_JS_FRAMEWORK);
+ addVariableDefinition(ProjectAttributes.HAS_JS_FILES, "project has js files", false, jsValueProviderFactory);
setDefaultRunner("system:/javascript/web/grunt");
- addRunnerCategories(Arrays.asList("javascript"));
+ addRunnerCategories(Arrays.asList(ProjectAttributes.RUNNER_CATEGORY));
}
}
diff --git a/plugin-angularjs/core/server/src/main/java/com/codenvy/plugin/angularjs/core/server/project/type/BasicJSProjectType.java b/plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/server/project/type/BasicJSProjectType.java
similarity index 60%
rename from plugin-angularjs/core/server/src/main/java/com/codenvy/plugin/angularjs/core/server/project/type/BasicJSProjectType.java
rename to plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/server/project/type/BasicJSProjectType.java
index 25ca31cc4..dfc3778de 100644
--- a/plugin-angularjs/core/server/src/main/java/com/codenvy/plugin/angularjs/core/server/project/type/BasicJSProjectType.java
+++ b/plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/server/project/type/BasicJSProjectType.java
@@ -8,11 +8,14 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package com.codenvy.plugin.angularjs.core.server.project.type;
+package org.eclipse.che.plugin.angularjs.core.server.project.type;
+
+import org.eclipse.che.plugin.angularjs.core.shared.ProjectAttributes;
import org.eclipse.che.api.project.server.type.ProjectType;
import org.eclipse.che.ide.Constants;
+import javax.inject.Inject;
import javax.inject.Singleton;
import java.util.Arrays;
@@ -24,12 +27,14 @@
@Singleton
public class BasicJSProjectType extends ProjectType {
- public BasicJSProjectType() {
- super("BasicJS", "BasicJS Project", true, false);
- addConstantDefinition(Constants.LANGUAGE, Constants.LANGUAGE, "javascript");
- addConstantDefinition(Constants.FRAMEWORK, Constants.FRAMEWORK, "BasicJS");
+ @Inject
+ public BasicJSProjectType(JSValueProviderFactory jsValueProviderFactory) {
+ super(ProjectAttributes.BASIC_JS_ID, ProjectAttributes.BASIC_JS_NAME, true, false);
+ addConstantDefinition(Constants.LANGUAGE, Constants.LANGUAGE, ProjectAttributes.PROGRAMMING_LANGUAGE);
+ addConstantDefinition(Constants.FRAMEWORK, Constants.FRAMEWORK, ProjectAttributes.BASIC_JS_FRAMEWORK);
+ addVariableDefinition(ProjectAttributes.HAS_JS_FILES, "project has js files", false, jsValueProviderFactory);
setDefaultRunner("system:/java/web/tomcat7");
- addRunnerCategories(Arrays.asList("javascript"));
+ addRunnerCategories(Arrays.asList(ProjectAttributes.RUNNER_CATEGORY));
}
}
diff --git a/plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/server/project/type/JSValueProviderFactory.java b/plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/server/project/type/JSValueProviderFactory.java
new file mode 100644
index 000000000..6ec8b87c5
--- /dev/null
+++ b/plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/server/project/type/JSValueProviderFactory.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Codenvy, S.A.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Codenvy, S.A. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.che.plugin.angularjs.core.server.project.type;
+
+import org.eclipse.che.api.core.ServerException;
+import org.eclipse.che.api.project.server.FolderEntry;
+import org.eclipse.che.api.project.server.InvalidValueException;
+import org.eclipse.che.api.project.server.ValueProvider;
+import org.eclipse.che.api.project.server.ValueProviderFactory;
+import org.eclipse.che.api.project.server.ValueStorageException;
+import org.eclipse.che.api.project.server.VirtualFileEntry;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import static org.eclipse.che.plugin.angularjs.core.shared.ProjectAttributes.HAS_JS_FILES;
+
+/**
+ * Provide value for specific property from JS project.
+ *
+ * @author Roman Nikitenko
+ */
+public class JSValueProviderFactory implements ValueProviderFactory {
+
+ public static final String JS_EXTESION = ".js";
+
+ @Override
+ public ValueProvider newInstance(FolderEntry projectFolder) {
+ return new JSValueProvider(projectFolder);
+ }
+
+ protected class JSValueProvider implements ValueProvider {
+
+ protected FolderEntry projectFolder;
+
+ protected JSValueProvider(FolderEntry projectFolder) {
+ this.projectFolder = projectFolder;
+ }
+
+ @Override
+ public List getValues(String attributeName) throws ValueStorageException {
+ try {
+ if (attributeName.equals(HAS_JS_FILES) && isFolderContainsJSFiles(projectFolder)) {
+ return Arrays.asList("true");
+ }
+ return Collections.emptyList();
+ } catch (ServerException e) {
+ throw new ValueStorageException(String.format("Can't get children for the project %s: ", projectFolder.getPath()) + e.getMessage());
+ }
+ }
+
+ @Override
+ public void setValues(String attributeName, List value) throws ValueStorageException, InvalidValueException {
+ //ignore for now
+ }
+
+ private boolean isFolderContainsJSFiles(FolderEntry folder) throws ServerException {
+ List children = folder.getChildren();
+ for (VirtualFileEntry child : children) {
+ if (child.isFile() && child.getPath().endsWith(JS_EXTESION)) {
+ return true;
+ }
+ if (child.isFolder() && isFolderContainsJSFiles((FolderEntry)child)) {
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+}
diff --git a/plugin-angularjs/core/server/src/main/java/com/codenvy/plugin/angularjs/core/server/project/type/GruntJSProjectType.java b/plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/server/project/type/grunt/GruntJSProjectType.java
similarity index 60%
rename from plugin-angularjs/core/server/src/main/java/com/codenvy/plugin/angularjs/core/server/project/type/GruntJSProjectType.java
rename to plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/server/project/type/grunt/GruntJSProjectType.java
index ef4afc254..bf985bb27 100644
--- a/plugin-angularjs/core/server/src/main/java/com/codenvy/plugin/angularjs/core/server/project/type/GruntJSProjectType.java
+++ b/plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/server/project/type/grunt/GruntJSProjectType.java
@@ -8,11 +8,14 @@
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package com.codenvy.plugin.angularjs.core.server.project.type;
+package org.eclipse.che.plugin.angularjs.core.server.project.type.grunt;
+
+import org.eclipse.che.plugin.angularjs.core.shared.ProjectAttributes;
import org.eclipse.che.api.project.server.type.ProjectType;
import org.eclipse.che.ide.Constants;
+import javax.inject.Inject;
import javax.inject.Singleton;
import java.util.Arrays;
@@ -24,12 +27,14 @@
@Singleton
public class GruntJSProjectType extends ProjectType {
- public GruntJSProjectType() {
- super("GruntJS", "GruntJS Project", true, false);
- addConstantDefinition(Constants.LANGUAGE, Constants.LANGUAGE, "javascript");
- addConstantDefinition(Constants.FRAMEWORK, Constants.FRAMEWORK, "BasicJS");
+ @Inject
+ public GruntJSProjectType(GruntValueProviderFactory gruntValueProviderFactory) {
+ super(ProjectAttributes.GRUNT_ID, ProjectAttributes.GRUNT_NAME, true, false);
+ addConstantDefinition(Constants.LANGUAGE, Constants.LANGUAGE, ProjectAttributes.PROGRAMMING_LANGUAGE);
+ addConstantDefinition(Constants.FRAMEWORK, Constants.FRAMEWORK, ProjectAttributes.BASIC_JS_FRAMEWORK);
+ addVariableDefinition(ProjectAttributes.HAS_CONFIG_FILE, "project has config file", false, gruntValueProviderFactory);
setDefaultRunner("system:/javascript/web/grunt");
- addRunnerCategories(Arrays.asList("javascript"));
+ addRunnerCategories(Arrays.asList(ProjectAttributes.RUNNER_CATEGORY));
}
diff --git a/plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/server/project/type/grunt/GruntValueProviderFactory.java b/plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/server/project/type/grunt/GruntValueProviderFactory.java
new file mode 100644
index 000000000..059e759c5
--- /dev/null
+++ b/plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/server/project/type/grunt/GruntValueProviderFactory.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Codenvy, S.A.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Codenvy, S.A. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.che.plugin.angularjs.core.server.project.type.grunt;
+
+import org.eclipse.che.api.core.ServerException;
+import org.eclipse.che.api.project.server.FileEntry;
+import org.eclipse.che.api.project.server.FolderEntry;
+import org.eclipse.che.api.project.server.InvalidValueException;
+import org.eclipse.che.api.project.server.ValueProvider;
+import org.eclipse.che.api.project.server.ValueProviderFactory;
+import org.eclipse.che.api.project.server.ValueStorageException;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import static org.eclipse.che.plugin.angularjs.core.shared.ProjectAttributes.HAS_CONFIG_FILE;
+
+/**
+ * Provide value for specific property from Grunt project.
+ *
+ * @author Roman Nikitenko
+ */
+public class GruntValueProviderFactory implements ValueProviderFactory {
+
+ public static final String GRUNT_JS_CONFIG_FILE = "gruntfile.js";
+ public static final String GRUNT_COFFEE_CONFIG_FILE = "gruntfile.coffee";
+
+ @Override
+ public ValueProvider newInstance(FolderEntry projectFolder) {
+ return new GruntValueProvider(projectFolder);
+ }
+
+ protected class GruntValueProvider implements ValueProvider {
+
+ protected FolderEntry projectFolder;
+
+ protected GruntValueProvider(FolderEntry projectFolder) {
+ this.projectFolder = projectFolder;
+ }
+
+ @Override
+ public List getValues(String attributeName) throws ValueStorageException {
+ try {
+ if (attributeName.equals(HAS_CONFIG_FILE) && isProjectContainsConfigFile(projectFolder)) {
+ return Arrays.asList("true");
+ }
+ return Collections.emptyList();
+ } catch (ServerException e) {
+ throw new ValueStorageException(String.format("Can't get children for the project %s: ", projectFolder.getPath()) + e.getMessage());
+ }
+ }
+
+ @Override
+ public void setValues(String attributeName, List value) throws ValueStorageException, InvalidValueException {
+ //ignore for now
+ }
+
+ private boolean isProjectContainsConfigFile(FolderEntry folder) throws ServerException {
+ List children = folder.getChildFiles();
+ for (FileEntry child : children) {
+ String path = child.getPath().toLowerCase();
+ if (path.endsWith(GRUNT_JS_CONFIG_FILE) || path.endsWith(GRUNT_COFFEE_CONFIG_FILE)) {
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+}
diff --git a/plugin-angularjs/core/server/src/main/java/com/codenvy/plugin/angularjs/core/server/project/type/GulpJSProjectType.java b/plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/server/project/type/gulp/GulpJSProjectType.java
similarity index 60%
rename from plugin-angularjs/core/server/src/main/java/com/codenvy/plugin/angularjs/core/server/project/type/GulpJSProjectType.java
rename to plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/server/project/type/gulp/GulpJSProjectType.java
index 82b4aa5d7..030073bea 100644
--- a/plugin-angularjs/core/server/src/main/java/com/codenvy/plugin/angularjs/core/server/project/type/GulpJSProjectType.java
+++ b/plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/server/project/type/gulp/GulpJSProjectType.java
@@ -9,15 +9,17 @@
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
-package com.codenvy.plugin.angularjs.core.server.project.type;
+package org.eclipse.che.plugin.angularjs.core.server.project.type.gulp;
+
+import org.eclipse.che.plugin.angularjs.core.shared.ProjectAttributes;
import org.eclipse.che.api.project.server.type.ProjectType;
import org.eclipse.che.ide.Constants;
+import javax.inject.Inject;
import javax.inject.Singleton;
import java.util.Arrays;
-
/**
* @author Vitaliy Parfonov
* @author Dmitry Shnurenko
@@ -25,11 +27,13 @@
@Singleton
public class GulpJSProjectType extends ProjectType {
- public GulpJSProjectType() {
- super("GulpJS", "GulpJS Project", true, false);
- addConstantDefinition(Constants.LANGUAGE, Constants.LANGUAGE, "javascript");
- addConstantDefinition(Constants.FRAMEWORK, Constants.FRAMEWORK, "BasicJS");
+ @Inject
+ public GulpJSProjectType(GulpValueProviderFactory gulpValueProviderFactory) {
+ super(ProjectAttributes.GULP_ID, ProjectAttributes.GULP_NAME, true, false);
+ addConstantDefinition(Constants.LANGUAGE, Constants.LANGUAGE, ProjectAttributes.PROGRAMMING_LANGUAGE);
+ addConstantDefinition(Constants.FRAMEWORK, Constants.FRAMEWORK, ProjectAttributes.BASIC_JS_FRAMEWORK);
+ addVariableDefinition(ProjectAttributes.HAS_CONFIG_FILE, "project has config file", false, gulpValueProviderFactory);
setDefaultRunner("system:/javascript/web/gulp");
- addRunnerCategories(Arrays.asList("javascript"));
+ addRunnerCategories(Arrays.asList(ProjectAttributes.RUNNER_CATEGORY));
}
}
diff --git a/plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/server/project/type/gulp/GulpValueProviderFactory.java b/plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/server/project/type/gulp/GulpValueProviderFactory.java
new file mode 100644
index 000000000..d76b2d87c
--- /dev/null
+++ b/plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/server/project/type/gulp/GulpValueProviderFactory.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Codenvy, S.A.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Codenvy, S.A. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.che.plugin.angularjs.core.server.project.type.gulp;
+
+import org.eclipse.che.api.core.ServerException;
+import org.eclipse.che.api.project.server.FileEntry;
+import org.eclipse.che.api.project.server.FolderEntry;
+import org.eclipse.che.api.project.server.InvalidValueException;
+import org.eclipse.che.api.project.server.ValueProvider;
+import org.eclipse.che.api.project.server.ValueProviderFactory;
+import org.eclipse.che.api.project.server.ValueStorageException;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import static org.eclipse.che.plugin.angularjs.core.shared.ProjectAttributes.HAS_CONFIG_FILE;
+
+/**
+ * Provide value for specific property from Gulp project.
+ *
+ * @author Roman Nikitenko
+ */
+public class GulpValueProviderFactory implements ValueProviderFactory {
+
+ public static final String GULP_CONFIG_FILE = "gulpfile.js";
+
+ @Override
+ public ValueProvider newInstance(FolderEntry projectFolder) {
+ return new GulpValueProvider(projectFolder);
+ }
+
+ protected class GulpValueProvider implements ValueProvider {
+
+ protected FolderEntry projectFolder;
+
+ protected GulpValueProvider(FolderEntry projectFolder) {
+ this.projectFolder = projectFolder;
+ }
+
+ @Override
+ public List getValues(String attributeName) throws ValueStorageException {
+ try {
+ if (attributeName.equals(HAS_CONFIG_FILE) && isProjectContainsConfigFile(projectFolder)) {
+ return Arrays.asList("true");
+ }
+ return Collections.emptyList();
+ } catch (ServerException e) {
+ throw new ValueStorageException(String.format("Can't get children for the project %s: ", projectFolder.getPath()) + e.getMessage());
+ }
+ }
+
+ @Override
+ public void setValues(String attributeName, List value) throws ValueStorageException, InvalidValueException {
+ //ignore for now
+ }
+
+ private boolean isProjectContainsConfigFile(FolderEntry folder) throws ServerException {
+ List children = folder.getChildFiles();
+ for (FileEntry child : children) {
+ String path = child.getPath().toLowerCase();
+ if (path.endsWith(GULP_CONFIG_FILE)) {
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+}
diff --git a/plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/shared/ProjectAttributes.java b/plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/shared/ProjectAttributes.java
new file mode 100644
index 000000000..253085384
--- /dev/null
+++ b/plugin-angularjs/core/server/src/main/java/org/eclipse/che/plugin/angularjs/core/shared/ProjectAttributes.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Codenvy, S.A.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Codenvy, S.A. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.che.plugin.angularjs.core.shared;
+
+/** @author Roman Nikitenko */
+public interface ProjectAttributes {
+ String BASIC_JS_ID = "BasicJS";
+ String BASIC_JS_NAME = "BasicJS Project";
+ String BASIC_JS_FRAMEWORK = "BasicJS";
+
+ String GRUNT_ID = "GruntJS";
+ String GRUNT_NAME = "GruntJS Project";
+
+ String GULP_ID = "GulpJS";
+ String GULP_NAME = "GulpJS Project";
+
+ String ANGULAR_JS_ID = "AngularJS";
+ String ANGULAR_JS_NAME = "AngularJS Project";
+ String ANGULAR_JS_FRAMEWORK = "AngularJS";
+
+ String RUNNER_CATEGORY = "javascript";
+ String PROGRAMMING_LANGUAGE = "javascript";
+
+ String HAS_CONFIG_FILE = "hasConfigFile";
+ String HAS_JS_FILES = "hasJSFiles";
+}
diff --git a/plugin-angularjs/core/server/src/test/java/org/eclipse/che/plugin/angularjs/core/server/project/type/JSValueProviderFactoryTest.java b/plugin-angularjs/core/server/src/test/java/org/eclipse/che/plugin/angularjs/core/server/project/type/JSValueProviderFactoryTest.java
new file mode 100644
index 000000000..673186d13
--- /dev/null
+++ b/plugin-angularjs/core/server/src/test/java/org/eclipse/che/plugin/angularjs/core/server/project/type/JSValueProviderFactoryTest.java
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Codenvy, S.A.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Codenvy, S.A. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.che.plugin.angularjs.core.server.project.type;
+
+import org.eclipse.che.api.core.notification.EventService;
+import org.eclipse.che.api.project.server.DefaultProjectManager;
+import org.eclipse.che.api.project.server.FolderEntry;
+import org.eclipse.che.api.project.server.Project;
+import org.eclipse.che.api.project.server.ProjectConfig;
+import org.eclipse.che.api.project.server.ProjectManager;
+import org.eclipse.che.api.project.server.handlers.ProjectHandler;
+import org.eclipse.che.api.project.server.handlers.ProjectHandlerRegistry;
+import org.eclipse.che.api.project.server.type.ProjectType;
+import org.eclipse.che.api.project.server.type.ProjectTypeRegistry;
+import org.eclipse.che.api.vfs.server.SystemPathsFilter;
+import org.eclipse.che.api.vfs.server.VirtualFileSystemRegistry;
+import org.eclipse.che.api.vfs.server.VirtualFileSystemUser;
+import org.eclipse.che.api.vfs.server.VirtualFileSystemUserContext;
+import org.eclipse.che.api.vfs.server.impl.memory.MemoryFileSystemProvider;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.ws.rs.core.MediaType;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
+import static org.junit.Assert.assertEquals;
+import static org.eclipse.che.plugin.angularjs.core.shared.ProjectAttributes.HAS_JS_FILES;
+
+/**
+ * Testing {@link JSValueProviderFactory} functionality.
+ *
+ * @author Roman Nikitenko.
+ */
+public class JSValueProviderFactoryTest {
+ private static final String workspace = "my_ws";
+
+ private ProjectManager pm;
+ private JSValueProviderFactory jsValueProviderFactory;
+
+ @Before
+ public void setUp() throws Exception {
+ final String vfsUser = "dev";
+ final Set vfsUserGroups = new LinkedHashSet<>(Arrays.asList("workspace/developer"));
+
+ final EventService eventService = new EventService();
+
+ VirtualFileSystemRegistry vfsRegistry = new VirtualFileSystemRegistry();
+ final MemoryFileSystemProvider memoryFileSystemProvider =
+ new MemoryFileSystemProvider(workspace, eventService, new VirtualFileSystemUserContext() {
+ @Override
+ public VirtualFileSystemUser getVirtualFileSystemUser() {
+ return new VirtualFileSystemUser(vfsUser, vfsUserGroups);
+ }
+ }, vfsRegistry, SystemPathsFilter.ANY);
+ vfsRegistry.registerProvider(workspace, memoryFileSystemProvider);
+
+
+ Set projectTypes = new HashSet<>();
+ jsValueProviderFactory = new JSValueProviderFactory();
+ projectTypes.add(new BasicJSProjectType(jsValueProviderFactory));
+ projectTypes.add(new AngularJSProjectType(jsValueProviderFactory));
+
+ ProjectTypeRegistry ptRegistry = new ProjectTypeRegistry(projectTypes);
+ Set handlers = new HashSet<>();
+ ProjectHandlerRegistry handlerRegistry = new ProjectHandlerRegistry(handlers);
+
+ pm = new DefaultProjectManager(vfsRegistry, eventService, ptRegistry, handlerRegistry);
+ }
+
+ @Test
+ public void testGetValuesWhenProjectContainsJSFiles() throws Exception {
+ Project jsProject = pm.createProject(workspace, "jsProject",
+ new ProjectConfig("test project", "BasicJS", new HashMap<>(), null, null, null), null, null);
+ FolderEntry baseFolder = jsProject.getBaseFolder();
+ baseFolder.createFile("test.js", "test".getBytes(), MediaType.TEXT_PLAIN);
+
+ List values = jsValueProviderFactory.newInstance(baseFolder).getValues(HAS_JS_FILES);
+
+ Assert.assertNotNull(values);
+ Assert.assertFalse(values.isEmpty());
+ assertEquals(1, values.size());
+ }
+
+ @Test
+ public void testGetValuesWhenProjectNotContainsJSFiles() throws Exception {
+ Project jsProject = pm.createProject(workspace, "jsProject",
+ new ProjectConfig("test project", "BasicJS", new HashMap<>(), null, null, null), null, null);
+ FolderEntry baseFolder = jsProject.getBaseFolder();
+ FolderEntry firstFolder = baseFolder.createFolder("firstFolder");
+ FolderEntry secondFolder = baseFolder.createFolder("secondFolder");
+ firstFolder.createFile("test.txt", "test".getBytes(), MediaType.TEXT_PLAIN);
+ secondFolder.createFile("test.java", "test".getBytes(), MediaType.TEXT_PLAIN);
+
+ List values = jsValueProviderFactory.newInstance(baseFolder).getValues(HAS_JS_FILES);
+
+ Assert.assertNotNull(values);
+ Assert.assertTrue(values.isEmpty());
+ }
+}
diff --git a/plugin-angularjs/core/server/src/test/java/org/eclipse/che/plugin/angularjs/core/server/project/type/grunt/GruntValueProviderFactoryTest.java b/plugin-angularjs/core/server/src/test/java/org/eclipse/che/plugin/angularjs/core/server/project/type/grunt/GruntValueProviderFactoryTest.java
new file mode 100644
index 000000000..63e23f384
--- /dev/null
+++ b/plugin-angularjs/core/server/src/test/java/org/eclipse/che/plugin/angularjs/core/server/project/type/grunt/GruntValueProviderFactoryTest.java
@@ -0,0 +1,128 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Codenvy, S.A.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Codenvy, S.A. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.che.plugin.angularjs.core.server.project.type.grunt;
+
+import org.eclipse.che.api.core.notification.EventService;
+import org.eclipse.che.api.project.server.DefaultProjectManager;
+import org.eclipse.che.api.project.server.FolderEntry;
+import org.eclipse.che.api.project.server.Project;
+import org.eclipse.che.api.project.server.ProjectConfig;
+import org.eclipse.che.api.project.server.ProjectManager;
+import org.eclipse.che.api.project.server.handlers.ProjectHandler;
+import org.eclipse.che.api.project.server.handlers.ProjectHandlerRegistry;
+import org.eclipse.che.api.project.server.type.ProjectType;
+import org.eclipse.che.api.project.server.type.ProjectTypeRegistry;
+import org.eclipse.che.api.vfs.server.SystemPathsFilter;
+import org.eclipse.che.api.vfs.server.VirtualFileSystemRegistry;
+import org.eclipse.che.api.vfs.server.VirtualFileSystemUser;
+import org.eclipse.che.api.vfs.server.VirtualFileSystemUserContext;
+import org.eclipse.che.api.vfs.server.impl.memory.MemoryFileSystemProvider;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.ws.rs.core.MediaType;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
+import static org.eclipse.che.plugin.angularjs.core.shared.ProjectAttributes.HAS_CONFIG_FILE;
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Testing {@link GruntValueProviderFactory} functionality.
+ *
+ * @author Roman Nikitenko.
+ */
+public class GruntValueProviderFactoryTest {
+ private static final String workspace = "my_ws";
+
+ private ProjectManager pm;
+ private GruntValueProviderFactory gruntValueProviderFactory;
+
+ @Before
+ public void setUp() throws Exception {
+ final String vfsUser = "dev";
+ final Set vfsUserGroups = new LinkedHashSet<>(Arrays.asList("workspace/developer"));
+
+ final EventService eventService = new EventService();
+
+ VirtualFileSystemRegistry vfsRegistry = new VirtualFileSystemRegistry();
+ final MemoryFileSystemProvider memoryFileSystemProvider =
+ new MemoryFileSystemProvider(workspace, eventService, new VirtualFileSystemUserContext() {
+ @Override
+ public VirtualFileSystemUser getVirtualFileSystemUser() {
+ return new VirtualFileSystemUser(vfsUser, vfsUserGroups);
+ }
+ }, vfsRegistry, SystemPathsFilter.ANY);
+ vfsRegistry.registerProvider(workspace, memoryFileSystemProvider);
+
+
+ Set projectTypes = new HashSet<>();
+ gruntValueProviderFactory = new GruntValueProviderFactory();
+ projectTypes.add(new GruntJSProjectType(gruntValueProviderFactory));
+
+ ProjectTypeRegistry ptRegistry = new ProjectTypeRegistry(projectTypes);
+ Set handlers = new HashSet<>();
+ ProjectHandlerRegistry handlerRegistry = new ProjectHandlerRegistry(handlers);
+
+ pm = new DefaultProjectManager(vfsRegistry, eventService, ptRegistry, handlerRegistry);
+ }
+
+ @Test
+ public void testGetValuesWhenProjectContains_gruntfile_js_configFile() throws Exception {
+ //test for project with Gruntfile.js config file
+ Project gruntProject = pm.createProject(workspace, "gruntProject",
+ new ProjectConfig("test project", "GruntJS", new HashMap<>(), null, null, null), null, null);
+ FolderEntry baseFolder = gruntProject.getBaseFolder();
+ baseFolder.createFile("Gruntfile.js", "test".getBytes(), MediaType.TEXT_PLAIN);
+
+ List values = gruntValueProviderFactory.newInstance(baseFolder).getValues(HAS_CONFIG_FILE);
+
+ Assert.assertNotNull(values);
+ Assert.assertFalse(values.isEmpty());
+ assertEquals(1, values.size());
+ }
+
+ @Test
+ public void testGetValuesWhenProjectContains_gruntfile_coffee_configFile() throws Exception {
+ //test for project with Gruntfile.coffee config file
+ Project gruntProject = pm.createProject(workspace, "gruntProject",
+ new ProjectConfig("test project", "GruntJS", new HashMap<>(), null, null, null), null, null);
+ FolderEntry baseFolder = gruntProject.getBaseFolder();
+ baseFolder.createFile("Gruntfile.coffee", "test".getBytes(), MediaType.TEXT_PLAIN);
+
+ List values = gruntValueProviderFactory.newInstance(baseFolder).getValues(HAS_CONFIG_FILE);
+
+ Assert.assertNotNull(values);
+ Assert.assertFalse(values.isEmpty());
+ assertEquals(1, values.size());
+ }
+
+ @Test
+ public void testGetValuesWhenProjectNotContainsConfigFile() throws Exception {
+ Project gruntProject = pm.createProject(workspace, "gruntProject",
+ new ProjectConfig("test project", "GruntJS", new HashMap<>(), null, null, null), null, null);
+ FolderEntry baseFolder = gruntProject.getBaseFolder();
+ FolderEntry firstFolder = baseFolder.createFolder("firstFolder");
+ FolderEntry secondFolder = baseFolder.createFolder("secondFolder");
+ firstFolder.createFile("test.txt", "test".getBytes(), MediaType.TEXT_PLAIN);
+ secondFolder.createFile("test.java", "test".getBytes(), MediaType.TEXT_PLAIN);
+
+ List values = gruntValueProviderFactory.newInstance(baseFolder).getValues(HAS_CONFIG_FILE);
+
+ Assert.assertNotNull(values);
+ Assert.assertTrue(values.isEmpty());
+ }
+}
diff --git a/plugin-angularjs/core/server/src/test/java/org/eclipse/che/plugin/angularjs/core/server/project/type/gulp/GulpValueProviderFactoryTest.java b/plugin-angularjs/core/server/src/test/java/org/eclipse/che/plugin/angularjs/core/server/project/type/gulp/GulpValueProviderFactoryTest.java
new file mode 100644
index 000000000..9d6481793
--- /dev/null
+++ b/plugin-angularjs/core/server/src/test/java/org/eclipse/che/plugin/angularjs/core/server/project/type/gulp/GulpValueProviderFactoryTest.java
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Codenvy, S.A.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Codenvy, S.A. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.che.plugin.angularjs.core.server.project.type.gulp;
+
+import org.eclipse.che.api.core.notification.EventService;
+import org.eclipse.che.api.project.server.DefaultProjectManager;
+import org.eclipse.che.api.project.server.FolderEntry;
+import org.eclipse.che.api.project.server.Project;
+import org.eclipse.che.api.project.server.ProjectConfig;
+import org.eclipse.che.api.project.server.ProjectManager;
+import org.eclipse.che.api.project.server.handlers.ProjectHandler;
+import org.eclipse.che.api.project.server.handlers.ProjectHandlerRegistry;
+import org.eclipse.che.api.project.server.type.ProjectType;
+import org.eclipse.che.api.project.server.type.ProjectTypeRegistry;
+import org.eclipse.che.api.vfs.server.SystemPathsFilter;
+import org.eclipse.che.api.vfs.server.VirtualFileSystemRegistry;
+import org.eclipse.che.api.vfs.server.VirtualFileSystemUser;
+import org.eclipse.che.api.vfs.server.VirtualFileSystemUserContext;
+import org.eclipse.che.api.vfs.server.impl.memory.MemoryFileSystemProvider;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.ws.rs.core.MediaType;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
+import static org.eclipse.che.plugin.angularjs.core.shared.ProjectAttributes.HAS_CONFIG_FILE;
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Testing {@link GulpValueProviderFactory} functionality.
+ *
+ * @author Roman Nikitenko.
+ */
+public class GulpValueProviderFactoryTest {
+ private static final String workspace = "my_ws";
+
+ private ProjectManager pm;
+ private GulpValueProviderFactory gulpValueProviderFactory;
+
+ @Before
+ public void setUp() throws Exception {
+ final String vfsUser = "dev";
+ final Set vfsUserGroups = new LinkedHashSet<>(Arrays.asList("workspace/developer"));
+
+ final EventService eventService = new EventService();
+
+ VirtualFileSystemRegistry vfsRegistry = new VirtualFileSystemRegistry();
+ final MemoryFileSystemProvider memoryFileSystemProvider =
+ new MemoryFileSystemProvider(workspace, eventService, new VirtualFileSystemUserContext() {
+ @Override
+ public VirtualFileSystemUser getVirtualFileSystemUser() {
+ return new VirtualFileSystemUser(vfsUser, vfsUserGroups);
+ }
+ }, vfsRegistry, SystemPathsFilter.ANY);
+ vfsRegistry.registerProvider(workspace, memoryFileSystemProvider);
+
+
+ Set projectTypes = new HashSet<>();
+ gulpValueProviderFactory = new GulpValueProviderFactory();
+ projectTypes.add(new GulpJSProjectType(gulpValueProviderFactory));
+
+ ProjectTypeRegistry ptRegistry = new ProjectTypeRegistry(projectTypes);
+ Set handlers = new HashSet<>();
+ ProjectHandlerRegistry handlerRegistry = new ProjectHandlerRegistry(handlers);
+
+ pm = new DefaultProjectManager(vfsRegistry, eventService, ptRegistry, handlerRegistry);
+ }
+
+ @Test
+ public void testGetValuesWhenProjectContainsConfigFile() throws Exception {
+ Project gulpProject = pm.createProject(workspace, "gulpProject",
+ new ProjectConfig("test project", "GulpJS", new HashMap<>(), null, null, null), null, null);
+ FolderEntry baseFolder = gulpProject.getBaseFolder();
+ baseFolder.createFile("Gulpfile.js", "test".getBytes(), MediaType.TEXT_PLAIN);
+
+ List values = gulpValueProviderFactory.newInstance(baseFolder).getValues(HAS_CONFIG_FILE);
+
+ Assert.assertNotNull(values);
+ Assert.assertFalse(values.isEmpty());
+ assertEquals(1, values.size());
+ }
+
+ @Test
+ public void testGetValuesWhenProjectNotContainsConfigFile() throws Exception {
+ Project gulpProject = pm.createProject(workspace, "gulpProject",
+ new ProjectConfig("test project", "GulpJS", new HashMap<>(), null, null, null), null, null);
+ FolderEntry baseFolder = gulpProject.getBaseFolder();
+ FolderEntry firstFolder = baseFolder.createFolder("firstFolder");
+ FolderEntry secondFolder = baseFolder.createFolder("secondFolder");
+ firstFolder.createFile("test.txt", "test".getBytes(), MediaType.TEXT_PLAIN);
+ secondFolder.createFile("test.java", "test".getBytes(), MediaType.TEXT_PLAIN);
+
+ List values = gulpValueProviderFactory.newInstance(baseFolder).getValues(HAS_CONFIG_FILE);
+
+ Assert.assertNotNull(values);
+ Assert.assertTrue(values.isEmpty());
+ }
+}
diff --git a/plugin-angularjs/pom.xml b/plugin-angularjs/pom.xml
index e15de6023..9be2a9d0d 100644
--- a/plugin-angularjs/pom.xml
+++ b/plugin-angularjs/pom.xml
@@ -16,7 +16,7 @@
che-plugin-parent
org.eclipse.che.plugin
- 3.12.2-SNAPSHOT
+ 3.14.2-SNAPSHOT
../pom.xml
angularjs-parent
@@ -28,30 +28,10 @@
completion
core
templates
+ assembly
2014
-
-
-
-
- org.codehaus.mojo
- findbugs-maven-plugin
-
-
-
- check
-
-
-
-
- Max
- Low
- true
-
-
-
-
diff --git a/plugin-angularjs/templates/angular-seed/pom.xml b/plugin-angularjs/templates/angular-seed/pom.xml
index e55e73e45..daa6eb578 100644
--- a/plugin-angularjs/templates/angular-seed/pom.xml
+++ b/plugin-angularjs/templates/angular-seed/pom.xml
@@ -16,9 +16,31 @@
angularjs-templates
org.eclipse.che.plugin
- 3.12.2-SNAPSHOT
+ 3.14.2-SNAPSHOT
angularjs-template-angular-seed
jar
Che Plugin :: AngularJS :: Templates :: Angular Seed
+
+
+ com.google.inject
+ guice
+
+
+ com.google.inject.extensions
+ guice-multibindings
+
+
+ javax.inject
+ javax.inject
+
+
+ org.eclipse.che.core
+ che-core-api-project
+
+
+ org.eclipse.che.core
+ che-core-commons-inject
+
+
diff --git a/plugin-angularjs/templates/gulp-angularjs-starter/pom.xml b/plugin-angularjs/templates/gulp-angularjs-starter/pom.xml
index a15ab1014..d3f62acaa 100644
--- a/plugin-angularjs/templates/gulp-angularjs-starter/pom.xml
+++ b/plugin-angularjs/templates/gulp-angularjs-starter/pom.xml
@@ -16,9 +16,31 @@
angularjs-templates
org.eclipse.che.plugin
- 3.12.2-SNAPSHOT
+ 3.14.2-SNAPSHOT
angularjs-template-gulp-angularjs-starter
jar
Che Plugin :: AngularJS :: Templates :: Gulp Starter
+
+
+ com.google.inject
+ guice
+
+
+ com.google.inject.extensions
+ guice-multibindings
+
+
+ javax.inject
+ javax.inject
+
+
+ org.eclipse.che.core
+ che-core-api-project
+
+
+ org.eclipse.che.core
+ che-core-commons-inject
+
+
diff --git a/plugin-angularjs/templates/pom.xml b/plugin-angularjs/templates/pom.xml
index c318041da..1d604459d 100644
--- a/plugin-angularjs/templates/pom.xml
+++ b/plugin-angularjs/templates/pom.xml
@@ -16,7 +16,7 @@
angularjs-parent
org.eclipse.che.plugin
- 3.12.2-SNAPSHOT
+ 3.14.2-SNAPSHOT
angularjs-templates
pom
@@ -30,7 +30,6 @@
org.eclipse.che.plugin
angularjs-api-server
- ${project.version}
diff --git a/plugin-angularjs/templates/yeoman/pom.xml b/plugin-angularjs/templates/yeoman/pom.xml
index d0b0b1b79..83ae9f149 100644
--- a/plugin-angularjs/templates/yeoman/pom.xml
+++ b/plugin-angularjs/templates/yeoman/pom.xml
@@ -16,9 +16,31 @@
angularjs-templates
org.eclipse.che.plugin
- 3.12.2-SNAPSHOT
+ 3.14.2-SNAPSHOT
angularjs-template-yeoman
jar
Che Plugin :: AngularJS :: Templates :: Yeoman
+
+
+ com.google.inject
+ guice
+
+
+ com.google.inject.extensions
+ guice-multibindings
+
+
+ javax.inject
+ javax.inject
+
+
+ org.eclipse.che.core
+ che-core-api-project
+
+
+ org.eclipse.che.core
+ che-core-commons-inject
+
+
diff --git a/plugin-bower/che-plugin-bower-builder/pom.xml b/plugin-bower/che-plugin-bower-builder/pom.xml
index c7a04c713..ebf801390 100644
--- a/plugin-bower/che-plugin-bower-builder/pom.xml
+++ b/plugin-bower/che-plugin-bower-builder/pom.xml
@@ -16,17 +16,45 @@
che-plugin-bower-parent
org.eclipse.che.plugin
- 3.12.2-SNAPSHOT
+ 3.14.2-SNAPSHOT
che-plugin-bower-builder
jar
Che Plugin :: Bower :: Builder
-
+
+ com.google.inject
+ guice
+ provided
+
+
+ com.google.inject.extensions
+ guice-multibindings
+ provided
+
+
+ javax.inject
+ javax.inject
+ provided
+
org.eclipse.che.core
che-core-api-builder
- ${che.core.version}
+ provided
+
+
+ org.eclipse.che.core
+ che-core-api-core
+ provided
+
+
+ org.eclipse.che.core
+ che-core-commons-inject
+ provided
+
+
+ org.eclipse.che.core
+ che-core-commons-lang
provided
diff --git a/plugin-bower/che-plugin-bower-ext-client/pom.xml b/plugin-bower/che-plugin-bower-ext-client/pom.xml
index c27e01337..d125e1d5d 100644
--- a/plugin-bower/che-plugin-bower-ext-client/pom.xml
+++ b/plugin-bower/che-plugin-bower-ext-client/pom.xml
@@ -16,7 +16,7 @@
che-plugin-bower-parent
org.eclipse.che.plugin
- 3.12.2-SNAPSHOT
+ 3.14.2-SNAPSHOT
che-plugin-bower-ext-client
jar
@@ -25,67 +25,101 @@
com.google.gwt
gwt-user
- ${com.google.gwt.version}
+ provided
+
+
+ com.google.inject
+ guice
+ provided
+
+
+ javax.inject
+ javax.inject
+ provided
+
+
+ javax.validation
+ validation-api
+ provided
+
+
+ org.eclipse.che.core
+ che-core-api-analytics
provided
org.eclipse.che.core
che-core-api-builder
- ${che.core.version}
+ provided
+
+
+ org.eclipse.che.core
+ che-core-api-core
provided
org.eclipse.che.core
che-core-api-project
- ${che.core.version}
provided
org.eclipse.che.core
che-core-api-runner
- ${che.core.version}
+ provided
+
+
+ org.eclipse.che.core
+ che-core-client-gwt-builder
+ provided
+
+
+ org.eclipse.che.core
+ che-core-client-gwt-project
provided
org.eclipse.che.core
che-core-commons-gwt
- ${che.core.version}
provided
org.eclipse.che.core
che-core-ide-api
- ${che.core.version}
+ provided
+
+
+ org.eclipse.che.core
+ che-core-ide-app
provided
org.eclipse.che.plugin
che-plugin-builder-ext-builder
- ${project.version}
provided
org.eclipse.che.plugin
che-plugin-web-ext-web
- ${project.version}
+ provided
+
+
+ org.vectomatic
+ lib-gwt-svg
provided
com.googlecode.gwt-test-utils
gwt-test-utils
- ${com.googlecode.gwt-test-utils.version}
test
junit
junit
- ${junit.version}
test
org.mockito
mockito-core
- ${org.mockito.version}
test
@@ -109,23 +143,5 @@
src/test/resources
-
-
- org.codehaus.mojo
- findbugs-maven-plugin
-
-
-
- check
-
-
-
-
- Max
- Default
- true
-
-
-
diff --git a/plugin-bower/che-plugin-bower-ext-client/src/main/java/org/eclipse/che/plugin/bower/client/BowerExtension.java b/plugin-bower/che-plugin-bower-ext-client/src/main/java/org/eclipse/che/plugin/bower/client/BowerExtension.java
index 3e62553c7..e2ab52265 100644
--- a/plugin-bower/che-plugin-bower-ext-client/src/main/java/org/eclipse/che/plugin/bower/client/BowerExtension.java
+++ b/plugin-bower/che-plugin-bower-ext-client/src/main/java/org/eclipse/che/plugin/bower/client/BowerExtension.java
@@ -31,7 +31,7 @@
import com.google.inject.Singleton;
import com.google.web.bindery.event.shared.EventBus;
-import javax.annotation.Nonnull;
+import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Map;
@@ -71,7 +71,7 @@ public BowerExtension(ActionManager actionManager,
// Install Bower dependencies when projects is being opened and that there is no app/bower_components
eventBus.addHandler(ProjectActionEvent.TYPE, new ProjectActionHandler() {
@Override
- public void onProjectOpened(ProjectActionEvent event) {
+ public void onProjectReady(ProjectActionEvent event) {
final ProjectDescriptor project = event.getProject();
boolean isBowerJsProject = isBowerJsProject(project);
@@ -144,12 +144,17 @@ public void onProjectClosed(ProjectActionEvent event) {
}
+ @Override
+ public void onProjectOpened(ProjectActionEvent event) {
+
+ }
+
});
}
- private boolean isBowerJsProject(@Nonnull ProjectDescriptor projectDescriptor) {
+ private boolean isBowerJsProject(@NotNull ProjectDescriptor projectDescriptor) {
Map> attributes = projectDescriptor.getAttributes();
if (attributes.containsKey(Constants.FRAMEWORK)) {
List frameworks = attributes.get(Constants.FRAMEWORK);
diff --git a/plugin-bower/che-plugin-bower-ext-client/src/main/java/org/eclipse/che/plugin/bower/client/builder/BuilderAgent.java b/plugin-bower/che-plugin-bower-ext-client/src/main/java/org/eclipse/che/plugin/bower/client/builder/BuilderAgent.java
index 44ba2ade5..90c07f565 100644
--- a/plugin-bower/che-plugin-bower-ext-client/src/main/java/org/eclipse/che/plugin/bower/client/builder/BuilderAgent.java
+++ b/plugin-bower/che-plugin-bower-ext-client/src/main/java/org/eclipse/che/plugin/bower/client/builder/BuilderAgent.java
@@ -99,7 +99,8 @@ protected void buildSuccessful(Notification notification, String successMessage,
* @param prefixConsole the prefix to show in the console
* @param buildFinishedCallback an optional callback to call when the build has finished
*/
- public void build(final BuildOptions buildOptions, final String waitMessage, final String successMessage, final String errorMessage, final String prefixConsole,
+ public void build(final BuildOptions buildOptions, final String waitMessage, final String successMessage, final String errorMessage,
+ final String prefixConsole,
final BuildFinishedCallback buildFinishedCallback) {
// Start a build so print a new notification message
@@ -155,10 +156,10 @@ protected void onFailure(Throwable exception) {
* @param buildFinishedCallback
*/
protected void startChecking(final Notification notification, final BuildTaskDescriptor buildTaskDescriptor,
- final String successMessage, final String errorMessage, final String prefixConsole,
- final BuildFinishedCallback buildFinishedCallback) {
+ final String successMessage, final String errorMessage, final String prefixConsole,
+ final BuildFinishedCallback buildFinishedCallback) {
- final SubscriptionHandler buildOutputHandler = new SubscriptionHandler(new LineUnmarshaller()) {
+ final SubscriptionHandler buildOutputHandler = new SubscriptionHandler(new LineUnmarshaller()) {
@Override
protected void onMessageReceived(String result) {
console.print(prefixConsole + "::" + result);
@@ -178,7 +179,8 @@ protected void onErrorReceived(Throwable throwable) {
final SubscriptionHandler buildStatusHandler = new SubscriptionHandler(new StringUnmarshallerWS()) {
@Override
protected void onMessageReceived(String result) {
- updateBuildStatus(notification, dtoFactory.createDtoFromJson(result, BuildTaskDescriptor.class), this, buildOutputHandler, successMessage,
+ updateBuildStatus(notification, dtoFactory.createDtoFromJson(result, BuildTaskDescriptor.class), this, buildOutputHandler,
+ successMessage,
errorMessage, prefixConsole, buildFinishedCallback);
}
@@ -213,7 +215,6 @@ protected void onErrorReceived(Throwable exception) {
}
-
/**
* Check for status and display necessary messages.
*
@@ -221,14 +222,16 @@ protected void onErrorReceived(Throwable exception) {
* status of build
*/
protected void updateBuildStatus(Notification notification, BuildTaskDescriptor descriptor,
- SubscriptionHandler buildStatusHandler, SubscriptionHandler buildOutputHandler, final String successMessage, final String errorMessage, final String prefixConsole,
- final BuildFinishedCallback buildFinishedCallback) {
+ SubscriptionHandler buildStatusHandler, SubscriptionHandler buildOutputHandler,
+ final String successMessage, final String errorMessage, final String prefixConsole,
+ final BuildFinishedCallback buildFinishedCallback) {
BuildStatus status = descriptor.getStatus();
if (status == BuildStatus.IN_PROGRESS || status == BuildStatus.IN_QUEUE) {
return;
}
if (status == BuildStatus.CANCELLED || status == BuildStatus.FAILED || status == BuildStatus.SUCCESSFUL) {
- afterBuildFinished(notification, descriptor, buildStatusHandler, buildOutputHandler, successMessage, errorMessage, prefixConsole, buildFinishedCallback);
+ afterBuildFinished(notification, descriptor, buildStatusHandler, buildOutputHandler, successMessage, errorMessage,
+ prefixConsole, buildFinishedCallback);
}
}
@@ -239,8 +242,9 @@ protected void updateBuildStatus(Notification notification, BuildTaskDescriptor
* status of build job
*/
protected void afterBuildFinished(Notification notification, BuildTaskDescriptor descriptor,
- SubscriptionHandler buildStatusHandler, SubscriptionHandler buildOutputHandler, final String successMessage, final String errorMessage, final String prefixConsole,
- BuildFinishedCallback buildFinishedCallback) {
+ SubscriptionHandler buildStatusHandler, SubscriptionHandler buildOutputHandler,
+ final String successMessage, final String errorMessage, final String prefixConsole,
+ BuildFinishedCallback buildFinishedCallback) {
try {
messageBus.unsubscribe(BuilderExtension.BUILD_STATUS_CHANNEL + descriptor.getTaskId(), buildStatusHandler);
} catch (Exception e) {
@@ -274,7 +278,8 @@ protected void afterBuildFinished(Notification notification, BuildTaskDescriptor
* @param descriptor the build descriptor
* @param buildFinishedCallback the callback to call
*/
- protected void importZipResult(final BuildTaskDescriptor descriptor, final BuildFinishedCallback buildFinishedCallback, final Notification notification, final String errorMessage) {
+ protected void importZipResult(final BuildTaskDescriptor descriptor, final BuildFinishedCallback buildFinishedCallback,
+ final Notification notification, final String errorMessage) {
Link downloadLink = null;
List links = descriptor.getLinks();
for (Link link : links) {
@@ -285,29 +290,13 @@ protected void importZipResult(final BuildTaskDescriptor descriptor, final Build
if (downloadLink != null) {
- ImportProject importProject = dtoFactory.createDto(ImportProject.class).withSource(dtoFactory.createDto(Source.class).withProject(
- dtoFactory.createDto(ImportSourceDescriptor.class).withLocation(downloadLink.getHref()).withType("zip")));
-
- projectServiceClient.importProject(appContext.getCurrentProject().getProjectDescription().getPath(), true, importProject,
- new AsyncRequestCallback() {
- @Override
- protected void onSuccess(ImportResponse projectDescriptor) {
- // notify callback
- if (buildFinishedCallback != null) {
- buildFinishedCallback.onFinished(descriptor.getStatus());
- }
- }
+ ImportProject importProject =
+ dtoFactory.createDto(ImportProject.class).withSource(dtoFactory.createDto(Source.class).withProject(
+ dtoFactory.createDto(ImportSourceDescriptor.class).withLocation(downloadLink.getHref()).withType("zip")));
- @Override
- protected void onFailure(Throwable throwable) {
- notification.setMessage(errorMessage + ":" + throwable.getMessage());
- notification.setStatus(FINISHED);
- notification.setType(ERROR);
- if (buildFinishedCallback != null) {
- buildFinishedCallback.onFinished(descriptor.getStatus());
- }
- }
- });
+ projectServiceClient.importProject(appContext.getCurrentProject().getProjectDescription().getPath(), true, importProject,
+ new ImportResponseAsyncRequestCallback(buildFinishedCallback, descriptor, notification,
+ errorMessage));
} else {
// notify callback
if (buildFinishedCallback != null) {
@@ -336,4 +325,38 @@ public String getPayload() {
return line;
}
}
+
+ private static class ImportResponseAsyncRequestCallback extends AsyncRequestCallback {
+ private final BuildFinishedCallback buildFinishedCallback;
+ private final BuildTaskDescriptor descriptor;
+ private final Notification notification;
+ private final String errorMessage;
+
+ public ImportResponseAsyncRequestCallback(BuildFinishedCallback buildFinishedCallback, BuildTaskDescriptor descriptor,
+ Notification notification,
+ String errorMessage) {
+ this.buildFinishedCallback = buildFinishedCallback;
+ this.descriptor = descriptor;
+ this.notification = notification;
+ this.errorMessage = errorMessage;
+ }
+
+ @Override
+ protected void onSuccess(ImportResponse projectDescriptor) {
+ // notify callback
+ if (buildFinishedCallback != null) {
+ buildFinishedCallback.onFinished(descriptor.getStatus());
+ }
+ }
+
+ @Override
+ protected void onFailure(Throwable throwable) {
+ notification.setMessage(errorMessage + ":" + throwable.getMessage());
+ notification.setStatus(FINISHED);
+ notification.setType(ERROR);
+ if (buildFinishedCallback != null) {
+ buildFinishedCallback.onFinished(descriptor.getStatus());
+ }
+ }
+ }
}
diff --git a/plugin-bower/che-plugin-bower-ext-client/src/main/java/org/eclipse/che/plugin/bower/client/menu/BowerInstallAction.java b/plugin-bower/che-plugin-bower-ext-client/src/main/java/org/eclipse/che/plugin/bower/client/menu/BowerInstallAction.java
index 0e6e9fc84..d8ffd4955 100644
--- a/plugin-bower/che-plugin-bower-ext-client/src/main/java/org/eclipse/che/plugin/bower/client/menu/BowerInstallAction.java
+++ b/plugin-bower/che-plugin-bower-ext-client/src/main/java/org/eclipse/che/plugin/bower/client/menu/BowerInstallAction.java
@@ -11,7 +11,6 @@
package org.eclipse.che.plugin.bower.client.menu;
import com.google.inject.Inject;
-import com.google.web.bindery.event.shared.EventBus;
import org.eclipse.che.api.analytics.client.logger.AnalyticsEventLogger;
import org.eclipse.che.api.builder.BuildStatus;
@@ -19,7 +18,7 @@
import org.eclipse.che.ide.api.action.ActionEvent;
import org.eclipse.che.ide.api.app.AppContext;
import org.eclipse.che.ide.dto.DtoFactory;
-import org.eclipse.che.ide.part.explorer.project.NewProjectExplorerPresenter;
+import org.eclipse.che.ide.part.explorer.project.ProjectExplorerPresenter;
import org.eclipse.che.plugin.bower.client.BowerResources;
import org.eclipse.che.plugin.bower.client.builder.BuildFinishedCallback;
import org.eclipse.che.plugin.bower.client.builder.BuilderAgent;
@@ -37,8 +36,7 @@ public class BowerInstallAction extends CustomAction implements BuildFinishedCal
private BuilderAgent builderAgent;
- private EventBus eventBus;
- private final NewProjectExplorerPresenter projectExplorer;
+ private final ProjectExplorerPresenter projectExplorer;
private boolean buildInProgress;
@@ -50,17 +48,15 @@ public BowerInstallAction(LocalizationConstant localizationConstant,
DtoFactory dtoFactory,
BuilderAgent builderAgent,
AppContext appContext,
- EventBus eventBus,
BowerResources bowerResources,
AnalyticsEventLogger analyticsEventLogger,
- NewProjectExplorerPresenter projectExplorer) {
+ ProjectExplorerPresenter projectExplorer) {
super(appContext, localizationConstant.bowerInstallText(), localizationConstant.bowerInstallDescription(),
bowerResources.buildIcon());
this.dtoFactory = dtoFactory;
this.builderAgent = builderAgent;
this.appContext = appContext;
this.analyticsEventLogger = analyticsEventLogger;
- this.eventBus = eventBus;
this.projectExplorer = projectExplorer;
}
@@ -84,7 +80,7 @@ public void installDependencies() {
public void onFinished(BuildStatus buildStatus) {
// and refresh the tree if success
if (buildStatus == BuildStatus.SUCCESSFUL) {
- projectExplorer.synchronizeTree();
+ projectExplorer.reloadChildren();
}
buildInProgress = false;
appContext.getCurrentProject().setIsRunningEnabled(true);
diff --git a/plugin-bower/pom.xml b/plugin-bower/pom.xml
index 4110dd19c..f280c1562 100644
--- a/plugin-bower/pom.xml
+++ b/plugin-bower/pom.xml
@@ -16,7 +16,7 @@
che-plugin-parent
org.eclipse.che.plugin
- 3.12.2-SNAPSHOT
+ 3.14.2-SNAPSHOT
../pom.xml
che-plugin-bower-parent
@@ -27,27 +27,7 @@
che-plugin-bower-ext-client
+ true
2014
-
-
-
-
- org.codehaus.mojo
- findbugs-maven-plugin
-
-
-
- check
-
-
-
-
- Max
- Low
- true
-
-
-
-
diff --git a/plugin-builder/che-plugin-builder-ext-builder/pom.xml b/plugin-builder/che-plugin-builder-ext-builder/pom.xml
index 95d2671ac..0cf9abb7f 100644
--- a/plugin-builder/che-plugin-builder-ext-builder/pom.xml
+++ b/plugin-builder/che-plugin-builder-ext-builder/pom.xml
@@ -1,7 +1,7 @@
@@ -55,13 +70,29 @@
org.eclipse.che.core
che-core-ide-jseditor
- ${che.core.version}
+
+
+ org.eclipse.che.core
+ che-core-ide-ui
+
+
+ org.vectomatic
+ lib-gwt-svg
com.google.gwt.inject
gin
- ${com.google.gwt.gin.version}
provided
+
+
+ guice
+ com.google.inject
+
+
+ guice-assistedinject
+ com.google.inject.extensions
+
+
diff --git a/plugin-codemirror/che-plugin-codemirror-editorwidget/src/main/java/org/eclipse/che/ide/editor/codemirror/client/CodeMirrorEditorWidget.java b/plugin-codemirror/che-plugin-codemirror-editorwidget/src/main/java/org/eclipse/che/ide/editor/codemirror/client/CodeMirrorEditorWidget.java
index 203260c28..f694e8321 100644
--- a/plugin-codemirror/che-plugin-codemirror-editorwidget/src/main/java/org/eclipse/che/ide/editor/codemirror/client/CodeMirrorEditorWidget.java
+++ b/plugin-codemirror/che-plugin-codemirror-editorwidget/src/main/java/org/eclipse/che/ide/editor/codemirror/client/CodeMirrorEditorWidget.java
@@ -242,7 +242,8 @@ public CodeMirrorEditorWidget(
@Assisted final List editorModes,
final RequireJsLoader requirejs,
final MinimapFactory minimapFactory,
- final BasePathConstant basePathConstant) {
+ final BasePathConstant basePathConstant,
+ @Assisted final WidgetInitializedCallback widgetInitializedCallback) {
initWidget(UIBINDER.createAndBindUi(this));
this.keymapPrefReader = keymapPrefReader;
@@ -315,6 +316,7 @@ public void execCommand(
buildKeybindingInfo();
this.undoRedo = new CodeMirrorUndoRedo(
this.editorOverlay.getDoc());
+ widgetInitializedCallback.initialized(this);
}
private void initKeyBindings() {
diff --git a/plugin-codemirror/che-plugin-codemirror-highlighter/pom.xml b/plugin-codemirror/che-plugin-codemirror-highlighter/pom.xml
index 6ba66aa73..7f2a205c2 100644
--- a/plugin-codemirror/che-plugin-codemirror-highlighter/pom.xml
+++ b/plugin-codemirror/che-plugin-codemirror-highlighter/pom.xml
@@ -16,7 +16,7 @@
che-plugin-codemirror-parent
org.eclipse.che.plugin
- 3.12.2-SNAPSHOT
+ 3.14.2-SNAPSHOT
che-plugin-codemirror-highlighter
Che Plugin :: CodeMirror :: Highlighter
@@ -24,22 +24,42 @@
che.codemirror.resources
che-codemirror-resources
- ${che.codemirror.resources.version}
+
+
+ com.google.gwt
+ gwt-elemental
+
+
+ com.google.gwt
+ gwt-user
+
+
+ com.google.gwt.inject
+ gin
+
+
+ com.google.inject
+ guice
+
+
+ javax.inject
+ javax.inject
+
+
+ org.eclipse.che.core
+ che-core-commons-gwt
org.eclipse.che.core
che-core-ide-api
- ${che.core.version}
- org.eclipse.che.plugin
- che-plugin-codemirror-base-init
- ${project.version}
+ org.eclipse.che.core
+ che-core-ide-jseditor
org.eclipse.che.plugin
che-plugin-codemirror-jso
- ${project.version}
diff --git a/plugin-codemirror/che-plugin-codemirror-ide-style/pom.xml b/plugin-codemirror/che-plugin-codemirror-ide-style/pom.xml
index 201aff1a2..9d3a77326 100644
--- a/plugin-codemirror/che-plugin-codemirror-ide-style/pom.xml
+++ b/plugin-codemirror/che-plugin-codemirror-ide-style/pom.xml
@@ -16,7 +16,7 @@
che-plugin-codemirror-parent
org.eclipse.che.plugin
- 3.12.2-SNAPSHOT
+ 3.14.2-SNAPSHOT
che-plugin-codemirror-ide-style
jar
@@ -25,12 +25,26 @@
che.codemirror.resources
che-codemirror-resources
- ${che.codemirror.resources.version}
+
+
+ com.google.gwt
+ gwt-elemental
+
+
+ com.google.gwt
+ gwt-user
+
+
+ com.google.inject
+ guice
+
+
+ org.eclipse.che.core
+ che-core-commons-gwt
org.eclipse.che.core
che-core-ide-api
- ${che.core.version}
diff --git a/plugin-codemirror/che-plugin-codemirror-jso/pom.xml b/plugin-codemirror/che-plugin-codemirror-jso/pom.xml
index 4b50bccd4..e8f67f73f 100644
--- a/plugin-codemirror/che-plugin-codemirror-jso/pom.xml
+++ b/plugin-codemirror/che-plugin-codemirror-jso/pom.xml
@@ -16,26 +16,23 @@
che-plugin-codemirror-parent
org.eclipse.che.plugin
- 3.12.2-SNAPSHOT
+ 3.14.2-SNAPSHOT
che-plugin-codemirror-jso
jar
Che Plugin :: CodeMirror :: JSO
-
- com.google.code.findbugs
- annotations
- 2.0.1
-
com.google.gwt
gwt-elemental
- ${com.google.gwt.version}
com.google.gwt
gwt-user
- ${com.google.gwt.version}
+
+
+ org.eclipse.che.core
+ che-core-commons-annotations
diff --git a/plugin-codemirror/che-plugin-codemirror-jso/src/main/java/org/eclipse/che/ide/editor/codemirrorjso/client/CMEditorOverlay.java b/plugin-codemirror/che-plugin-codemirror-jso/src/main/java/org/eclipse/che/ide/editor/codemirrorjso/client/CMEditorOverlay.java
index 9e4edafb2..7d994deef 100644
--- a/plugin-codemirror/che-plugin-codemirror-jso/src/main/java/org/eclipse/che/ide/editor/codemirrorjso/client/CMEditorOverlay.java
+++ b/plugin-codemirror/che-plugin-codemirror-jso/src/main/java/org/eclipse/che/ide/editor/codemirrorjso/client/CMEditorOverlay.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.che.ide.editor.codemirrorjso.client;
-import javax.annotation.Nullable;
+import org.eclipse.che.commons.annotation.Nullable;
import org.eclipse.che.ide.editor.codemirrorjso.client.EventHandlers.EventHandlerMixedParameters;
import org.eclipse.che.ide.editor.codemirrorjso.client.EventHandlers.EventHandlerNoParameters;
diff --git a/plugin-codemirror/che-plugin-codemirror-jso/src/main/java/org/eclipse/che/ide/editor/codemirrorjso/client/CMModeInfoOverlay.java b/plugin-codemirror/che-plugin-codemirror-jso/src/main/java/org/eclipse/che/ide/editor/codemirrorjso/client/CMModeInfoOverlay.java
index 83491716d..b7eaa0c0c 100644
--- a/plugin-codemirror/che-plugin-codemirror-jso/src/main/java/org/eclipse/che/ide/editor/codemirrorjso/client/CMModeInfoOverlay.java
+++ b/plugin-codemirror/che-plugin-codemirror-jso/src/main/java/org/eclipse/che/ide/editor/codemirrorjso/client/CMModeInfoOverlay.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.che.ide.editor.codemirrorjso.client;
-import javax.annotation.Nullable;
+import org.eclipse.che.commons.annotation.Nullable;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArrayString;
diff --git a/plugin-codemirror/che-plugin-codemirror-jso/src/main/java/org/eclipse/che/ide/editor/codemirrorjso/client/CodeMirrorOverlay.java b/plugin-codemirror/che-plugin-codemirror-jso/src/main/java/org/eclipse/che/ide/editor/codemirrorjso/client/CodeMirrorOverlay.java
index d92cf1c15..30fc7b922 100644
--- a/plugin-codemirror/che-plugin-codemirror-jso/src/main/java/org/eclipse/che/ide/editor/codemirrorjso/client/CodeMirrorOverlay.java
+++ b/plugin-codemirror/che-plugin-codemirror-jso/src/main/java/org/eclipse/che/ide/editor/codemirrorjso/client/CodeMirrorOverlay.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.che.ide.editor.codemirrorjso.client;
-import javax.annotation.Nullable;
+import org.eclipse.che.commons.annotation.Nullable;
import org.eclipse.che.ide.editor.codemirrorjso.client.hints.CMHintFunctionOverlay;
import org.eclipse.che.ide.editor.codemirrorjso.client.options.CMEditorOptionsOverlay;
diff --git a/plugin-codemirror/pom.xml b/plugin-codemirror/pom.xml
index 3c9a73683..06fefa3f7 100644
--- a/plugin-codemirror/pom.xml
+++ b/plugin-codemirror/pom.xml
@@ -16,7 +16,7 @@
che-plugin-parent
org.eclipse.che.plugin
- 3.12.2-SNAPSHOT
+ 3.14.2-SNAPSHOT
../pom.xml
che-plugin-codemirror-parent
@@ -35,15 +35,4 @@
2014-2015
UTF-8
-
-
-
-
- org.eclipse.che.core
- che-core-ide-app
- ${che.core.version}
- compile
-
-
-
diff --git a/plugin-cpp/README.md b/plugin-cpp/README.md
new file mode 100644
index 000000000..fe2ad2cab
--- /dev/null
+++ b/plugin-cpp/README.md
@@ -0,0 +1,7 @@
+# Plugin C++
+============
+
+
+Drag & drop following button to http://my.che.url/dashboard/#/admin/plugins to install this plug-in:
+
+[](http://eclipse.org/che/?install&uri=mvn:org.eclipse.che.plugin:che-plugin-cpp-ext-cpp:CURRENT)
diff --git a/plugin-cpp/che-plugin-cpp-ext-cpp/pom.xml b/plugin-cpp/che-plugin-cpp-ext-cpp/pom.xml
index fee9ccdce..d63710048 100644
--- a/plugin-cpp/che-plugin-cpp-ext-cpp/pom.xml
+++ b/plugin-cpp/che-plugin-cpp-ext-cpp/pom.xml
@@ -1,7 +1,7 @@
+
+
+
+
+ %-41(%date[%.15thread]) %-45([%-5level] [%.30logger{30} %L]) - %msg%n
+
+
+
+
+ target/log/log.log
+
+ %-41(%date[%.15thread]) %-45([%-5level] [%.30logger{30} %L]) - %msg%n
+
+
+
+
+
+
+
+
+
+
diff --git a/plugin-docker/che-plugin-docker-recipes/pom.xml b/plugin-docker/che-plugin-docker-recipes/pom.xml
new file mode 100644
index 000000000..df3a3ec81
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/pom.xml
@@ -0,0 +1,24 @@
+
+
+
+ 4.0.0
+
+ che-plugin-docker-parent
+ org.eclipse.che.plugin
+ 3.14.2-SNAPSHOT
+
+ che-plugin-docker-recipes
+ jar
+ Che Plugin :: Docker :: Recipes
+
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/cpp/qt4/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/cpp/qt4/Dockerfile
new file mode 100644
index 000000000..078857d92
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/cpp/qt4/Dockerfile
@@ -0,0 +1,14 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/cpp_qt4
+ADD $app$ /home/user/
+RUN qmake -project && qmake && make
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/cpp/qt4/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/cpp/qt4/Misc.json
new file mode 100644
index 000000000..530b3d4d8
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/cpp/qt4/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"C/C++ with Qt4, Debian Jessie",
+ "displayName":"Qt4 + C++"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/cpp/simple/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/cpp/simple/Dockerfile
new file mode 100644
index 000000000..9ca376c79
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/cpp/simple/Dockerfile
@@ -0,0 +1,17 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/cpp
+ENV CODENVY_APP_BIND_DIR /home/user/app
+VOLUME ["/home/user/app"]
+CMD cd /home/user/app && \
+ make && \
+ ./a.out
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/cpp/simple/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/cpp/simple/Misc.json
new file mode 100644
index 000000000..571588399
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/cpp/simple/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"C/C++, Debian Jessie",
+ "displayName":"C++"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/go/standalone/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/go/standalone/Dockerfile
new file mode 100644
index 000000000..3c34dbd6b
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/go/standalone/Dockerfile
@@ -0,0 +1,26 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/go
+
+ENV GOPATH /home/user/application
+
+RUN mkdir -p /home/user/application/src
+
+ENV CODENVY_APP_BIND_DIR /home/user/application/src
+
+VOLUME ["/home/user/application/src"]
+
+WORKDIR /home/user/application/src
+
+# 1. Get dependencies from source code of application
+# 2. Start application
+CMD go get -d && go run $executable:-main.go$
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/go/standalone/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/go/standalone/Misc.json
new file mode 100644
index 000000000..ea3ab2b94
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/go/standalone/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"Go 1.3.1, Debian Jessie",
+ "displayName":"Go Console 1.3"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/go/web/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/go/web/Dockerfile
new file mode 100644
index 000000000..f004b72e6
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/go/web/Dockerfile
@@ -0,0 +1,29 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/go
+
+EXPOSE 8080
+ENV CODENVY_APP_PORT_8080_HTTP 8080
+
+ENV GOPATH /home/user/application
+
+RUN mkdir -p /home/user/application/src
+
+ENV CODENVY_APP_BIND_DIR /home/user/application/src
+
+VOLUME ["/home/user/application/src"]
+
+WORKDIR /home/user/application/src
+
+# 1. Get dependencies from source code of application
+# 2. Start application
+CMD go get -d && go run $executable:-main.go$
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/go/web/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/go/web/Misc.json
new file mode 100644
index 000000000..e1113d42b
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/go/web/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"Go 1.3.1, Debian Jessie",
+ "displayName":"Go Web 1.3"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/codenvy-cli/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/codenvy-cli/Dockerfile
new file mode 100644
index 000000000..da9aa5f3d
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/codenvy-cli/Dockerfile
@@ -0,0 +1,29 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/jdk7
+
+RUN mkdir /home/user/application
+
+ENV CODENVY_APP_BIND_DIR /home/user/application
+
+VOLUME ["/home/user/application"]
+
+# 1. Build application is unpacked zip archive, so move zip content into application dir
+# 2. Remove unnecessary empty unzipped folder
+# 3. Make main CLI scripts executable
+# 4. Allow CLI starts automatically when shell opens
+# 5. Disallow image stop automatically
+CMD mv /home/user/application/codenvy-cli-*/* /home/user/application && \
+ rm -R /home/user/application/codenvy-cli-* && \
+ sudo chmod +x /home/user/application/bin/* && \
+ echo "/home/user/application/bin/codenvy-cli" >> /home/user/.bashrc && \
+ while true;do true; done
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/codenvy-cli/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/codenvy-cli/Misc.json
new file mode 100644
index 000000000..983e5e96c
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/codenvy-cli/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"Codenvy CLI, JDK 1.7.0_55, Debian Jessie",
+ "displayName":"Codenvy CLI 2.x + Java 7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/mobile/android422/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/mobile/android422/Dockerfile
new file mode 100644
index 000000000..b40caf679
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/mobile/android422/Dockerfile
@@ -0,0 +1,13 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/android422
+ADD $app$ /home/user/application.apk
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/mobile/android422/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/mobile/android422/Misc.json
new file mode 100644
index 000000000..67a31b0ee
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/mobile/android422/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"Android 4.2.2 SDK 23.0.2 API 17, x11vnc 0.9.13, JDK 1.7.0_55, Debian Jessie",
+ "displayName":"Android 4.2.2 API 17 + VNC + Java 7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/mobile/android431/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/mobile/android431/Dockerfile
new file mode 100644
index 000000000..8afc4e2e2
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/mobile/android431/Dockerfile
@@ -0,0 +1,13 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/android431
+ADD $app$ /home/user/application.apk
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/mobile/android431/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/mobile/android431/Misc.json
new file mode 100644
index 000000000..63c5e9d3c
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/mobile/android431/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"Android 4.3.1 SDK 23.0.2 API 18, x11vnc 0.9.13, JDK 1.7.0_55, Debian Jessie",
+ "displayName":"Android 4.3.1 API 18 + VNC + Java 7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/mobile/android442/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/mobile/android442/Dockerfile
new file mode 100644
index 000000000..692132e93
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/mobile/android442/Dockerfile
@@ -0,0 +1,13 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/android442
+ADD $app$ /home/user/application.apk
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/mobile/android442/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/mobile/android442/Misc.json
new file mode 100644
index 000000000..fd3a2008e
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/mobile/android442/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"Android 4.4.2 SDK 23.0.2 API 19, x11vnc 0.9.13, JDK 1.7.0_55, Debian Jessie",
+ "displayName":"Android 4.4.2 API 19 + VNC + Java 7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/cassandra/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/cassandra/Dockerfile
new file mode 100644
index 000000000..132196c7b
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/cassandra/Dockerfile
@@ -0,0 +1,15 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/jdk7_cassandra
+ADD $app$ /home/user/$app$
+RUN unzip -q /home/user/$app$ -d /home/user
+ENV ARGUMENTS $args$
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/cassandra/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/cassandra/Misc.json
new file mode 100644
index 000000000..1e2cbd30d
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/cassandra/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"Cassandra 2.0.9, JDK 1.7.0_55, Debian Jessie",
+ "displayName":"Cassandra DB 2.0 + Java 7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/couchbase/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/couchbase/Dockerfile
new file mode 100644
index 000000000..d616796ef
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/couchbase/Dockerfile
@@ -0,0 +1,15 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/jdk7_couchbase
+ADD $app$ /home/user/$app$
+RUN unzip -q /home/user/$app$ -d /home/user
+ENV ARGUMENTS $args$
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/couchbase/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/couchbase/Misc.json
new file mode 100644
index 000000000..e879013af
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/couchbase/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"Couchbase 3.0.1, JDK 1.7.0_55, Debian Jessie",
+ "displayName":"Couchbase 3.0.1 + Java 7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/mongodb/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/mongodb/Dockerfile
new file mode 100644
index 000000000..ca9f32082
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/mongodb/Dockerfile
@@ -0,0 +1,15 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/jdk7_mongodb
+ADD $app$ /home/user/$app$
+RUN unzip -q /home/user/$app$ -d /home/user
+ENV ARGUMENTS $args$
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/mongodb/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/mongodb/Misc.json
new file mode 100644
index 000000000..1f233bbc2
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/mongodb/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"MongoDB 2.6.4, JDK 1.7.0_55, Debian Jessie",
+ "displayName":"MongoDB 2.6 + Java 7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/mysql/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/mysql/Dockerfile
new file mode 100644
index 000000000..85ccbc110
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/mysql/Dockerfile
@@ -0,0 +1,15 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/jdk7_mysql
+ADD $app$ /home/user/$app$
+RUN unzip -q /home/user/$app$ -d /home/user
+ENV ARGUMENTS $args$
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/mysql/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/mysql/Misc.json
new file mode 100644
index 000000000..16c267c7e
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/mysql/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"MySQL 5.5.37, JDK 1.7.0_55, Debian Jessie",
+ "displayName":"MySQL 5.5 + Java 7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/neo4j/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/neo4j/Dockerfile
new file mode 100644
index 000000000..093995914
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/neo4j/Dockerfile
@@ -0,0 +1,15 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/jdk7_neo4j
+ADD $app$ /home/user/$app$
+RUN unzip -q /home/user/$app$ -d /home/user
+ENV ARGUMENTS $args$
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/neo4j/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/neo4j/Misc.json
new file mode 100644
index 000000000..5e57d5b9b
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/neo4j/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"Neo4j 2.1.3, JDK 1.7.0_55, Debian Jessie",
+ "displayName":"Neo4j 2.1 + Java 7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/nuodb/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/nuodb/Dockerfile
new file mode 100644
index 000000000..a6ebea935
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/nuodb/Dockerfile
@@ -0,0 +1,15 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/jdk7_nuodb
+ADD $app$ /home/user/$app$
+RUN unzip -q /home/user/$app$ -d /home/user
+ENV ARGUMENTS $args$
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/nuodb/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/nuodb/Misc.json
new file mode 100644
index 000000000..627cdc762
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/nuodb/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"NuoDB 2.0.4, JDK 1.7.0_55, Debian Jessie",
+ "displayName":"NuoDB 2.0 + Java 7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/postgresql/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/postgresql/Dockerfile
new file mode 100644
index 000000000..3533b2513
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/postgresql/Dockerfile
@@ -0,0 +1,15 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/jdk7_postgresql
+ADD $app$ /home/user/$app$
+RUN unzip -q /home/user/$app$ -d /home/user
+ENV ARGUMENTS $args$
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/postgresql/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/postgresql/Misc.json
new file mode 100644
index 000000000..dd1ca0289
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/postgresql/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"PostgreSQL 9.3, JDK 1.7.0_55, Debian Jessie",
+ "displayName":"PostgreSQL 9.3 + Java 7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/riak/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/riak/Dockerfile
new file mode 100644
index 000000000..725d443a5
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/riak/Dockerfile
@@ -0,0 +1,15 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/jdk7_riak
+ADD $app$ /home/user/$app$
+RUN unzip -q /home/user/$app$ -d /home/user
+ENV ARGUMENTS $args$
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/riak/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/riak/Misc.json
new file mode 100644
index 000000000..fe2594e1a
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/db/riak/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"RiakDB 1.4.10, JDK 1.7.0_55, Debian Jessie",
+ "displayName":"RiakDB 1.4 + Java 7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/simple/cli/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/simple/cli/Dockerfile
new file mode 100644
index 000000000..133997616
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/simple/cli/Dockerfile
@@ -0,0 +1,19 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/jdk7
+RUN mkdir /home/user/app
+WORKDIR /home/user/app
+ADD $app$ /home/user/$app$
+RUN unzip -q /home/user/$app$ -d /home/user/app && \
+ rm /home/user/$app$
+# expected to have all dependencies in lib directory and one single jar file application.jar in 'root' directory of archive.
+CMD java -jar application.jar $args$
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/simple/cli/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/simple/cli/Misc.json
new file mode 100644
index 000000000..c7b2f0b9b
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/simple/cli/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"JDK 1.7.0_55, Debian Jessie",
+ "displayName":"Java 7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/simple/gui/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/simple/gui/Dockerfile
new file mode 100644
index 000000000..7feee1fc2
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/simple/gui/Dockerfile
@@ -0,0 +1,16 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/jdk7_vnc
+RUN mkdir /home/user/app
+WORKDIR /home/user/app
+ADD $app$ /home/user/$app$
+RUN unzip -q /home/user/$app$ -d /home/user/app
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/simple/gui/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/simple/gui/Misc.json
new file mode 100644
index 000000000..74de08a0d
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/standalone/simple/gui/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"x11vnc 0.9.13, JDK 1.7.0_55, Debian Jessie",
+ "displayName":"VNC + Java 7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/gae/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/gae/Dockerfile
new file mode 100644
index 000000000..52d8f18f9
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/gae/Dockerfile
@@ -0,0 +1,17 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/jdk7_gae
+ENV CODENVY_APP_BIND_DIR /home/user/app
+VOLUME ["/home/user/app/"]
+$debug?EXPOSE 8000:$
+$debug?ENV CODENVY_APP_PORT_8000_DEBUG 8000:$
+$debug?CMD ./dev_appserver.sh 2>&1 --disable_update_check --jvm_flag=-Xdebug --jvm_flag=-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -a 0.0.0.0 /home/user/app:$
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/gae/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/gae/Misc.json
new file mode 100644
index 000000000..275db1204
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/gae/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"JAVA GAE SDK 1.9.19. Application is launched with ./dev_appserver.sh command, JDK 1.7.0_55, Debian Jessie",
+ "displayName":"Google App Engine SDK 1.9.19 + Java 7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/gae1914/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/gae1914/Dockerfile
new file mode 100644
index 000000000..52d8f18f9
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/gae1914/Dockerfile
@@ -0,0 +1,17 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/jdk7_gae
+ENV CODENVY_APP_BIND_DIR /home/user/app
+VOLUME ["/home/user/app/"]
+$debug?EXPOSE 8000:$
+$debug?ENV CODENVY_APP_PORT_8000_DEBUG 8000:$
+$debug?CMD ./dev_appserver.sh 2>&1 --disable_update_check --jvm_flag=-Xdebug --jvm_flag=-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -a 0.0.0.0 /home/user/app:$
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/gae1914/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/gae1914/Misc.json
new file mode 100644
index 000000000..be6980ed0
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/gae1914/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"JAVA GAE SDK 1.9.14. Application is launched with ./dev_appserver.sh command, JDK 1.7.0_55, Debian Jessie",
+ "displayName":"Google App Engine SDK 1.9.14 + Java 7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/glassfish4/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/glassfish4/Dockerfile
new file mode 100644
index 000000000..2ffc47e9c
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/glassfish4/Dockerfile
@@ -0,0 +1,25 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/jdk7_glassfish4
+
+$debug?EXPOSE 9009:$
+$debug?ENV CODENVY_APP_PORT_9009_DEBUG 9009:$
+
+CMD ./asadmin start-domain $debug?--debug:$ && \
+ ./asadmin deploydir --contextroot "/" /home/user/application && \
+ tail -f /home/user/glassfish4/glassfish/domains/domain1/logs/server.log
+
+ENV CODENVY_APP_BIND_DIR /home/user/application
+
+VOLUME ["/home/user/application"]
+
+
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/glassfish4/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/glassfish4/Misc.json
new file mode 100644
index 000000000..58a191caf
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/glassfish4/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"GlassFish 4.0, JDK 1.7.0_55, Debian Jessie",
+ "displayName":"GlassFish 4.0 + Java 7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/jboss7/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/jboss7/Dockerfile
new file mode 100644
index 000000000..2067e9deb
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/jboss7/Dockerfile
@@ -0,0 +1,20 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/jdk7_jboss7
+
+$debug?EXPOSE 8000:$
+$debug?ENV CODENVY_APP_PORT_8000_DEBUG 8000:$
+$debug?ENV JAVA_OPTS "-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n":$
+
+ENV CODENVY_APP_BIND_DIR /home/user/jboss7/standalone/deployments/ROOT.war
+
+VOLUME ["/home/user/jboss7/standalone/deployments/ROOT.war"]
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/jboss7/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/jboss7/Misc.json
new file mode 100644
index 000000000..63569ad72
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/jboss7/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"JBoss 7.1.1, JDK 1.7.0_55, Debian Jessie",
+ "displayName":"JBoss 7.1 + Java 7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/jetty9/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/jetty9/Dockerfile
new file mode 100644
index 000000000..55f11993a
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/jetty9/Dockerfile
@@ -0,0 +1,20 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/jdk7_jetty9
+
+$debug?EXPOSE 8000:$
+$debug?ENV CODENVY_APP_PORT_8000_DEBUG 8000:$
+$debug?CMD java -Xdebug -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n -jar start.jar 2>&1:$
+
+ENV CODENVY_APP_BIND_DIR /home/user/jetty9/webapps/ROOT
+
+VOLUME ["/home/user/jetty9/webapps/ROOT"]
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/jetty9/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/jetty9/Misc.json
new file mode 100644
index 000000000..353806bd3
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/jetty9/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"Jetty 9.2.0, JDK 1.7.0_55, Debian Jessie",
+ "displayName":"Jetty 9.2 + Java 7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/play1/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/play1/Dockerfile
new file mode 100644
index 000000000..0763356d8
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/play1/Dockerfile
@@ -0,0 +1,15 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/jdk7_play1
+ADD $app$ /home/user/application.zip
+RUN cd /home/user/ && unzip application.zip -d application && \
+ rm -rf application.zip
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/play1/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/play1/Misc.json
new file mode 100644
index 000000000..37d194480
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/play1/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"Play 1.2.7, JDK 1.7.0_55, Debian Jessie",
+ "displayName":"Play 1.2 + Java 7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/resin/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/resin/Dockerfile
new file mode 100644
index 000000000..e5a2694f6
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/resin/Dockerfile
@@ -0,0 +1,20 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/jdk7_resin
+
+$debug?EXPOSE 8000:$
+$debug?ENV CODENVY_APP_PORT_8000_DEBUG 8000:$
+$debug?CMD ./resin.sh console --debug-port 8000:$
+
+ENV CODENVY_APP_BIND_DIR /home/user/resin/webapps/ROOT
+
+VOLUME ["/home/user/resin/webapps/ROOT"]
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/resin/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/resin/Misc.json
new file mode 100644
index 000000000..1b3bfd127
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/resin/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"Resin 4.0.41, JDK 1.7.0_55, Debian Jessie",
+ "displayName":"Resin 4.0 + Java 7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/tomcat7/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/tomcat7/Dockerfile
new file mode 100644
index 000000000..ae9e80507
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/tomcat7/Dockerfile
@@ -0,0 +1,19 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/jdk7_tomcat7
+
+$debug?EXPOSE 8000:$
+$debug?ENV CODENVY_APP_PORT_8000_DEBUG 8000:$
+$debug?CMD ./catalina.sh jpda run 2>&1:$
+
+ENV CODENVY_APP_BIND_DIR /home/user/tomcat7/webapps/ROOT
+VOLUME ["/home/user/tomcat7/webapps/ROOT"]
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/tomcat7/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/tomcat7/Misc.json
new file mode 100644
index 000000000..c72ae39bd
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/tomcat7/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"Tomcat 7.0.53, JDK 1.7.0_55, Debian Jessie",
+ "displayName":"Tomcat 7.0 + Java 7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/tomee/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/tomee/Dockerfile
new file mode 100644
index 000000000..138ed4642
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/tomee/Dockerfile
@@ -0,0 +1,19 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/jdk7_tomee
+
+$debug?EXPOSE 8000:$
+$debug?ENV CODENVY_APP_PORT_8000_DEBUG 8000:$
+$debug?CMD ./catalina.sh jpda run 2>&1:$
+
+ENV CODENVY_APP_BIND_DIR /home/user/tomee/webapps/ROOT
+VOLUME ["/home/user/tomee/webapps/ROOT"]
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/tomee/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/tomee/Misc.json
new file mode 100644
index 000000000..5f19975a4
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/tomee/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"TomEE 1.5.1, JDK 1.7.0_55, Debian Jessie",
+ "displayName":"TomEE 1.5 + Java 7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/virgo/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/virgo/Dockerfile
new file mode 100644
index 000000000..b0dd29ced
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/virgo/Dockerfile
@@ -0,0 +1,19 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/jdk7_virgo
+
+$debug?EXPOSE 8000:$
+$debug?ENV CODENVY_APP_PORT_8000_DEBUG 8000:$
+$debug?CMD ./startup.sh -debug:$
+
+ENV CODENVY_APP_BIND_DIR /home/user/virgo/pickup/ROOT.war
+VOLUME ["/home/user/virgo/pickup/ROOT.war"]
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/virgo/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/virgo/Misc.json
new file mode 100644
index 000000000..049e19844
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/java/web/virgo/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"Eclipse Virgo 3.6.3, JDK 1.7.0_55, Debian Jessie",
+ "displayName":"Virgo 3.6 + Java 7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/javascript/web/grunt/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/javascript/web/grunt/Dockerfile
new file mode 100644
index 000000000..1468512e7
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/javascript/web/grunt/Dockerfile
@@ -0,0 +1,32 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/angular-yeoman
+
+ADD $app$/package.json /tmp/application/package.json
+
+RUN cd /tmp/application && npm install
+
+ENV CODENVY_APP_BIND_DIR /home/user/application
+
+VOLUME ["/home/user/application"]
+
+# 1. Update permissions
+# 2. Copy nodejs modules to the application folder
+# 3. Update permissions recursively
+# 4. Makes newly created files accessible for anyone
+# 5. Start application
+CMD sudo chmod a+rw /home/user/application/ && \
+ cp -a /tmp/application/node_modules /home/user/application/ && \
+ sudo chmod a+rw -R /home/user/application/ && \
+ umask 0 && \
+ grunt $taskName:-server$
+
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/javascript/web/grunt/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/javascript/web/grunt/Misc.json
new file mode 100644
index 000000000..b7af1b454
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/javascript/web/grunt/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description": "Grunt 0.4.5, Node.js 0.10.31, AngularJS 1.2.23, Debian Jessie",
+ "displayName": "Grunt 0.4 + Node.js 0.10 + AngularJS 1.2"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/javascript/web/gulp/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/javascript/web/gulp/Dockerfile
new file mode 100644
index 000000000..c17b08ab0
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/javascript/web/gulp/Dockerfile
@@ -0,0 +1,32 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/angular-gulp
+
+ADD $app$/package.json /tmp/application/package.json
+
+RUN cd /tmp/application && npm install
+
+ENV CODENVY_APP_BIND_DIR /home/user/application
+
+VOLUME ["/home/user/application"]
+
+# 1. Update permissions
+# 2. Copy nodejs modules to the application folder
+# 3. Update permissions recursively
+# 4. Makes newly created files accessible for anyone
+# 5. Start application
+CMD sudo chmod a+rw /home/user/application/ && \
+ cp -a /tmp/application/node_modules /home/user/application/ && \
+ sudo chmod a+rw -R /home/user/application/ && \
+ umask 0 && \
+ gulp serve:app
+
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/javascript/web/gulp/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/javascript/web/gulp/Misc.json
new file mode 100644
index 000000000..4441bb7b7
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/javascript/web/gulp/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description": "Gulp 3.8.7, Node.js 0.10.31, AngularJS 1.2.23, Debian Jessie",
+ "displayName": "Gulp 3.8 + Node.js 0.10 + AngularJS 1.2"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/javascript/web/simple/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/javascript/web/simple/Dockerfile
new file mode 100644
index 000000000..77014b07e
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/javascript/web/simple/Dockerfile
@@ -0,0 +1,14 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/javascript_html
+ENV CODENVY_APP_BIND_DIR /var/www/html
+VOLUME ["/var/www/html"]
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/javascript/web/simple/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/javascript/web/simple/Misc.json
new file mode 100644
index 000000000..c9ac03301
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/javascript/web/simple/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description": "Apache 2, Debian Jessie",
+ "displayName": "Apache 2"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/php/web/php56_apache2/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/php/web/php56_apache2/Dockerfile
new file mode 100644
index 000000000..867083a5c
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/php/web/php56_apache2/Dockerfile
@@ -0,0 +1,14 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/php56_apache2
+ENV CODENVY_APP_BIND_DIR /var/www/html
+VOLUME ["/var/www/html"]
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/php/web/php56_apache2/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/php/web/php56_apache2/Misc.json
new file mode 100644
index 000000000..ee4241cea
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/php/web/php56_apache2/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"LAMP stack: Apache2, MYSQL 14.14 Distrib 5.5.40, PHP 5.6, Debian Jessie. DB name: test, username: test, password: test",
+ "displayName":"Apache 2.4 + MYSQL 14.14 + PHP 5.6"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/php/web/php56_gae/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/php/web/php56_gae/Dockerfile
new file mode 100644
index 000000000..b6b7bd855
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/php/web/php56_gae/Dockerfile
@@ -0,0 +1,14 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/php56_gae
+ENV CODENVY_APP_BIND_DIR /home/user/app
+VOLUME ["/home/user/app"]
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/php/web/php56_gae/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/php/web/php56_gae/Misc.json
new file mode 100644
index 000000000..3f4a8451e
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/php/web/php56_gae/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"Google App Engine SDK 1.9.19, PHP 5.6, Debian Jessie",
+ "displayName":"Google App Engine SDK 1.9.19 + PHP 5.6"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/php/web/php56_gae1914/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/php/web/php56_gae1914/Dockerfile
new file mode 100644
index 000000000..b6b7bd855
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/php/web/php56_gae1914/Dockerfile
@@ -0,0 +1,14 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/php56_gae
+ENV CODENVY_APP_BIND_DIR /home/user/app
+VOLUME ["/home/user/app"]
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/php/web/php56_gae1914/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/php/web/php56_gae1914/Misc.json
new file mode 100644
index 000000000..0da443753
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/php/web/php56_gae1914/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"Google App Engine SDK 1.9.14, PHP 5.6, Debian Jessie",
+ "displayName":"Google App Engine SDK 1.9.14 + PHP 5.6"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27/Dockerfile
new file mode 100644
index 000000000..149462999
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27/Dockerfile
@@ -0,0 +1,34 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/python27
+
+EXPOSE 8080
+ENV CODENVY_APP_PORT_8080_HTTP 8080
+
+RUN mkdir /tmp/application /home/user/application
+
+ENV CODENVY_APP_BIND_DIR /home/user/application
+
+VOLUME ["/home/user/application"]
+
+ADD $app$/requirements.txt /tmp/application/requirements.txt
+
+RUN cd /tmp/application && \
+ sudo virtualenv /env && \
+ sudo /env/bin/pip install -r requirements.txt
+
+# 1. Update permissions recursively
+# 2. Make newly created files accessible for anyone
+# 3. Start application
+CMD sudo chmod a+rw -R /home/user/application/ && \
+ umask 0 && \
+ /env/bin/python /home/user/application/$executable:-main.py$
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27/Misc.json
new file mode 100644
index 000000000..f8cdd13a4
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"Python 2.7.8, Debian Jessie",
+ "displayName":"Python 2.7"
+}
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27_django/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27_django/Dockerfile
new file mode 100644
index 000000000..6575d43ad
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27_django/Dockerfile
@@ -0,0 +1,34 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/python27
+
+EXPOSE 8000
+ENV CODENVY_APP_PORT_8000_HTTP 8000
+
+RUN mkdir /tmp/application /home/user/application
+
+ENV CODENVY_APP_BIND_DIR /home/user/application
+
+VOLUME ["/home/user/application"]
+
+ADD $app$/requirements.txt /tmp/application/requirements.txt
+
+RUN cd /tmp/application && \
+ sudo virtualenv /env && \
+ sudo /env/bin/pip install -r requirements.txt
+
+# 1. Update permissions recursively
+# 2. Make newly created files accessible for anyone
+# 3. Start application
+CMD sudo chmod a+rw -R /home/user/application/ && \
+ umask 0 && \
+ /env/bin/python /home/user/application/$executable:-manage.py$ runserver 0.0.0.0:8000 2>&1
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27_django/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27_django/Misc.json
new file mode 100644
index 000000000..f7e4ee637
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27_django/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"Django Framework, Python 2.7, Debian Jessie",
+ "displayName":"Django + Python 2.7"
+}
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27_gae/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27_gae/Dockerfile
new file mode 100644
index 000000000..ceaa6f1b6
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27_gae/Dockerfile
@@ -0,0 +1,16 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/python27_gae
+
+ENV CODENVY_APP_BIND_DIR /home/user/app
+
+VOLUME ["/home/user/app"]
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27_gae/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27_gae/Misc.json
new file mode 100644
index 000000000..eb1e1d8e0
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27_gae/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"Google App Engine SDK 1.9.19, Python 2.7, Debian Jessie",
+ "displayName":"Google App Engine SDK 1.9.19 + Python 2.7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27_gae1914/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27_gae1914/Dockerfile
new file mode 100644
index 000000000..ceaa6f1b6
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27_gae1914/Dockerfile
@@ -0,0 +1,16 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/python27_gae
+
+ENV CODENVY_APP_BIND_DIR /home/user/app
+
+VOLUME ["/home/user/app"]
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27_gae1914/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27_gae1914/Misc.json
new file mode 100644
index 000000000..d1d81173c
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27_gae1914/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"Google App Engine SDK 1.9.14, Python 2.7, Debian Jessie",
+ "displayName":"Google App Engine SDK 1.9.14 + Python 2.7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27_gae_ext_libs/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27_gae_ext_libs/Dockerfile
new file mode 100644
index 000000000..9ead64f0e
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27_gae_ext_libs/Dockerfile
@@ -0,0 +1,29 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/python27_gae
+
+RUN mkdir /tmp/application
+
+ENV CODENVY_APP_BIND_DIR /home/user/application
+
+VOLUME ["/home/user/application"]
+
+ADD $app$/requirements.txt /tmp/application/requirements.txt
+
+RUN cd /tmp/application && \
+ sudo virtualenv /env && \
+ sudo /env/bin/pip install -r requirements.txt -t /tmp/application/lib
+
+CMD sudo cp -a /tmp/application/lib /home/user/application/ && \
+ sudo chmod a+rw -R /home/user/application/ && \
+ umask 0 && \
+ /home/user/google_appengine/dev_appserver.py 2>&1 --host 0.0.0.0 --skip_sdk_update_check true /home/user/application
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27_gae_ext_libs/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27_gae_ext_libs/Misc.json
new file mode 100644
index 000000000..31c006245
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python27_gae_ext_libs/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"Google App Engine SDK 1.9.19, Python 2.7.8, Debian Jessie. This environment supports 3rd party libs, specified in requirements.txt. Docker image will fail if you don't have this file in your project",
+ "displayName":"Google App Engine SDK 1.9.19, Python 2.7"
+}
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python34/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python34/Dockerfile
new file mode 100644
index 000000000..30d0cde26
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python34/Dockerfile
@@ -0,0 +1,34 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/python34
+
+EXPOSE 8080
+ENV CODENVY_APP_PORT_8080_HTTP 8080
+
+RUN mkdir /tmp/application /home/user/application
+
+ENV CODENVY_APP_BIND_DIR /home/user/application
+
+VOLUME ["/home/user/application"]
+
+ADD $app$/requirements.txt /tmp/application/requirements.txt
+
+RUN cd /tmp/application && \
+ sudo virtualenv /env && \
+ sudo /env/bin/pip install -r requirements.txt
+
+# 1. Update permissions recursively
+# 2. Make newly created files accessible for anyone
+# 3. Start application
+CMD sudo chmod a+rw -R /home/user/application/ && \
+ umask 0 && \
+ /env/bin/python /home/user/application/$executable:-main.py$
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python34/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python34/Misc.json
new file mode 100644
index 000000000..6b53e0542
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/python/web/python34/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description": "Python 3.4.1, Debian Jessie",
+ "displayName": "Python 3.4"
+}
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/ruby/standalone/ruby210/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/ruby/standalone/ruby210/Dockerfile
new file mode 100644
index 000000000..a7f5faa11
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/ruby/standalone/ruby210/Dockerfile
@@ -0,0 +1,15 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/ruby210
+RUN echo 'source /etc/profile.d/rvm.sh' >> /home/user/.bashrc
+ADD $app$/ /home/user
+CMD ruby /home/user/main.rb
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/ruby/standalone/ruby210/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/ruby/standalone/ruby210/Misc.json
new file mode 100644
index 000000000..9210c5717
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/ruby/standalone/ruby210/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description": "Ruby 2.1.0, Debian Jessie",
+ "displayName": "Ruby 2.1"
+}
\ No newline at end of file
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/ruby/web/ruby210_rails403/Dockerfile b/plugin-docker/che-plugin-docker-recipes/src/main/resources/ruby/web/ruby210_rails403/Dockerfile
new file mode 100644
index 000000000..17687e0e0
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/ruby/web/ruby210_rails403/Dockerfile
@@ -0,0 +1,34 @@
+#
+# Copyright (c) 2012-2016 Codenvy, S.A.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Codenvy, S.A. - initial API and implementation
+#
+
+FROM codenvy/ruby210_rails403
+
+RUN mkdir /tmp/application /home/user/application
+
+ENV CODENVY_APP_BIND_DIR /home/user/application
+
+VOLUME ["/home/user/application"]
+
+ADD $app$/Gemfile /tmp/application/Gemfile
+
+RUN cd /tmp/application && /bin/bash -l -c "bundle install" && \
+ echo 'source /etc/profile.d/rvm.sh' >> /home/user/.bashrc
+
+# 1. Update permissions recursively
+# 2. Make newly created files accessible for anyone
+# 3. Copy Gemfile.lock to the application folder
+# 4. Make file in bin directory executable
+# 5. Start application
+CMD sudo chmod a+rw -R /home/user/application/ && \
+ umask 0 && \
+ cp /tmp/application/Gemfile.lock /home/user/application/ && \
+ sudo chmod +x /home/user/application/bin/* && \
+ /home/user/application/bin/rails server
diff --git a/plugin-docker/che-plugin-docker-recipes/src/main/resources/ruby/web/ruby210_rails403/Misc.json b/plugin-docker/che-plugin-docker-recipes/src/main/resources/ruby/web/ruby210_rails403/Misc.json
new file mode 100644
index 000000000..1f44a6631
--- /dev/null
+++ b/plugin-docker/che-plugin-docker-recipes/src/main/resources/ruby/web/ruby210_rails403/Misc.json
@@ -0,0 +1,4 @@
+{
+ "description":"Rails 4.0.3, Ruby 2.1.0, Debian Jessie",
+ "displayName":"Rails 4.0 + Ruby 2.1"
+}
diff --git a/plugin-docker/che-plugin-docker-runner/pom.xml b/plugin-docker/che-plugin-docker-runner/pom.xml
index bd1bb0ca4..cfbccca8b 100644
--- a/plugin-docker/che-plugin-docker-runner/pom.xml
+++ b/plugin-docker/che-plugin-docker-runner/pom.xml
@@ -1,7 +1,7 @@
+
+
+
+ .main {
+ margin: 5px;
+ }
+
+ .inherit {
+ margin-top: 5px;
+ }
+
+
+
+
+
+ Name:
+
+
+
+
+ Email:
+
+
+
+
+
+
\ No newline at end of file
diff --git a/plugin-git/che-plugin-git-ext-git/src/main/java/org/eclipse/che/ide/ext/git/client/pull/PullPresenter.java b/plugin-git/che-plugin-git-ext-git/src/main/java/org/eclipse/che/ide/ext/git/client/pull/PullPresenter.java
index b73faabc5..4454f52ec 100644
--- a/plugin-git/che-plugin-git-ext-git/src/main/java/org/eclipse/che/ide/ext/git/client/pull/PullPresenter.java
+++ b/plugin-git/che-plugin-git-ext-git/src/main/java/org/eclipse/che/ide/ext/git/client/pull/PullPresenter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012-2015 Codenvy, S.A.
+ * Copyright (c) 2012-2016 Codenvy, S.A.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,8 +10,11 @@
*******************************************************************************/
package org.eclipse.che.ide.ext.git.client.pull;
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+import com.google.web.bindery.event.shared.EventBus;
+
import org.eclipse.che.api.core.rest.shared.dto.ServiceError;
-import org.eclipse.che.ide.ext.git.client.GitLocalizationConstant;
import org.eclipse.che.api.git.gwt.client.GitServiceClient;
import org.eclipse.che.api.git.shared.Branch;
import org.eclipse.che.api.git.shared.PullResponse;
@@ -20,25 +23,27 @@
import org.eclipse.che.ide.api.app.CurrentProject;
import org.eclipse.che.ide.api.editor.EditorAgent;
import org.eclipse.che.ide.api.editor.EditorPartPresenter;
-import org.eclipse.che.ide.api.event.FileEvent;
+import org.eclipse.che.ide.api.event.FileContentUpdateEvent;
+import org.eclipse.che.ide.api.notification.Notification;
import org.eclipse.che.ide.api.notification.NotificationManager;
import org.eclipse.che.ide.api.project.tree.VirtualFile;
import org.eclipse.che.ide.dto.DtoFactory;
import org.eclipse.che.ide.ext.git.client.BranchSearcher;
-import org.eclipse.che.ide.part.explorer.project.NewProjectExplorerPresenter;
+import org.eclipse.che.ide.ext.git.client.GitLocalizationConstant;
+import org.eclipse.che.ide.ext.git.client.GitOutputPartPresenter;
+import org.eclipse.che.ide.part.explorer.project.ProjectExplorerPresenter;
import org.eclipse.che.ide.rest.AsyncRequestCallback;
import org.eclipse.che.ide.rest.DtoUnmarshallerFactory;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import com.google.web.bindery.event.shared.EventBus;
-
-import javax.annotation.Nonnull;
+import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
import static org.eclipse.che.api.git.shared.BranchListRequest.LIST_LOCAL;
import static org.eclipse.che.api.git.shared.BranchListRequest.LIST_REMOTE;
+import static org.eclipse.che.ide.api.notification.Notification.Status.PROGRESS;
+import static org.eclipse.che.ide.api.notification.Notification.Status.FINISHED;
+import static org.eclipse.che.ide.api.notification.Notification.Type.ERROR;
/**
* Presenter pulling changes from remote repository.
@@ -47,24 +52,26 @@
*/
@Singleton
public class PullPresenter implements PullView.ActionDelegate {
- private final PullView view;
- private final GitServiceClient gitServiceClient;
- private final EventBus eventBus;
- private final GitLocalizationConstant constant;
- private final EditorAgent editorAgent;
- private final AppContext appContext;
- private final NotificationManager notificationManager;
- private final DtoUnmarshallerFactory dtoUnmarshallerFactory;
- private final DtoFactory dtoFactory;
- private final BranchSearcher branchSearcher;
- private final NewProjectExplorerPresenter projectExplorer;
- private CurrentProject project;
+ private final PullView view;
+ private final GitServiceClient gitServiceClient;
+ private final EventBus eventBus;
+ private final GitLocalizationConstant constant;
+ private final EditorAgent editorAgent;
+ private final AppContext appContext;
+ private final NotificationManager notificationManager;
+ private final DtoUnmarshallerFactory dtoUnmarshallerFactory;
+ private final GitOutputPartPresenter console;
+ private final DtoFactory dtoFactory;
+ private final BranchSearcher branchSearcher;
+ private final ProjectExplorerPresenter projectExplorer;
+ private CurrentProject project;
@Inject
public PullPresenter(PullView view,
EditorAgent editorAgent,
GitServiceClient gitServiceClient,
+ GitOutputPartPresenter console,
EventBus eventBus,
AppContext appContext,
GitLocalizationConstant constant,
@@ -72,8 +79,9 @@ public PullPresenter(PullView view,
DtoUnmarshallerFactory dtoUnmarshallerFactory,
DtoFactory dtoFactory,
BranchSearcher branchSearcher,
- NewProjectExplorerPresenter projectExplorer) {
+ ProjectExplorerPresenter projectExplorer) {
this.view = view;
+ this.console = console;
this.dtoFactory = dtoFactory;
this.branchSearcher = branchSearcher;
this.projectExplorer = projectExplorer;
@@ -90,21 +98,21 @@ public PullPresenter(PullView view,
/** Show dialog. */
public void showDialog() {
project = appContext.getCurrentProject();
- getRemotes();
+ updateRemotes();
}
/**
- * Get the list of remote repositories for local one. If remote repositories are found, then get the list of branches (remote and
+ * Update the list of remote repositories for local one. If remote repositories are found, then update the list of branches (remote and
* local).
*/
- private void getRemotes() {
+ private void updateRemotes() {
view.setEnablePullButton(true);
gitServiceClient.remoteList(project.getRootProject(), null, true,
new AsyncRequestCallback>(dtoUnmarshallerFactory.newListUnmarshaller(Remote.class)) {
@Override
protected void onSuccess(List result) {
- getBranches(LIST_REMOTE);
+ updateBranches(LIST_REMOTE);
view.setRepositories(result);
view.setEnablePullButton(!result.isEmpty());
view.showDialog();
@@ -115,6 +123,7 @@ protected void onFailure(Throwable exception) {
String errorMessage =
exception.getMessage() != null ? exception.getMessage()
: constant.remoteListFailed();
+ console.printError(errorMessage);
notificationManager.showError(errorMessage);
view.setEnablePullButton(false);
}
@@ -123,12 +132,11 @@ protected void onFailure(Throwable exception) {
}
/**
- * Get the list of branches.
+ * Update the list of branches.
*
- * @param remoteMode
- * is a remote mode
+ * @param remoteMode is a remote mode
*/
- private void getBranches(@Nonnull final String remoteMode) {
+ private void updateBranches(@NotNull final String remoteMode) {
gitServiceClient.branchList(project.getRootProject(), remoteMode,
new AsyncRequestCallback>(dtoUnmarshallerFactory.newListUnmarshaller(Branch.class)) {
@Override
@@ -136,7 +144,7 @@ protected void onSuccess(List result) {
if (LIST_REMOTE.equals(remoteMode)) {
view.setRemoteBranches(branchSearcher.getRemoteBranchesToDisplay(view.getRepositoryName(),
result));
- getBranches(LIST_LOCAL);
+ updateBranches(LIST_LOCAL);
} else {
view.setLocalBranches(branchSearcher.getLocalBranchesToDisplay(result));
for (Branch branch : result) {
@@ -153,6 +161,7 @@ protected void onFailure(Throwable exception) {
String errorMessage =
exception.getMessage() != null ? exception.getMessage()
: constant.branchesListFailed();
+ console.printError(errorMessage);
notificationManager.showError(errorMessage);
view.setEnablePullButton(false);
}
@@ -172,13 +181,19 @@ public void onPullClicked() {
openedEditors.add(partPresenter);
}
+ final Notification notification = new Notification(constant.pullProcess(), PROGRESS, true);
+ notificationManager.showNotification(notification);
gitServiceClient.pull(project.getRootProject(), getRefs(), remoteName,
new AsyncRequestCallback(dtoUnmarshallerFactory.newUnmarshaller(PullResponse.class)) {
@Override
protected void onSuccess(PullResponse result) {
- notificationManager.showInfo(result.getCommandOutput());
- if (!result.getCommandOutput().contains("Already up-to-date")) {
+ console.printInfo(result.getCommandOutput());
+ notification.setStatus(FINISHED);
+ if (result.getCommandOutput().contains("Already up-to-date")) {
+ notification.setMessage(constant.pullUpToDate());
+ } else {
refreshProject(openedEditors);
+ notification.setMessage(constant.pullSuccess(remoteUrl));
}
}
@@ -187,7 +202,7 @@ protected void onFailure(Throwable throwable) {
if (throwable.getMessage().contains("Merge conflict")) {
refreshProject(openedEditors);
}
- handleError(throwable, remoteUrl);
+ handleError(throwable, remoteUrl, notification);
}
});
}
@@ -199,15 +214,15 @@ protected void onFailure(Throwable throwable) {
* editors that corresponds to open files
*/
private void refreshProject(final List openedEditors) {
- projectExplorer.synchronizeTree();
+ projectExplorer.reloadChildren();
for (EditorPartPresenter partPresenter : openedEditors) {
final VirtualFile file = partPresenter.getEditorInput().getFile();
- eventBus.fireEvent(new FileEvent(file, FileEvent.FileOperation.CLOSE));
+ eventBus.fireEvent(new FileContentUpdateEvent(file.getPath()));
}
}
/** @return list of refs to fetch */
- @Nonnull
+ @NotNull
private String getRefs() {
String remoteName = view.getRepositoryName();
String localBranch = view.getLocalBranch();
@@ -223,22 +238,27 @@ private String getRefs() {
* @param throwable
* exception what happened
*/
- private void handleError(@Nonnull Throwable throwable, @Nonnull String remoteUrl) {
+ private void handleError(@NotNull Throwable throwable, @NotNull String remoteUrl, Notification notification) {
String errorMessage = throwable.getMessage();
+ notification.setType(ERROR);
if (errorMessage == null) {
- notificationManager.showError(constant.pullFail(remoteUrl));
+ console.printError(constant.pullFail(remoteUrl));
+ notification.setMessage(constant.pullFail(remoteUrl));
return;
}
try {
errorMessage = dtoFactory.createDtoFromJson(errorMessage, ServiceError.class).getMessage();
if (errorMessage.equals("Unable get private ssh key")) {
- notificationManager.showError(constant.messagesUnableGetSshKey());
+ console.printError(constant.messagesUnableGetSshKey());
+ notification.setMessage(constant.messagesUnableGetSshKey());
return;
}
- notificationManager.showError(errorMessage);
+ console.printError(errorMessage);
+ notification.setMessage(errorMessage);
} catch (Exception e) {
- notificationManager.showError(errorMessage);
+ console.printError(errorMessage);
+ notification.setMessage(errorMessage);
}
}
@@ -253,4 +273,10 @@ public void onCancelClicked() {
public void onRemoteBranchChanged() {
view.selectLocalBranch(view.getRemoteBranch());
}
+
+ /** {@inheritDoc} */
+ @Override
+ public void onRemoteRepositoryChanged() {
+ updateBranches(LIST_REMOTE);
+ }
}
diff --git a/plugin-git/che-plugin-git-ext-git/src/main/java/org/eclipse/che/ide/ext/git/client/pull/PullView.java b/plugin-git/che-plugin-git-ext-git/src/main/java/org/eclipse/che/ide/ext/git/client/pull/PullView.java
index daed9851d..be9bb5136 100644
--- a/plugin-git/che-plugin-git-ext-git/src/main/java/org/eclipse/che/ide/ext/git/client/pull/PullView.java
+++ b/plugin-git/che-plugin-git-ext-git/src/main/java/org/eclipse/che/ide/ext/git/client/pull/PullView.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012-2015 Codenvy, S.A.
+ * Copyright (c) 2012-2016 Codenvy, S.A.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,7 +13,7 @@
import org.eclipse.che.api.git.shared.Remote;
import org.eclipse.che.ide.api.mvp.View;
-import javax.annotation.Nonnull;
+import javax.validation.constraints.NotNull;
import java.util.List;
/**
@@ -32,6 +32,9 @@ public interface ActionDelegate {
/** Performs any actions appropriate in response to the remote branch value changed. */
void onRemoteBranchChanged();
+
+ /** Performs any actions appropriate in response to the repository value changed. */
+ void onRemoteRepositoryChanged();
}
/**
@@ -39,7 +42,7 @@ public interface ActionDelegate {
*
* @return repository name.
*/
- @Nonnull
+ @NotNull
String getRepositoryName();
/**
@@ -47,7 +50,7 @@ public interface ActionDelegate {
*
* @return repository url.
*/
- @Nonnull
+ @NotNull
String getRepositoryUrl();
/**
@@ -56,10 +59,10 @@ public interface ActionDelegate {
* @param repositories
* available repositories
*/
- void setRepositories(@Nonnull List repositories);
+ void setRepositories(@NotNull List repositories);
/** @return local branch */
- @Nonnull
+ @NotNull
String getLocalBranch();
/**
@@ -67,14 +70,14 @@ public interface ActionDelegate {
*
* @param branch local branch to select
*/
- void selectLocalBranch(@Nonnull String branch);
+ void selectLocalBranch(@NotNull String branch);
/**
* Selects pointed remote branch
*
* @param branch remote branch to select
*/
- void selectRemoteBranch(@Nonnull String branch);
+ void selectRemoteBranch(@NotNull String branch);
/**
* Set local branches into view.
@@ -82,10 +85,10 @@ public interface ActionDelegate {
* @param branches
* local branches
*/
- void setLocalBranches(@Nonnull List branches);
+ void setLocalBranches(@NotNull List branches);
/** @return remote branches */
- @Nonnull
+ @NotNull
String getRemoteBranch();
/**
@@ -94,7 +97,7 @@ public interface ActionDelegate {
* @param branches
* remote branches
*/
- void setRemoteBranches(@Nonnull List branches);
+ void setRemoteBranches(@NotNull List branches);
/**
* Change the enable state of the push button.
diff --git a/plugin-git/che-plugin-git-ext-git/src/main/java/org/eclipse/che/ide/ext/git/client/pull/PullViewImpl.java b/plugin-git/che-plugin-git-ext-git/src/main/java/org/eclipse/che/ide/ext/git/client/pull/PullViewImpl.java
index a049438d3..6da621192 100644
--- a/plugin-git/che-plugin-git-ext-git/src/main/java/org/eclipse/che/ide/ext/git/client/pull/PullViewImpl.java
+++ b/plugin-git/che-plugin-git-ext-git/src/main/java/org/eclipse/che/ide/ext/git/client/pull/PullViewImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012-2015 Codenvy, S.A.
+ * Copyright (c) 2012-2016 Codenvy, S.A.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,7 +28,7 @@
import com.google.inject.Inject;
import com.google.inject.Singleton;
-import javax.annotation.Nonnull;
+import javax.validation.constraints.NotNull;
import java.util.List;
/**
@@ -94,7 +94,7 @@ public void onClick(ClickEvent event) {
}
/** {@inheritDoc} */
- @Nonnull
+ @NotNull
@Override
public String getRepositoryName() {
int index = repository.getSelectedIndex();
@@ -102,7 +102,7 @@ public String getRepositoryName() {
}
/** {@inheritDoc} */
- @Nonnull
+ @NotNull
@Override
public String getRepositoryUrl() {
int index = repository.getSelectedIndex();
@@ -111,7 +111,7 @@ public String getRepositoryUrl() {
/** {@inheritDoc} */
@Override
- public void setRepositories(@Nonnull List repositories) {
+ public void setRepositories(@NotNull List repositories) {
this.repository.clear();
for (Remote repository : repositories) {
this.repository.addItem(repository.getName(), repository.getUrl());
@@ -119,7 +119,7 @@ public void setRepositories(@Nonnull List repositories) {
}
/** {@inheritDoc} */
- @Nonnull
+ @NotNull
@Override
public String getLocalBranch() {
int index = localBranch.getSelectedIndex();
@@ -128,7 +128,7 @@ public String getLocalBranch() {
/** {@inheritDoc} */
@Override
- public void setLocalBranches(@Nonnull List branches) {
+ public void setLocalBranches(@NotNull List branches) {
this.localBranch.clear();
for (String branch : branches) {
this.localBranch.addItem(branch);
@@ -136,7 +136,7 @@ public void setLocalBranches(@Nonnull List branches) {
}
/** {@inheritDoc} */
- @Nonnull
+ @NotNull
@Override
public String getRemoteBranch() {
int index = remoteBranch.getSelectedIndex();
@@ -145,7 +145,7 @@ public String getRemoteBranch() {
/** {@inheritDoc} */
@Override
- public void setRemoteBranches(@Nonnull List branches) {
+ public void setRemoteBranches(@NotNull List branches) {
this.remoteBranch.clear();
for (String branch : branches) {
this.remoteBranch.addItem(branch);
@@ -177,10 +177,15 @@ public void setDelegate(ActionDelegate delegate) {
}
@UiHandler("remoteBranch")
- public void onValueChanged(ChangeEvent event) {
+ public void onRemoteBranchValueChanged(ChangeEvent event) {
delegate.onRemoteBranchChanged();
}
+ @UiHandler("repository")
+ public void onRemoteRepositoryValueChanged(ChangeEvent event) {
+ delegate.onRemoteRepositoryChanged();
+ }
+
/** {@inheritDoc} */
@Override
public void selectLocalBranch(String branch) {
diff --git a/plugin-git/che-plugin-git-ext-git/src/main/java/org/eclipse/che/ide/ext/git/client/pull/PullViewImpl.ui.xml b/plugin-git/che-plugin-git-ext-git/src/main/java/org/eclipse/che/ide/ext/git/client/pull/PullViewImpl.ui.xml
index ed009da01..0a9e9a0ac 100644
--- a/plugin-git/che-plugin-git-ext-git/src/main/java/org/eclipse/che/ide/ext/git/client/pull/PullViewImpl.ui.xml
+++ b/plugin-git/che-plugin-git-ext-git/src/main/java/org/eclipse/che/ide/ext/git/client/pull/PullViewImpl.ui.xml
@@ -1,6 +1,6 @@
-
- org.codehaus.mojo
- findbugs-maven-plugin
-
-
-
- check
-
-
-
-
- Max
- Low
- true
-
-
-
-
diff --git a/plugin-gulp/che-plugin-gulp-runner/pom.xml b/plugin-gulp/che-plugin-gulp-runner/pom.xml
index 707857864..4009803c7 100644
--- a/plugin-gulp/che-plugin-gulp-runner/pom.xml
+++ b/plugin-gulp/che-plugin-gulp-runner/pom.xml
@@ -16,19 +16,71 @@
che-plugin-gulp-parent
org.eclipse.che.plugin
- 3.12.2-SNAPSHOT
+ 3.14.2-SNAPSHOT
che-plugin-gulp-runner
jar
Che Plugin :: GulpJS :: Runner
-
+
+ com.google.inject
+ guice
+ provided
+
+
+ com.google.inject.extensions
+ guice-multibindings
+ provided
+
+
+ javax.inject
+ javax.inject
+ provided
+
+
+ javax.ws.rs
+ javax.ws.rs-api
+ provided
+
+
+ org.eclipse.che.core
+ che-core-api-builder
+ provided
+
+
+ org.eclipse.che.core
+ che-core-api-core
+ provided
+
+
+ org.eclipse.che.core
+ che-core-api-dto
+ provided
+
+
+ org.eclipse.che.core
+ che-core-api-project
+ provided
+
org.eclipse.che.core
che-core-api-runner
- ${che.core.version}
+ provided
+
+
+ org.eclipse.che.core
+ che-core-commons-inject
+ provided
+
+
+ org.eclipse.che.core
+ che-core-commons-lang
+ provided
+
+
+ org.slf4j
+ slf4j-api
provided
-
diff --git a/plugin-gulp/pom.xml b/plugin-gulp/pom.xml
index 78fb915fd..4e9e26aa4 100644
--- a/plugin-gulp/pom.xml
+++ b/plugin-gulp/pom.xml
@@ -16,7 +16,7 @@
che-plugin-parent
org.eclipse.che.plugin
- 3.12.2-SNAPSHOT
+ 3.14.2-SNAPSHOT
../pom.xml
che-plugin-gulp-parent
@@ -26,27 +26,7 @@
che-plugin-gulp-runner
+ true
2014
-
-
-
-
- org.codehaus.mojo
- findbugs-maven-plugin
-
-
-
- check
-
-
-
-
- Max
- Low
- true
-
-
-
-
diff --git a/plugin-help/che-plugin-help-ext-client/pom.xml b/plugin-help/che-plugin-help-ext-client/pom.xml
index 9e6409b5f..c5942f5fc 100644
--- a/plugin-help/che-plugin-help-ext-client/pom.xml
+++ b/plugin-help/che-plugin-help-ext-client/pom.xml
@@ -1,7 +1,7 @@
-
-
-
-
-
diff --git a/plugin-help/che-plugin-help-ext-client/src/main/resources/org/eclipse/che/ide/ext/help/client/actions/forums.svg b/plugin-help/che-plugin-help-ext-client/src/main/resources/org/eclipse/che/ide/ext/help/client/actions/forums.svg
deleted file mode 100644
index 6b8908aec..000000000
--- a/plugin-help/che-plugin-help-ext-client/src/main/resources/org/eclipse/che/ide/ext/help/client/actions/forums.svg
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/plugin-help/pom.xml b/plugin-help/pom.xml
index c64e9cf58..2443b4e8c 100644
--- a/plugin-help/pom.xml
+++ b/plugin-help/pom.xml
@@ -1,7 +1,7 @@
-
- org.codehaus.mojo
- findbugs-maven-plugin
-
-
-
- check
-
-
-
-
- Max
- Low
- true
-
-
-
-
diff --git a/plugin-orion/che-plugin-orion-editor/pom.xml b/plugin-orion/che-plugin-orion-editor/pom.xml
index ddc20415a..d87b4dd9e 100644
--- a/plugin-orion/che-plugin-orion-editor/pom.xml
+++ b/plugin-orion/che-plugin-orion-editor/pom.xml
@@ -16,7 +16,7 @@
che-plugin-orion-parent
org.eclipse.che.plugin
- 3.12.2-SNAPSHOT
+ 3.14.2-SNAPSHOT
../pom.xml
che-plugin-orion-editor
@@ -25,22 +25,38 @@
2014-2015
-
-
-
-
- org.eclipse.che.core
- che-core-ide-app
- ${che.core.version}
- compile
-
-
-
+
+ com.google.gwt
+ gwt-elemental
+
+
+ com.google.gwt
+ gwt-user
+
+
+ com.google.inject
+ guice
+
+
+ com.google.inject.extensions
+ guice-assistedinject
+
+
+ javax.inject
+ javax.inject
+
+
+ org.eclipse.che.core
+ che-core-api-project
+
+
+ org.eclipse.che.core
+ che-core-commons-gwt
+
org.eclipse.che.core
che-core-ide-api
- ${che.core.version}
@@ -50,12 +66,14 @@
org.eclipse.che.core
che-core-ide-jseditor
- ${che.core.version}
+
+
+ org.eclipse.che.core
+ che-core-ide-ui
com.google.gwt.inject
gin
- ${com.google.gwt.gin.version}
provided
@@ -75,9 +93,8 @@
- **/org/eclipse/che/ide/editor/orion/public/orion/**
- **/org/eclipse/che/ide/editor/orion/public/orion-6.0/**
- **/org/eclipse/che/ide/editor/orion/public/built-editor-compat.css
+ **/org/eclipse/che/ide/editor/orion/public/orion-10.0/**
+ **/org/eclipse/che/ide/editor/orion/public/built-codeEdit-compat.css
diff --git a/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/OrionDocument.java b/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/OrionDocument.java
index 39b1464af..479368bb0 100644
--- a/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/OrionDocument.java
+++ b/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/OrionDocument.java
@@ -10,19 +10,24 @@
*******************************************************************************/
package org.eclipse.che.ide.editor.orion.client;
+import com.google.web.bindery.event.shared.HandlerRegistration;
+
import org.eclipse.che.ide.api.text.Region;
+import org.eclipse.che.ide.editor.orion.client.jso.ModelChangedEventOverlay;
+import org.eclipse.che.ide.editor.orion.client.jso.OrionEditorOverlay;
import org.eclipse.che.ide.editor.orion.client.jso.OrionPixelPositionOverlay;
import org.eclipse.che.ide.editor.orion.client.jso.OrionSelectionOverlay;
+import org.eclipse.che.ide.editor.orion.client.jso.OrionTextModelOverlay.EventHandler;
import org.eclipse.che.ide.editor.orion.client.jso.OrionTextViewOverlay;
import org.eclipse.che.ide.jseditor.client.document.AbstractEmbeddedDocument;
import org.eclipse.che.ide.jseditor.client.document.EmbeddedDocument;
import org.eclipse.che.ide.jseditor.client.events.CursorActivityHandler;
+import org.eclipse.che.ide.jseditor.client.events.DocumentChangeEvent;
import org.eclipse.che.ide.jseditor.client.events.HasCursorActivityHandlers;
import org.eclipse.che.ide.jseditor.client.position.PositionConverter;
import org.eclipse.che.ide.jseditor.client.text.LinearRange;
import org.eclipse.che.ide.jseditor.client.text.TextPosition;
import org.eclipse.che.ide.jseditor.client.text.TextRange;
-import com.google.web.bindery.event.shared.HandlerRegistration;
/**
* The implementation of {@link EmbeddedDocument} for Orion.
@@ -31,26 +36,61 @@
*/
public class OrionDocument extends AbstractEmbeddedDocument {
- private final OrionTextViewOverlay textViewOverlay;
-
- private final OrionPositionConverter positionConverter;
+ private final OrionTextViewOverlay textViewOverlay;
+ private final OrionPositionConverter positionConverter;
+ private final HasCursorActivityHandlers hasCursorActivityHandlers;
+ private final OrionEditorOverlay editorOverlay;
- private final HasCursorActivityHandlers hasCursorActivityHandlers;
+ public OrionDocument(OrionTextViewOverlay textViewOverlay,
+ HasCursorActivityHandlers hasCursorActivityHandlers,
+ OrionEditorOverlay editorOverlay) {
- public OrionDocument(final OrionTextViewOverlay textViewOverlay,
- final HasCursorActivityHandlers hasCursorActivityHandlers) {
this.textViewOverlay = textViewOverlay;
this.hasCursorActivityHandlers = hasCursorActivityHandlers;
+ this.editorOverlay = editorOverlay;
this.positionConverter = new OrionPositionConverter();
+
+ this.editorOverlay.getModel().addEventListener("Changed", new EventHandler() {
+ @Override
+ public void onEvent(ModelChangedEventOverlay parameter) {
+ fireDocumentChangeEvent(parameter);
+ }
+ }, true);
+ }
+
+ private void fireDocumentChangeEvent(final ModelChangedEventOverlay param) {
+ int startOffset = param.start();
+ int addedCharCount = param.addedCharCount();
+ int removedCharCount = param.removedCharCount();
+ int length = 0;
+
+ if (addedCharCount != 0) {
+ //adding
+ length = addedCharCount;
+ } else if (removedCharCount != 0) {
+ //deleting
+ //TODO there may be bug
+ length = removedCharCount;
+ startOffset = startOffset - length;
+ }
+ String text = editorOverlay.getModel().getText(startOffset, startOffset + length);
+
+ final DocumentChangeEvent event = new DocumentChangeEvent(this,
+ startOffset,
+ length,
+ text,
+ removedCharCount);//TODO: need check removedCharCount add it for fix
+ // according to https://github.com/codenvy/che-core/pull/122
+ getDocEventBus().fireEvent(event);
}
@Override
public TextPosition getPositionFromIndex(final int index) {
- final int line = this.textViewOverlay.getModel().getLineAtOffset(index);
+ final int line = this.editorOverlay.getModel().getLineAtOffset(index);
if (line == -1) {
return null;
}
- final int lineStart = this.textViewOverlay.getModel().getLineStart(line);
+ final int lineStart = this.editorOverlay.getModel().getLineStart(line);
if (lineStart == -1) {
return null;
}
@@ -63,13 +103,13 @@ public TextPosition getPositionFromIndex(final int index) {
@Override
public int getIndexFromPosition(final TextPosition position) {
- final int lineStart = this.textViewOverlay.getModel().getLineStart(position.getLine());
+ final int lineStart = this.editorOverlay.getModel().getLineStart(position.getLine());
if (lineStart == -1) {
return -1;
}
final int result = lineStart + position.getCharacter();
- final int lineEnd = this.textViewOverlay.getModel().getLineEnd(position.getLine());
+ final int lineEnd = this.editorOverlay.getModel().getLineEnd(position.getLine());
if (lineEnd < result) {
return -1;
@@ -79,23 +119,23 @@ public int getIndexFromPosition(final TextPosition position) {
@Override
public void setCursorPosition(final TextPosition position) {
- this.textViewOverlay.setCaretOffset(getIndexFromPosition(position));
+ this.editorOverlay.setCaretOffset(getIndexFromPosition(position));
}
@Override
public TextPosition getCursorPosition() {
- final int offset = this.textViewOverlay.getCaretOffset();
+ final int offset = this.editorOverlay.getCaretOffset();
return getPositionFromIndex(offset);
}
public int getCursorOffset() {
- return this.textViewOverlay.getCaretOffset();
+ return this.editorOverlay.getTextView().getCaretOffset();
}
@Override
public int getLineCount() {
- return this.textViewOverlay.getModel().getLineCount();
+ return this.editorOverlay.getModel().getLineCount();
}
@Override
@@ -105,19 +145,19 @@ public HandlerRegistration addCursorHandler(final CursorActivityHandler handler)
@Override
public String getContents() {
- return this.textViewOverlay.getModel().getText();
+ return editorOverlay.getText();
}
@Override
public String getContentRange(final int offset, final int length) {
- return this.textViewOverlay.getModel().getText(offset, offset + length);
+ return this.editorOverlay.getModel().getText(offset, offset + length);
}
@Override
public String getContentRange(final TextRange range) {
final int startOffset = getIndexFromPosition(range.getFrom());
final int endOffset = getIndexFromPosition(range.getTo());
- return this.textViewOverlay.getModel().getText(startOffset, endOffset);
+ return this.editorOverlay.getModel().getText(startOffset, endOffset);
}
public PositionConverter getPositionConverter() {
@@ -134,7 +174,9 @@ public PixelCoordinates textToPixel(TextPosition textPosition) {
@Override
public PixelCoordinates offsetToPixel(int textOffset) {
- final OrionPixelPositionOverlay location = textViewOverlay.getLocationAtOffset(textOffset);
+ OrionPixelPositionOverlay location = textViewOverlay.getLocationAtOffset(textOffset);
+ location.setY(location.getY() + textViewOverlay.getLineHeight());
+ location = textViewOverlay.convert(location, "document", "page");
return new PixelCoordinates(location.getX(), location.getY());
}
@@ -152,16 +194,16 @@ public int pixelToOffset(PixelCoordinates coordinates) {
}
public void replace(final Region region, final String text) {
- this.textViewOverlay.getModel().setText(text, region.getOffset(), region.getLength());
+ this.editorOverlay.setText(text, region.getOffset(), region.getOffset() + region.getLength());
}
public int getContentsCharCount() {
- return this.textViewOverlay.getModel().getCharCount();
+ return this.editorOverlay.getModel().getCharCount();
}
@Override
public String getLineContent(final int line) {
- return this.textViewOverlay.getModel().getLine(line);
+ return this.editorOverlay.getModel().getLine(line);
}
@Override
diff --git a/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/OrionEditorExtension.java b/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/OrionEditorExtension.java
index 675fbdcb6..1949beb53 100644
--- a/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/OrionEditorExtension.java
+++ b/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/OrionEditorExtension.java
@@ -10,10 +10,15 @@
*******************************************************************************/
package org.eclipse.che.ide.editor.orion.client;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.inject.Inject;
+import com.google.gwt.core.client.Callback;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.JavaScriptException;
+import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.core.client.JsArrayString;
+import com.google.gwt.core.client.RunAsyncCallback;
+import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.LinkElement;
+import com.google.gwt.dom.client.Node;
import org.eclipse.che.ide.api.extension.Extension;
import org.eclipse.che.ide.api.notification.Notification;
@@ -33,15 +38,10 @@
import org.eclipse.che.ide.jseditor.client.texteditor.ConfigurableTextEditor;
import org.eclipse.che.ide.jseditor.client.texteditor.EmbeddedTextEditorPresenter;
import org.eclipse.che.ide.util.loging.Log;
-import com.google.gwt.core.client.Callback;
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.core.client.JavaScriptException;
-import com.google.gwt.core.client.JavaScriptObject;
-import com.google.gwt.core.client.JsArrayString;
-import com.google.gwt.core.client.RunAsyncCallback;
-import com.google.gwt.dom.client.Document;
-import com.google.gwt.dom.client.LinkElement;
-import com.google.gwt.dom.client.Node;
+
+import javax.inject.Inject;
+import java.util.logging.Level;
+import java.util.logging.Logger;
@Extension(title = "Orion Editor", version = "1.1.0")
public class OrionEditorExtension {
@@ -103,11 +103,8 @@ public void onFailure(final Throwable reason) {
}
private void injectOrion(final InitializerCallback callback) {
- // styler scripts are loaded on-demand by orion
final String[] scripts = new String[]{
- "orion-6.0/built-editor-amd.min",
- "orion/emacs",
- "orion/vi",
+ "orion-10.0/code_edit/built-codeEdit-amd.min",
};
this.requireJsLoader.require(new Callback() {
@@ -136,7 +133,7 @@ public void onFailure(final Throwable e) {
}
}, scripts, new String[0]);
- injectCssLink(GWT.getModuleBaseForStaticFiles() + "built-editor-compat.css");
+ injectCssLink(GWT.getModuleBaseForStaticFiles() + "built-codeEdit-compat.css");
}
private static void injectCssLink(final String url) {
@@ -158,19 +155,19 @@ private static native void nativeAttachToHead(Node element) /*-{
private void requireOrion(final InitializerCallback callback) {
this.requireJsLoader.require(new Callback() {
- @Override
- public void onFailure(final Throwable reason) {
- LOG.log(Level.SEVERE, "Unable to initialize Orion ", reason);
- initializationFailed(callback, "Unable to initialize Orion.", reason);
- }
-
- @Override
- public void onSuccess(final JavaScriptObject[] result) {
- endConfiguration(callback);
- }
- },
- new String[]{"orion/editor/edit", "orion/editor/emacs", "orion/editor/vi", "orion/keyBinding"},
- new String[]{"OrionEditor", "OrionEmacs", "OrionVi", "OrionKeyBinding"});
+ @Override
+ public void onFailure(final Throwable reason) {
+ LOG.log(Level.SEVERE, "Unable to initialize Orion ", reason);
+ initializationFailed(callback, "Unable to initialize Orion.", reason);
+ }
+
+ @Override
+ public void onSuccess(final JavaScriptObject[] result) {
+ endConfiguration(callback);
+ }
+ },
+ new String[]{"orion/codeEdit", "orion/editor/emacs", "orion/editor/vi", "orion/keyBinding"},
+ new String[]{"CodeEditWidget", "OrionEmacs", "OrionVi", "OrionKeyBinding"});
}
private void endConfiguration(final InitializerCallback callback) {
diff --git a/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/OrionEditorWidget.java b/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/OrionEditorWidget.java
index 3ce3a3472..748ed22cd 100644
--- a/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/OrionEditorWidget.java
+++ b/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/OrionEditorWidget.java
@@ -10,16 +10,44 @@
*******************************************************************************/
package org.eclipse.che.ide.editor.orion.client;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
+import com.google.gwt.event.dom.client.BlurEvent;
+import com.google.gwt.event.dom.client.BlurHandler;
+import com.google.gwt.event.dom.client.ChangeEvent;
+import com.google.gwt.event.dom.client.ChangeHandler;
+import com.google.gwt.event.dom.client.DomEvent;
+import com.google.gwt.event.dom.client.FocusEvent;
+import com.google.gwt.event.dom.client.FocusHandler;
+import com.google.gwt.event.dom.client.HasChangeHandlers;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.json.client.JSONArray;
+import com.google.gwt.json.client.JSONBoolean;
+import com.google.gwt.json.client.JSONObject;
+import com.google.gwt.json.client.JSONString;
+import com.google.gwt.resources.client.CssResource;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.user.client.ui.SimplePanel;
+import com.google.inject.assistedinject.Assisted;
+import com.google.inject.assistedinject.AssistedInject;
+import com.google.inject.name.Named;
+import com.google.web.bindery.event.shared.EventBus;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
+import org.eclipse.che.api.promises.client.Operation;
+import org.eclipse.che.api.promises.client.OperationException;
+import org.eclipse.che.ide.api.app.AppContext;
+import org.eclipse.che.ide.api.event.SelectionChangedEvent;
+import org.eclipse.che.ide.api.event.SelectionChangedHandler;
import org.eclipse.che.ide.api.text.Region;
import org.eclipse.che.ide.api.text.RegionImpl;
import org.eclipse.che.ide.api.texteditor.HandlesUndoRedo;
+import org.eclipse.che.ide.editor.orion.client.jso.OrionCodeEditWidgetOverlay;
+import org.eclipse.che.ide.editor.orion.client.jso.OrionContentAssistOverlay;
import org.eclipse.che.ide.editor.orion.client.jso.OrionEditorOverlay;
-import org.eclipse.che.ide.editor.orion.client.jso.OrionKeyModeOverlay;
+import org.eclipse.che.ide.editor.orion.client.jso.OrionEditorViewOverlay;
import org.eclipse.che.ide.editor.orion.client.jso.OrionSelectionOverlay;
import org.eclipse.che.ide.editor.orion.client.jso.OrionTextThemeOverlay;
import org.eclipse.che.ide.editor.orion.client.jso.OrionTextViewOverlay;
@@ -45,30 +73,17 @@
import org.eclipse.che.ide.jseditor.client.texteditor.CompositeEditorWidget;
import org.eclipse.che.ide.jseditor.client.texteditor.EditorWidget;
import org.eclipse.che.ide.jseditor.client.texteditor.LineStyler;
+import org.eclipse.che.ide.rest.RestContext;
import org.eclipse.che.ide.util.loging.Log;
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.core.client.JavaScriptObject;
-import com.google.gwt.dom.client.Document;
-import com.google.gwt.dom.client.Element;
-import com.google.gwt.event.dom.client.BlurEvent;
-import com.google.gwt.event.dom.client.BlurHandler;
-import com.google.gwt.event.dom.client.ChangeEvent;
-import com.google.gwt.event.dom.client.ChangeHandler;
-import com.google.gwt.event.dom.client.DomEvent;
-import com.google.gwt.event.dom.client.FocusEvent;
-import com.google.gwt.event.dom.client.FocusHandler;
-import com.google.gwt.event.dom.client.HasChangeHandlers;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.json.client.JSONBoolean;
-import com.google.gwt.json.client.JSONObject;
-import com.google.gwt.json.client.JSONString;
-import com.google.gwt.resources.client.CssResource;
-import com.google.gwt.uibinder.client.UiBinder;
-import com.google.gwt.uibinder.client.UiField;
-import com.google.gwt.user.client.ui.SimplePanel;
-import com.google.inject.assistedinject.Assisted;
-import com.google.inject.assistedinject.AssistedInject;
-import com.google.web.bindery.event.shared.EventBus;
+
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import static org.eclipse.che.ide.editor.orion.client.KeyMode.EMACS;
+import static org.eclipse.che.ide.editor.orion.client.KeyMode.VI;
+import static org.eclipse.che.ide.editor.orion.client.jso.OrionKeyModeOverlay.getEmacsKeyMode;
+import static org.eclipse.che.ide.editor.orion.client.jso.OrionKeyModeOverlay.getViKeyMode;
/**
* Orion implementation for {@link EditorWidget}.
@@ -84,42 +99,55 @@ public class OrionEditorWidget extends CompositeEditorWidget implements HasChang
private static final Logger LOG = Logger.getLogger(OrionEditorWidget.class.getSimpleName());
@UiField
- SimplePanel panel;
+ SimplePanel panel;
/** The instance of the orion editor native element style. */
@UiField
- EditorElementStyle editorElementStyle;
-
- private final OrionEditorOverlay editorOverlay;
- private String modeName;
- private final KeyModeInstances keyModeInstances;
- private final JavaScriptObject orionEditorModule;
- private final KeymapPrefReader keymapPrefReader;
-
+ EditorElementStyle editorElementStyle;
+
+ private final OrionCodeEditWidgetOverlay codeEditWidgetModule;
+ private final KeymapPrefReader keymapPrefReader;
+ private final ModuleHolder moduleHolder;
+ private final EventBus eventBus;
+ private final AppContext appContext;
+ private final String projectApiBaseURL;
+ private OrionEditorOverlay editorOverlay;
+ private OrionEditorViewOverlay editorViewOverlay;
+ private String modeName;
+ private KeyModeInstances keyModeInstances;
/** Component that handles undo/redo. */
- private final HandlesUndoRedo undoRedo;
+ private HandlesUndoRedo undoRedo;
- private OrionDocument embeddedDocument;
+ private OrionDocument embeddedDocument;
- private boolean changeHandlerAdded = false;
- private boolean focusHandlerAdded = false;
- private boolean blurHandlerAdded = false;
- private boolean scrollHandlerAdded = false;
- private boolean cursorHandlerAdded = false;
+ private boolean changeHandlerAdded = false;
+ private boolean focusHandlerAdded = false;
+ private boolean blurHandlerAdded = false;
+ private boolean scrollHandlerAdded = false;
+ private boolean cursorHandlerAdded = false;
- private Keymap keymap;
+ private Keymap keymap;
@AssistedInject
public OrionEditorWidget(final ModuleHolder moduleHolder,
final KeyModeInstances keyModeInstances,
final EventBus eventBus,
final KeymapPrefReader keymapPrefReader,
- @Assisted final List editorModes) {
+ final AppContext appContext,
+ @RestContext String restContext,
+ @Named("workspaceId") String workspaceId,
+ @Assisted final List editorModes,
+ @Assisted final WidgetInitializedCallback widgetInitializedCallback) {
+ this.moduleHolder = moduleHolder;
+ this.keyModeInstances = keyModeInstances;
+ this.eventBus = eventBus;
+ this.appContext = appContext;
+ this.projectApiBaseURL = restContext + "/project/" + workspaceId;
initWidget(UIBINDER.createAndBindUi(this));
this.keymapPrefReader = keymapPrefReader;
- this.orionEditorModule = moduleHolder.getModule("OrionEditor");
+ this.codeEditWidgetModule = moduleHolder.getModule("CodeEditWidget").cast();
// just first choice for the moment
if (editorModes != null && !editorModes.isEmpty()) {
@@ -128,22 +156,9 @@ public OrionEditorWidget(final ModuleHolder moduleHolder,
panel.getElement().setId("orion-parent-" + Document.get().createUniqueId());
panel.getElement().addClassName(this.editorElementStyle.editorParent());
- this.editorOverlay = OrionEditorOverlay.createEditor(panel.getElement(), getConfiguration(), orionEditorModule);
- this.keyModeInstances = keyModeInstances;
- final OrionTextViewOverlay textView = this.editorOverlay.getTextView();
- this.keyModeInstances.add(KeyMode.VI, OrionKeyModeOverlay.getViKeyMode(moduleHolder.getModule("OrionVi"), textView));
- this.keyModeInstances.add(KeyMode.EMACS, OrionKeyModeOverlay.getEmacsKeyMode(moduleHolder.getModule("OrionEmacs"), textView));
-
- setupKeymode();
- eventBus.addHandler(KeymapChangeEvent.TYPE, new KeymapChangeHandler() {
-
- @Override
- public void onKeymapChanged(final KeymapChangeEvent event) {
- setupKeymode();
- }
- });
- this.undoRedo = new OrionUndoRedo(this.editorOverlay.getUndoStack());
+ codeEditWidgetModule.createEditorView(panel.getElement(), getConfiguration())
+ .then(new EditorViewCreatedOperation(widgetInitializedCallback));
}
@Override
@@ -153,15 +168,21 @@ public String getValue() {
@Override
public void setValue(String newValue) {
- this.editorOverlay.setText(newValue);
+ this.editorViewOverlay.setContents(newValue, modeName);
this.editorOverlay.getUndoStack().reset();
}
private JavaScriptObject getConfiguration() {
final JSONObject json = new JSONObject();
+ JSONArray userPlugins = new JSONArray();
+ final String projectPath = appContext.getCurrentProject().getRootProject().getPath();
+ final String proposalsURL = projectApiBaseURL + "/file" + projectPath + "/.codenvy/proposals.json";
+ userPlugins.set(0, new JSONString(GWT.getModuleBaseForStaticFiles() +
+ "orion-10.0/che/plugins/jsContentAssistPlugin.html?proposals=" + proposalsURL));
+
+ json.put("userPlugins", userPlugins);
json.put("theme", new JSONObject(OrionTextThemeOverlay.getDefautTheme()));
- json.put("contentType", new JSONString(this.modeName));
json.put("noComputeSize", JSONBoolean.getInstance(true));
return json.getJavaScriptObject();
@@ -216,10 +237,10 @@ private void selectKeyMode(Keymap keymap) {
}
if (KeyMode.DEFAULT.equals(usedKeymap)) {
// nothing to do
- } else if (KeyMode.EMACS.equals(usedKeymap)) {
- this.editorOverlay.getTextView().addKeyMode(keyModeInstances.getInstance(KeyMode.EMACS));
- } else if (KeyMode.VI.equals(usedKeymap)) {
- this.editorOverlay.getTextView().addKeyMode(keyModeInstances.getInstance(KeyMode.VI));
+ } else if (EMACS.equals(usedKeymap)) {
+ this.editorOverlay.getTextView().addKeyMode(keyModeInstances.getInstance(EMACS));
+ } else if (VI.equals(usedKeymap)) {
+ this.editorOverlay.getTextView().addKeyMode(keyModeInstances.getInstance(VI));
} else {
usedKeymap = KeyMode.DEFAULT;
Log.error(OrionEditorWidget.class, "Unknown keymap type: " + keymap + " - changing to defaut one.");
@@ -228,14 +249,14 @@ private void selectKeyMode(Keymap keymap) {
}
private void resetKeyModes() {
- this.editorOverlay.getTextView().removeKeyMode(keyModeInstances.getInstance(KeyMode.VI));
- this.editorOverlay.getTextView().removeKeyMode(keyModeInstances.getInstance(KeyMode.EMACS));
+ this.editorOverlay.getTextView().removeKeyMode(keyModeInstances.getInstance(VI));
+ this.editorOverlay.getTextView().removeKeyMode(keyModeInstances.getInstance(EMACS));
}
@Override
public EmbeddedDocument getDocument() {
if (this.embeddedDocument == null) {
- this.embeddedDocument = new OrionDocument(this.editorOverlay.getTextView(), this);
+ this.embeddedDocument = new OrionDocument(this.editorOverlay.getTextView(), this, editorOverlay);
}
return this.embeddedDocument;
}
@@ -491,4 +512,43 @@ public interface EditorElementStyle extends CssResource {
@ClassName("editor-parent")
String editorParent();
}
+
+ private class EditorViewCreatedOperation implements Operation {
+ private final WidgetInitializedCallback widgetInitializedCallback;
+
+ private EditorViewCreatedOperation(WidgetInitializedCallback widgetInitializedCallback) {
+ this.widgetInitializedCallback = widgetInitializedCallback;
+ }
+
+ @Override
+ public void apply(OrionEditorViewOverlay arg) throws OperationException {
+ editorViewOverlay = arg;
+ editorOverlay = arg.getEditor();
+
+ final OrionContentAssistOverlay contentAssist = editorOverlay.getContentAssist();
+ eventBus.addHandler(SelectionChangedEvent.TYPE, new SelectionChangedHandler() {
+ @Override
+ public void onSelectionChanged(SelectionChangedEvent event) {
+ if (contentAssist.isActive()) {
+ contentAssist.deactivate();
+ }
+ }
+ });
+
+ final OrionTextViewOverlay textView = editorOverlay.getTextView();
+ keyModeInstances.add(VI, getViKeyMode(moduleHolder.getModule("OrionVi"), textView));
+ keyModeInstances.add(EMACS, getEmacsKeyMode(moduleHolder.getModule("OrionEmacs"), textView));
+
+ setupKeymode();
+ eventBus.addHandler(KeymapChangeEvent.TYPE, new KeymapChangeHandler() {
+ @Override
+ public void onKeymapChanged(final KeymapChangeEvent event) {
+ setupKeymode();
+ }
+ });
+ undoRedo = new OrionUndoRedo(editorOverlay.getUndoStack());
+
+ widgetInitializedCallback.initialized(OrionEditorWidget.this);
+ }
+ }
}
diff --git a/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/OrionEditorWidget.ui.xml b/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/OrionEditorWidget.ui.xml
index bafe9f54e..e828d851e 100644
--- a/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/OrionEditorWidget.ui.xml
+++ b/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/OrionEditorWidget.ui.xml
@@ -17,6 +17,24 @@
xmlns:g='urn:import:com.google.gwt.user.client.ui'>
.editor-container {
+ display: -webkit-flex; /* safari 8 */
+ display: flex;
+
+ -webkit-flex-flow: row; /* safari 8 */
+ flex-flow: row;
+
+ /* allow resize */
+ flex-grow: 1;
+ -wekbit-flex-grow: 1;
+ flex-shrink: 1;
+ -wekbit-flex-shrink: 1;
+
+ /* needed for safari - but can't replace -flex-grow/shrink as ie doesn't know fill-available */
+ min-width: -moz-fill-available;
+ min-width: -webkit-fill-available;
+ }
+
+ .editor {
position: relative;
/* allow resize */
@@ -35,6 +53,8 @@
}
-
+
+
+
\ No newline at end of file
diff --git a/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/jso/ModelChangedEventOverlay.java b/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/jso/ModelChangedEventOverlay.java
new file mode 100644
index 000000000..dca7b0824
--- /dev/null
+++ b/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/jso/ModelChangedEventOverlay.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2014-2015 Codenvy, S.A.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Codenvy, S.A. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.che.ide.editor.orion.client.jso;
+
+/**
+ * This is the event sent when the text in the model has changed.
+ * @author Evgen Vidolob
+ */
+public class ModelChangedEventOverlay extends OrionEventOverlay {
+ protected ModelChangedEventOverlay() {
+ }
+
+ /**
+ * @return the number of characters added to the model.
+ */
+ public final native int addedCharCount() /*-{
+ return this.addedCharCount;
+ }-*/;
+
+ /**
+ * @return The number of lines added to the model.
+ */
+ public final native int addedLineCount() /*-{
+ return this.addedLineCount;
+ }-*/;
+
+ /**
+ * @return The number of characters removed from the model.
+ */
+ public final native int removedCharCount() /*-{
+ return this.removedCharCount;
+ }-*/;
+
+ /**
+ * @return The number of lines removed from the model.
+ */
+ public final native int removedLineCount() /*-{
+ return this.removedLineCount;
+ }-*/;
+
+ /**
+ * @return The character offset in the model where the change has occurred.
+ */
+ public final native int start() /*-{
+ return this.start;
+ }-*/;
+
+}
diff --git a/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/jso/OrionCodeEditWidgetOverlay.java b/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/jso/OrionCodeEditWidgetOverlay.java
new file mode 100644
index 000000000..0967a1007
--- /dev/null
+++ b/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/jso/OrionCodeEditWidgetOverlay.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2014-2015 Codenvy, S.A.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Codenvy, S.A. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.che.ide.editor.orion.client.jso;
+
+import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.dom.client.Element;
+
+import org.eclipse.che.api.promises.client.Promise;
+
+/**
+ * JavaScript overlay over Orion CodeEdit object.
+ *
+ * @author Artem Zatsarynnyy
+ */
+public class OrionCodeEditWidgetOverlay extends JavaScriptObject {
+
+ protected OrionCodeEditWidgetOverlay() {
+ }
+
+ /**
+ * Creates an Orion EditorView instance.
+ *
+ * @param element
+ * the element backing the editor view
+ * @param options
+ * the editor view options
+ * @return an editor view instance
+ */
+ public final native Promise createEditorView(final Element element, final JavaScriptObject options) /*-{
+ options.parent = element;
+ return new this().create(options);
+ }-*/;
+}
diff --git a/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/jso/OrionContentAssistOverlay.java b/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/jso/OrionContentAssistOverlay.java
new file mode 100644
index 000000000..91b1cd3d1
--- /dev/null
+++ b/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/jso/OrionContentAssistOverlay.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2014-2015 Codenvy, S.A.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Codenvy, S.A. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.che.ide.editor.orion.client.jso;
+
+import com.google.gwt.core.client.JavaScriptObject;
+
+/**
+ * JavaScript overlay over Orion ContentAssist object.
+ *
+ * @author Artem Zatsarynnyy
+ */
+public class OrionContentAssistOverlay extends JavaScriptObject {
+
+ protected OrionContentAssistOverlay() {
+ }
+
+ /** Checks whether the content assist is active or not. */
+ public final native boolean isActive() /*-{
+ return this.isActive();
+ }-*/;
+
+ /** Deactivates the content assist. */
+ public final native void deactivate() /*-{
+ this.deactivate();
+ }-*/;
+}
diff --git a/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/jso/OrionEditorOverlay.java b/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/jso/OrionEditorOverlay.java
index 2b191f503..bf4f9e661 100644
--- a/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/jso/OrionEditorOverlay.java
+++ b/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/jso/OrionEditorOverlay.java
@@ -11,7 +11,6 @@
package org.eclipse.che.ide.editor.orion.client.jso;
import com.google.gwt.core.client.JavaScriptObject;
-import com.google.gwt.dom.client.Element;
public class OrionEditorOverlay extends JavaScriptObject {
@@ -30,6 +29,11 @@ public final native OrionTextViewOverlay getTextView() /*-{
return this.getTextView();
}-*/;
+ /** Returns the content assist of the editor. */
+ public final native OrionContentAssistOverlay getContentAssist() /*-{
+ return this.getContentAssist();
+ }-*/;
+
public final native void focus() /*-{
this.focus();
}-*/;
@@ -38,6 +42,18 @@ public final native OrionTextModelOverlay getModel() /*-{
return this.getModel();
}-*/;
+ public final native void setCaretOffset(int offset) /*-{
+ this.setCaretOffset(offset, true);
+ }-*/;
+
+ public final native int getCaretOffset() /*-{
+ return this.getCaretOffset();
+ }-*/;
+
+ public final native void setText(String text, int start, int end) /*-{
+ this.setText(text, start, end);
+ }-*/;
+
public final native OrionUndoStackOverlay getUndoStack() /*-{
return this.getUndoStack();
}-*/;
@@ -93,15 +109,6 @@ public final native void setDirty(final boolean newValue) /*-{
this.setDirty(newValue);
}-*/;
- public final static native OrionEditorOverlay createEditor(final Element element,
- final JavaScriptObject options,
- final JavaScriptObject orionEditor) /*-{
-
- options.parent = element;
- var editor = orionEditor(options);
- return editor;
- }-*/;
-
/**
* Report the message to the user.
* @param message the message
diff --git a/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/jso/OrionEditorViewOverlay.java b/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/jso/OrionEditorViewOverlay.java
new file mode 100644
index 000000000..70d7a09bb
--- /dev/null
+++ b/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/jso/OrionEditorViewOverlay.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2014-2015 Codenvy, S.A.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Codenvy, S.A. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.che.ide.editor.orion.client.jso;
+
+import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.dom.client.Element;
+
+/**
+ * JavaScript overlay over Orion EditorView object.
+ *
+ * @author Artem Zatsarynnyy
+ */
+public class OrionEditorViewOverlay extends JavaScriptObject {
+
+ protected OrionEditorViewOverlay() {
+ }
+
+ public final native void setContents(final String contents, final String contentType) /*-{
+ this.setContents(contents, contentType);
+ }-*/;
+
+ public final static native org.eclipse.che.api.promises.client.Promise createEditor(final Element element,
+ final JavaScriptObject options) /*-{
+ options.parent = element;
+ return this.create(options);
+ }-*/;
+
+ public final native OrionEditorOverlay getEditor() /*-{
+ return this.editor;
+ }-*/;
+}
diff --git a/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/jso/OrionTextModelOverlay.java b/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/jso/OrionTextModelOverlay.java
index 85527d4ea..1c3114a81 100644
--- a/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/jso/OrionTextModelOverlay.java
+++ b/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/jso/OrionTextModelOverlay.java
@@ -96,4 +96,17 @@ public final native OrionFindIteratorOverlay find(OrionFindOptionsOverlay option
return this.find(options);
}-*/;
+ public final native void addEventListener(String eventType,
+ EventHandler handler,
+ boolean useCapture) /*-{
+ var func = function (param) {
+ handler.@org.eclipse.che.ide.editor.orion.client.jso.OrionTextModelOverlay.EventHandler::onEvent(*)(param);
+ };
+
+ this.addEventListener(eventType, func, useCapture);
+ }-*/;
+
+ public interface EventHandler {
+ void onEvent(T parameter);
+ }
}
diff --git a/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/jso/OrionTextViewOverlay.java b/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/jso/OrionTextViewOverlay.java
index 794b53679..cd469997b 100644
--- a/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/jso/OrionTextViewOverlay.java
+++ b/plugin-orion/che-plugin-orion-editor/src/main/java/org/eclipse/che/ide/editor/orion/client/jso/OrionTextViewOverlay.java
@@ -10,9 +10,12 @@
*******************************************************************************/
package org.eclipse.che.ide.editor.orion.client.jso;
-import org.eclipse.che.ide.editor.orion.client.Action;
+import elemental.dom.Element;
+
import com.google.gwt.core.client.JavaScriptObject;
+import org.eclipse.che.ide.editor.orion.client.Action;
+
public class OrionTextViewOverlay extends JavaScriptObject {
protected OrionTextViewOverlay() {
@@ -22,6 +25,10 @@ public final native OrionTextViewOptionsOverlay getOptions() /*-{
return this.getOptions();
}-*/;
+ public final native Element getParent() /*-{
+ return this.getOption("parent");
+ }-*/;
+
public final native void setOptions(final OrionTextViewOptionsOverlay newValue) /*-{
this.setOptions(newValue);
}-*/;
@@ -46,6 +53,10 @@ public final native OrionTextModelOverlay getModel() /*-{
return this.getModel();
}-*/;
+ public final native String getText() /*-{
+ return this.getText();
+ }-*/;
+
// selection
public final native OrionSelectionOverlay getSelection() /*-{
@@ -130,6 +141,7 @@ public final native OrionKeyModeOverlay getKeyModes() /*-{
public final native void setAction(String actionId, Action action) /*-{
this.setAction(actionId, function() {
action.@org.eclipse.che.ide.editor.orion.client.Action::onAction()();
+ return true;
});
}-*/;
@@ -156,9 +168,14 @@ public final native void addEventListener(String eventType, EventHandlerNoParame
}-*/;
public final native void addEventListener(String eventType, EventHandler handler, boolean useCapture) /*-{
- this.addEventListener(eventType, function(param) {
+ var func = function (param) {
handler.@org.eclipse.che.ide.editor.orion.client.jso.OrionTextViewOverlay.EventHandler::onEvent(*)(param);
- }, useCapture);
+ };
+ if($wnd.che_handels === undefined){
+ $wnd.che_handels = {};
+ }
+ $wnd.che_handels[handler] = func;
+ this.addEventListener(eventType, func , useCapture);
}-*/;
public final void addEventListener(String type, EventHandlerNoParameter handler) {
@@ -220,7 +237,27 @@ public final native OrionPixelPositionOverlay getLocationAtOffset(int offset) /*
}-*/;
/**
- * Returns the character offset nearest to the given pixel location. The pixel location is relative to the document.
+ * Converts the given rectangle from one coordinate spaces to another.
+ * The supported coordinate spaces are:
+ * "document" - relative to document, the origin is the top-left corner of first line
+ * "page" - relative to html page that contains the text view
+ * All methods in the view that take or return a position are in the document coordinate space.
+ * @return the pixel location
+ */
+ public final native OrionPixelPositionOverlay convert(OrionPixelPositionOverlay rect, String from, String to) /*-{
+ return this.convert(rect, from, to);
+ }-*/;
+
+ /**
+ * Returns the default line height
+ * @return
+ */
+ public final native int getLineHeight() /*-{
+ return this.getLineHeight();
+ }-*/;
+
+ /**
+ * Returns the character offset nearest to the given pixel location. The pixel location is relative to the document.
* @param x the horizontal pixel coordinate
* @param y the vertical pixel coordinate
* @return the text offset
diff --git a/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-compat.css b/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-compat.css
new file mode 100644
index 000000000..76a2c5635
--- /dev/null
+++ b/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-compat.css
@@ -0,0 +1,2433 @@
+/*******************************************************************************
+ * @license
+ * Copyright (c) 2014 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0
+ * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
+ * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+ /*****
+ * Above copyright notice is the verbatim orion one.
+ * This file is orion 'built-codeEdit.css' file where the cm-* classes are commented out
+ *****/
+.textview {
+ background-color: white;
+ font-family: "Consolas", "Monaco", "Vera Mono", monospace;
+ font-size: 12px;
+ min-width: 50px;
+ min-height: 50px;
+}
+.textviewSelection {
+ background: rgb(180, 213, 255);
+}
+.textviewContent ::-moz-selection {
+ background: rgb(180, 213, 255);
+}
+.textviewContent ::selection {
+ background: rgb(180, 213, 255);
+}
+.textviewSelectionUnfocused {
+ background: lightgray;
+}
+.textviewSelectionCaret {
+ background: black;
+}
+.textviewScroll {
+ padding: 4px 2px 4px 2px;
+}
+.textviewContent {
+ cursor: auto;
+}
+.textviewLeftRuler {
+ border-right: 1px solid #eaeaea;
+}
+.textviewRightRuler {
+ border-left: 1px solid #eaeaea;
+}
+.textviewInnerRightRuler {
+ border-left: 1px solid #eaeaea;
+ background-color: white;
+}
+.textviewMarginRuler {
+ border-left: 1px solid #eaeaea;
+}
+.textviewBlockCursor {
+ background: black;
+ opacity: 0.4;
+}
+.ruler {
+}
+.ruler.annotations {
+ width: 16px;
+}
+.ruler.folding {
+ width: 14px;
+}
+.ruler.lines {
+ text-align: right;
+}
+.ruler.overview {
+ width: 14px;
+}
+.ruler.zoom {
+ width: 100px;
+ height: 100%;
+}
+.rulerLines {
+ color: silver;
+}
+.rulerLines.even
+.rulerLines.odd {
+}
+.rulerZoomWindow {
+ background-color: rgba(0, 0, 0, 0.1);
+ margin-left: 1px;
+ border: 1px solid #eee;
+ position: absolute;
+ width: calc(100% - 4px);
+ border-radius: 5px;
+ z-index: 100;
+}
+.textviewZoom {
+ font-size: 2px !important;
+ cursor: pointer;
+}
+.textviewZoom .textviewContent {
+ cursor: pointer;
+}
+.textviewZoom .textviewScroll {
+ padding: 0;
+}
+.textviewZoom .punctuation.separator.tab {
+ background-image: none;
+}
+.textviewZoom .punctuation.separator.space {
+ background-image: none;
+}
+.textviewTooltip {
+ font-family: "Consolas", "Monaco", "Vera Mono", monospace;
+ font-size: 12px;
+ background-color: #325C80;
+ color: #FAFAFA;
+ padding: 8px;
+ border-radius: 3px;
+ z-index: 101;
+ position: fixed;
+ overflow: hidden;
+}
+.tooltipTheme .textviewScroll {
+ padding: 0;
+}
+.tooltipTheme .annotationLine.currentLine {
+ background-color: transparent !important;
+}
+.textviewTooltipCodeProjection {
+ border: 1px solid black !important;
+
+ padding: 0 !important;
+}
+.textviewTooltip a {
+ color: #7CC7FF;
+}
+.textviewTooltip h3 {
+ -webkit-margin-before: 0;
+ margin-top: 0;
+}
+.textviewTooltip p:first-of-type {
+ -webkit-margin-before: 0;
+ margin-top: 0;
+ -webkit-margin-after: 0;
+ margin-bottom: 0;
+}
+.textviewTooltip p {
+ word-wrap: break-word;
+}
+.textviewTooltip multi_anno {
+ font-style: normal;
+ font-weight: bold;
+}
+.textviewTooltip span {
+ vertical-align: baseline;
+}
+.textviewTooltip .tooltipRow {
+ display: table-row;
+}
+.textviewTooltip .tooltipImage {
+ display: inline-block;
+ vertical-align: middle;
+ padding: 1px;
+}
+.textviewTooltip .tooltipTitle {
+ padding-left: 3px;
+ vertical-align: middle;
+}
+.textviewTooltip .hoverTooltipTitle {
+ font-weight: normal;
+}
+.textviewTooltip .commandButton {
+ border: 1px solid #325C80;
+ background-color: inherit;
+ color: white;
+}
+.textviewTooltip .commandButton:not(.dropdownTrigger){
+ text-transform: initial;
+}
+.textViewTooltipOnFocus {
+ resize: both;
+ overflow: auto;
+}
+.textViewTooltipOnHover {
+ overflow: auto;
+}
+
+.textViewFind {
+ background-color: #ddd;
+ position: absolute;
+ top: -50px;
+ right: -1000px;
+ border: 1px solid #aaa;
+ border-top: 0;
+ border-bottom-right-radius: 4px;
+ border-bottom-left-radius: 4px;
+ padding: 2px;
+ z-index: 100;
+}
+.textViewFind.show {
+ top: 0;
+ right: 40px;
+ transition: top 0.3s ease-out;
+ -ms-transition: top 0.3s ease-out;
+ -moz-transition: top 0.3s ease-out;
+ -webkit-transition: top 0.3s ease-out;
+ -o-transition: top 0.3s ease-out;
+}
+.textViewFindButton {
+ margin-right: 1px;
+ margin-left: 0;
+}
+.textViewFindButton:first-child {
+ margin-left: 5px;
+}
+.textViewFindButton:last-child {
+ margin-right: 5px;
+}
+.textViewFindButton.checked {
+ color: blue;
+ text-decoration: underline;
+}
+.textViewReplaceInput {
+}
+.textViewFindInput {
+}
+.textViewFindCloseButton {
+ width: 16px;
+ height: 16px;
+ border-width: 0;
+ background-color: transparent;
+ vertical-align: baseline;
+ background-position: center;
+ background-repeat: no-repeat;
+ background-image: url(data:image/gif;base64,R0lGODlhEAAQAJEAAAAAAP///4CAgP///yH5BAEAAAMALAAAAAAQABAAAAIdnI+py+1vhECSyTluu9px+HkctnSdUh0pxLYuVAAAOw==);
+}
+.contentassist {
+ font-size:12px;
+ display: none;
+ background-color: #303030;
+ position: fixed;
+ top: 100px;
+ left: 100px;
+ z-index:100;
+ cursor: default;
+ min-width: 70px;
+ width: 350px;
+ height: 170px;
+ overflow-x: hidden;
+ overflow-y: auto;
+ white-space: nowrap;
+ border-radius: 5px;
+ box-shadow: rgba(0, 0, 0, 0.3) 2px 2px 10px;
+ /*line-height: 18px;*/
+ resize: both;
+}
+.contentassist:focus {
+ outline: none;
+}
+.contentassist .proposal-emphasis {
+ font-weight: normal;
+}
+.contentassist hr{
+ border: 0;
+ height: 0;
+ border-top: 1px solid rgba(0, 0, 0, 0.1);
+ border-bottom: 1px solid rgba(255, 255, 255, 0.3);
+}
+.contentassist .proposal-noemphasis-keyword {
+ background-color: darkslategrey;
+ color: #CC4C07;
+ font-weight: bold;
+}
+.contentassist .proposal-noemphasis {
+ background-color: darkslategrey;
+ font-weight: lighter;
+ color: black;
+}
+.contentassist .proposal-noemphasis-title-keywords {
+ background-color: darkslategrey;
+ color: #dbdbdb;
+}
+.contentassist .proposal-noemphasis-title {
+ background-color: darkslategrey;
+ color: #dbdbdb;
+ padding-top: 5px;
+}
+.contentassist .proposal-default {
+
+}
+.contentassist .proposal-name {
+ /*font-weight: bold;*/
+}
+.contentassist .selected {
+ background-color: rgb(48, 135, 179);
+ background: linear-gradient(rgb(60, 150, 190), rgb(30, 120, 160));
+ border-radius: 3px;
+ color: white;
+}
+.contentassist .cloneProposal {
+ box-shadow: rgba(0, 0, 0, 0.9) 2px 2px 8px;
+ position: fixed;
+ visibility: visible;
+ z-index: 1000;
+}
+.contentassist .proposalTag {
+ display: inline-block;
+ line-height: 11px;
+ height: 10px;
+ border-radius: 2px;
+ background: #325C80;
+ padding: 2px;
+ margin-right: 3px;
+ text-align: center;
+ color: white;
+}
+.contentassist .iconTagGreen {
+ display: inline-block;
+ font-size: 10px;
+ font-weight: bold;
+ line-height: 13px;
+ height: 12px;
+ width: 12px;
+ border-radius: 50%;
+ background: green;
+ padding: 1px;
+ margin-right: 3px;
+ text-align: center;
+ color: white;
+}
+.contentassist>div {
+ padding: 1px 3px 1px 5px;
+}
+.cloneWrapper {
+ display: block;
+ height: 0;
+ overflow: visible;
+ visibility: hidden;
+ width: 0;
+ z-index: 1000;
+}
+.contentassist.cloneWrapper:hover {
+ overflow: visible;
+}
+.comment {
+ color: #3C802C;
+}
+.constant {
+ color: blue;
+}
+.entity {
+ color: #3f7f7f;
+}
+.invalid {
+ color: red;
+ font-weight: bold;
+}
+.keyword {
+ color: #9F4177;
+ font-weight: bold;
+}
+.storage {
+ color: #7F0055;
+}
+.string {
+ color: #446fbd;
+}
+.support {
+ color: #21439c;
+}
+.variable {
+ color: #0000c0;
+}
+.punctuation.separator.space {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAAXNSR0IArs4c6QAAABVJREFUCNdj3L17938GBgYGJgYoAAAxOAM004kASgAAAABJRU5ErkJggg==");
+ background-repeat: no-repeat;
+ background-position: center center;
+}
+.punctuation.separator.tab {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAFCAYAAABmWJ3mAAAAAXNSR0IArs4c6QAAABtJREFUCNdj2L17938GKEBmYwgQJ0m8IAMDAwDemh/hgxuOkwAAAABJRU5ErkJggg==");
+ background-repeat: no-repeat;
+ background-position: left center;
+}
+.comment-block-documentation {
+ color: #00008F;
+}
+.constant-character-entity {
+ font-style: normal;
+}
+.entity-name-function, .entity-name-type {
+ font-weight: bold;
+ color: #67BBB8;
+}
+.entity-name-tag {
+ color: #98937B;
+}
+.entity-other-attribute-name {
+ color: #3C802C;
+}
+.invalid-illegal {
+ color: white;
+ background-color: red;
+}
+.invalid-deprecated {
+ text-decoration: line-through;
+}
+.keyword-operator {
+ color: #CC4C07;
+ font-weight: bold;
+}
+.meta.annotation.currentLine {
+ background-color: #EAF2FE;
+}
+.meta.tag {
+ color: #3f7f7f;
+}
+.punctuation-definition-comment {
+ color: #3f5fbf;
+}
+.punctuation-definition-string {
+ color: blue;
+}
+.variable-parameter {
+ color: #D1416F;
+}
+.variable-language {
+ color: #7F0055;
+ font-weight: bold;
+}
+/*.cm-meta { color: #00008F; }*/
+/*.cm-keyword { font-weight: bold; color: #7F0055; }*/
+/*.cm-atom { color: #21439c; }*/
+/*.cm-number { color: black; }*/
+/*.cm-def { color: green; }*/
+/*.cm-variable { color: black; }*/
+/*.cm-variable-2 { color: #004080; }*/
+/*.cm-variable-3 { color: #004080; }*/
+/*.cm-property { color: black; }*/
+/*.cm-operator { color: #222; }*/
+/*.cm-comment { color: green; }*/
+/*.cm-string { color: blue; }*/
+/*.cm-error { color: #ff0000; }*/
+/*.cm-qualifier { color: gray; }*/
+/*.cm-builtin { color: #7F0055; }*/
+/*.cm-bracket { color: white; background-color: gray; }*/
+/*.cm-tag { color: #3f7f7f; }*/
+/*.cm-attribute { color: #7f007f; }*/
+
+.annotation {
+}
+.annotation.error,
+.annotation.warning,
+.annotation.task,
+.annotation.bookmark,
+.annotation.breakpoint,
+.annotation.collapsed,
+.annotation.expanded,
+.annotation.currentBracket,
+.annotation.matchingBracket,
+.annotation.currentLine,
+.annotation.matchingSearch,
+.annotation.currentSearch,
+.annotation.readOccurrence,
+.annotation.writeOccurrence,
+.annotation.linkedGroup,
+.annotation.currentLinkedGroup,
+.annotation.selectedLinkedGroup {
+}
+.annotation.blame {
+ color: gray;
+ background-color: rgb(255, 132, 44);
+}
+.annotation.currentBlame {
+ color: black;
+ background-color: rgb(184, 103, 163);
+}
+.annotation.diffAdded {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAaSURBVBhXY5x/KoyBgSHBdCUTkIIAGIuBAQBMsAMD4UOAtwAAAABJRU5ErkJggg==);
+ background-repeat: repeat-y;
+ color: #CCCCCC;
+}
+.annotation.diffModified {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAYAAABWKLW/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAcSURBVBhXYwzdevs/AxCs8lJhYAIxYACJw8AAAIlKBAKlNXzqAAAAAElFTkSuQmCC);
+ background-repeat: repeat-y;
+ color: #CCCCCC;
+}
+.annotation.diffDeleted {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAVSURBVBhXY3growJBDP9hAMb6/x8ADgMVdmD2Og4AAAAASUVORK5CYII=);
+ background-repeat: repeat-x;
+ color: #CCCCCC;
+}
+.lines .annotation.diffAdded {
+ background-image: none;
+ background-color: rgba(159, 202, 86, 0.68);
+ color: #555555;
+}
+.lines .annotation.diffModified {
+ background-image: none;
+ background-color: rgba(85, 181, 219, 0.67);
+ color: #555555;
+}
+.annotationHTML {
+ cursor: pointer;
+ width: 16px;
+ height: 16px;
+ display: inline-block;
+ vertical-align: middle;
+ background-position: center;
+ background-repeat: no-repeat;
+}
+.annotationHTML.error {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjNGNTlDOUMxMUVDNDExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjNGNTlDOUMyMUVDNDExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6M0Y1OUM5QkYxRUM0MTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6M0Y1OUM5QzAxRUM0MTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4Be44kAAAAqklEQVR42mL8//8/AyWAiYFCQLEBLNgEX+aURgGpAiA2gAqdB+KJ4lO6l6GrZUQPA6DmqUAqC4eF04CGZOP0AtRmkOZ/QHwLSeoWVCwLqgZnGORD6TtA7ArEp6DYFSqGrAZrGBhCaTUgXg3EoVD+aqgYshraRON5JD+HQm2GueQWmhqsBkyE0ipAvBuIzaB4N1QMWQ11opERW16ARlU+UoARn5CGXmYCCDAAPz09iI0KJ9QAAAAASUVORK5CYII=");
+}
+.annotationHTML.warning {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkREMTE1OUNDMUVDMjExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkREMTE1OUNEMUVDMjExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6REQxMTU5Q0ExRUMyMTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6REQxMTU5Q0IxRUMyMTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4Kzt/qAAAA0ElEQVR42mL8//8/AyWAiYFCQLEBLLgkfl8obARSZUD8HYiLWQ3652NTx4gtDICao4HUbCDeBRVyBmI3oCHHCRoA1MwOpO4A8V+gBgWo2AMg9QaITYFi/wl5IRaIZYD4K1AjI8gSIBYBYnkg9gLirYQCMRdKc0M1KUDZIFCM1wtAG02B1Ckk+WlQSzKQxLSA3riOywUpaHxHILZHE8vA54VQNL4XFCODaHyB+B6IBZH4s7CE0Ud8LvCHhsFfKN8VihmgYqegavAnpKGVmQACDACxJDv3vmRk+gAAAABJRU5ErkJggg==");
+}
+.annotationHTML.task {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjdEMjg0RkI2MUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjdEMjg0RkI3MUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6N0QyODRGQjQxRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6N0QyODRGQjUxRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6Utm8RAAAAl0lEQVR42mL8//8/AyWAiYFCQLEBLMicqtVRRPmnLXQZIzkuuEuJF04BsTEQ15JjAEizGxB/AmJpYgz4DsTLoewrQOwJ9PNHID0ViDPwBiIURAPxBqjm2UDN74CB2wFkZxKMBSioAOJ9QI1t0JgBaS4nKhqhwAyIdwE1ugLpLHyacRkAM+QcECtTkhKViYlfxqGfmQACDAAjXCa0hW/NdQAAAABJRU5ErkJggg==");
+}
+.annotationHTML.bookmark {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjdEMjg0RkIyMUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjdEMjg0RkIzMUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6N0QyODRGQjAxRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6N0QyODRGQjExRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz54SgjJAAAAuUlEQVR42mL8//8/AyWAiYFCQFsDWrdcMAViY3xqWAhYEADEv4H4LLle8IVinIARORaAzpUHiUG5qkC8C8p2AOKHQPwDhKt9DD7gcoEREJ8H4vtImkHgAFTsKhB743QB1BWyQGo+EDujGb4JiNOBtr/AawDUEH0gdQFNWBGo+QGxgRgEpV8C8SsoO4KUWAAZsAeIDYBYB4g3A3EUwViAOl8Falsb0Mn/kMRTQYYCxe4TDIOhlZkAAgwAunFAhB2QB2cAAAAASUVORK5CYII=");
+}
+.annotationHTML.breakpoint {
+
+ background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAFheoFxkoFxnpmt0pmZxpnF7rYyWwmJwpnaFs3aDrWt8rXGBrYycwmZ3mXuNs42cu77F03GIs3aJrYGVu2J5oKCuxeDj6LK/03GLrYieu3aIoIygu6m4zcLN3MTM1m6Rs2aLriRgkSZilXGXtoGcs7LD0QBLhSZikihol3ScubrO2Yaqu5q4xpO0wpm7yabF0ZO9yaXI0r3X3tHj6P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADQALAAAAAAQABAAAAafQJpwSCwWLYZBIDAwWIw0A+FFpW6aRUPCxe1yE4ahhdCCxWSzmSwGgxGeUceKpUqhUCkVa7UK0wgkJCUjJoUmIyWBBEIEGhoeJ4YmJx6OAUIADQ0QIZIhEJoAQgEUFBUgkiAVpZdRCxIPFx8iIh8XDw4FfhYHDhgZHB0dHBkYEwdwUQoTEc3OEwp+QwYHCBMMDBMIB9JESAJLAk5Q5EVBADs=");
+}
+.annotationHTML.collapsed {
+
+ width: 14px;
+ height: 14px;
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAWBJREFUeNpi/P//PwMlgImBQkCxASzoAp++fo+6de+Z+fXbD/Jev/nAICoiwKCpqrBBTUlqNR835zJ09YzIYfDxy7eo/cevLmXlYGNQUJAEahZieP3mHcODB08Zfv/4w+BoqR3Nz8O1DKcXzt94HPqXmZlBU1+LgZNfkMHazIOBA0hr6uswgMTP33gYijcMLlx/EMAnLs7w7sc/hg9AG0HgPZB+B8S84hJA+UcBeMPg+at3DJIMnAxZzt5wsUhnXzDdsmIVWB6vAcLCfAys3z4wzN64huEfkJ/uH8IwexOQDQymD2/fgeXxekFLRWHD51evGDhZGRi4WSFSnCwgNjB2Xr1m0AbK4zXAQkdhNdPf3wx3r91g+PruLcOqnasYvn54x3Dv2k0G5r+/GMyB8nijEQTefvoadeH6w9Cbtx8GvH//kUFQkJ9BQ1V+g76m/GphPu5lBA0YenmBYgMAAgwA34GIKjmLxOUAAAAASUVORK5CYII=");
+}
+.annotationHTML.expanded {
+
+ width: 14px;
+ height: 14px;
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAT5JREFUeNrUksFKw0AURW+mTWw67SSEiG209U90r4jddFO34l+5U0HdZCHiFwiCOz9AlMSmGEpMOqk1TWJSFGyFbATR2dyZd+Dw3mOENE3xkyP8PYHrBT3OX7uW43ZefA6FUaw1dJPSyrmu1k8KBYOh37Od4XFZLEPXFdRrFMGIw3U9TKMYqw1tb0VjcxLy9eEF425CCIxWE5JcxSQGxCyNloG87gXhwWIHc4J767lTZQw8ShFGSZbxRyaQmZJxd3NRUJ6ffwQNEi6PzG/L2tjdmvFCgcKqKL2F2Olu43MzggDka+IjPuOFI7Sbujn2fUglYKkkzFIi+R0I/QDrGS8UqDX5QkhiOHYfE84hkhSTkGNgOyDJFCzjhYLTq+vDtrG8r1LZtB6fcHtzB+uhD5VWzLx+lvF/8JV/XfAuwADsrJbMGG4l4AAAAABJRU5ErkJggg==");
+}
+.annotationHTML.multiple {
+
+ background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAOdpa+yJiuFYXOFYXeBYXONwded8f+NwdmhwkHB4iPr7/ezx+fP2+2h4kOzy+Wh4iPr8/gCBwTaczjaXyjaYyjaXyTaYyfr8/QCMzQCMzACHxzao2jal2Dak1zag03iAgI/Ckn64fZrHmX+4fZLCianPopPCiarOoqbLlafLlbnXq7nWq6fLlMTcsoCIeJCQcIiIeKCYaJiQcO16ee16evGVlfGWlfahn/ahoPWhn/WhoPe1tP///////wAAAAAAACH5BAEAAD0ALAAAAAAQABAAAAaRwJ5wSCwaj8WYcslcDmObaDTGq1Zjzw4mk+FQIRcFTzaUeTRoj4zHaI+HL0lkLnnxFgsH7zWEWSoTFBMwVlUwQy6JMDCJjYwuQx8tk5MfOzk4OjcfkSssKCkqHzY0MzQ1nEIJJSYkJCcJAQCzAQlDDyIjISMiCQYEAgMGD0MNIMfHDQUHBc3EQgjR0tPSSNY9QQA7");
+}
+.annotationHTML.overlay {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJEAQvB2JVdrAAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAAD1JREFUCNdtjkESADAEAzemf69f66HMqGlOIhYiFRFRtSQBWAY7mzx+EDTL6sSgb1jTk7Q87rxyqe37fXsAa78gLyZnRgEAAAAASUVORK5CYII=");
+ background-position: right bottom;
+ position: relative;
+ top: -16px;
+}
+.annotationHTML.currentBracket {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gobFRYVQuAvZwAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAABnSURBVDjLtVJBDsAgCCuNT/L/L9if2GUHthUTRUlItEmBUoAtccFXqawWYXUSDuR4SAjMAaD9CnTY8zLR0MYTdEk668I3Ms3Zv347rEpmdV8taFN2+QsTy2YgxITApc3zEpZvJdnFDZs2IdfwZr8PAAAAAElFTkSuQmCC");
+}
+.annotationHTML.matchingBracket {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gobFRYVQuAvZwAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAABnSURBVDjLtVJBDsAgCCuNT/L/L9if2GUHthUTRUlItEmBUoAtccFXqawWYXUSDuR4SAjMAaD9CnTY8zLR0MYTdEk668I3Ms3Zv347rEpmdV8taFN2+QsTy2YgxITApc3zEpZvJdnFDZs2IdfwZr8PAAAAAElFTkSuQmCC");
+}
+.annotationHTML.currentLine {
+
+ background-image: url("data:image/gif;base64,R0lGODlhEAAQAMQAALxe0bNWzbdZzrlb0KpPx61RybBTy6VLxadNxZGctIeUroyYsG92hHyMqIKRq2l9nmyAoHGDonaIpStXj6q80k1aXf///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABYALAAAAAAQABAAAAVCoCWOZGmeKDql5ppOMGXBk/zOoltSNO6XrlXwxIPNYiMGq8SoLC2MaNPygEQkDYdikUg6LQcEoWAICAaA5HPNLoUAADs=");
+}
+.annotationHTML.matchingSearch {
+
+ background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAALClrLu1ubOpsKqdp6eapKufqMTAw7attLSrsrGnr62jq8C7v765vaebpb22vLmyuMbCxsnGycfEx8G+wcrIysTBxUltof//yf///v70jergpPvws+nWc/npqvrpqvrpq/raffffnvXVkfTVkvXUkd+9f+SiOemvV+uyXa2OX7mYZqeIXKuNX/ClO7KQYqiIXJ59Vp19VpFvTo9uTZBvTpNyUJNyUf///////wAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADgALAAAAAAQABAAAAZ4QJxwSCwajS2aS1U6DlunzcagcuKgG4sn5HJiLZ2QiHbEbj6hEapVTKVYr3OItG5TIhVGLF0npigUEAsPAjV9Q24pEhMBCAoybEUmGRcrDgcAAzNGkxcYNzAJBQSbRJ0YqBc2DaVEHJ6pGTStRBqfGBcZILRWvThBADs=");
+}
+.annotationHTML.currentSearch {
+
+ background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAALClrLu1ubOpsKqdp6eapKufqMTAw7attLSrsrGnr62jq8C7v765vaebpb22vLmyuMbCxsnGycfEx8G+wcrIysTBxUltof//yf///v70jergpPvws+nWc/npqvrpqvrpq/raffffnvXVkfTVkvXUkd+9f+SiOemvV+uyXa2OX7mYZqeIXKuNX/ClO7KQYqiIXJ59Vp19VpFvTo9uTZBvTpNyUJNyUf///////wAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADgALAAAAAAQABAAAAZ4QJxwSCwajS2aS1U6DlunzcagcuKgG4sn5HJiLZ2QiHbEbj6hEapVTKVYr3OItG5TIhVGLF0npigUEAsPAjV9Q24pEhMBCAoybEUmGRcrDgcAAzNGkxcYNzAJBQSbRJ0YqBc2DaVEHJ6pGTStRBqfGBcZILRWvThBADs=");
+}
+.annotationHTML.readOccurrence {
+
+ background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAP3ykf3zn/7lIv7kI/fbI/7nRf7scLe0oMXDtfXXHsG4gaKdgOXBF+rIJqKdhaijjNWxHeLBL6GafLuYJpmQcvvdg5OHZpyRcJ+UdLavm4+BXqGWeYZ1TYx7VZ6QcJ2NbI+Ebv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACEALAAAAAAQABAAAAZewJBwSCwaj0KMBFlULphDJwIakh6gGckCcXgyLxjuYol0PA6YMQbZqFAOhw/Gc2wHABaJhAMy2gEGBRoSHRtFf4ECDRpGERV3iQ0TRwyQBQSSRAmbAwEMnxAQClRQQQA7");
+}
+.annotationHTML.writeOccurrence {
+
+ background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAP3ykf3zn/7lIv7kI/fbI/7nRf7scLe0oMXDtfXXHsG4gaKdgOXBF+rIJqKdhaijjNWxHeLBL6GafLuYJpmQcvvdg5OHZpyRcJ+UdLavm4+BXqGWeYZ1TYx7VZ6QcJ2NbI+Ebv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACEALAAAAAAQABAAAAZewJBwSCwaj0KMBFlULphDJwIakh6gGckCcXgyLxjuYol0PA6YMQbZqFAOhw/Gc2wHABaJhAMy2gEGBRoSHRtFf4ECDRpGERV3iQ0TRwyQBQSSRAmbAwEMnxAQClRQQQA7");
+}
+.annotationHTML.blame {
+ float: left;
+}
+.annotationHTML.currentBlame {
+ float: left;
+}
+.annotationHTML.blame.single {
+ width: 32px;
+ height: 32px;
+}
+.annotationHTML.currentBlame.single {
+ width: 32px;
+ height: 32px;
+}
+.annotationHTML.diffAdded {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAaSURBVBhXY5x/KoyBgSHBdCUTkIIAGIuBAQBMsAMD4UOAtwAAAABJRU5ErkJggg==);
+ background-repeat: repeat-y;
+ background-position: left top;
+}
+.annotationHTML.diffDeleted {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAVSURBVBhXY3growJBDP9hAMb6/x8ADgMVdmD2Og4AAAAASUVORK5CYII=);
+ background-repeat: repeat-x;
+ background-position: left top;
+}
+.annotationHTML.diffModified {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAYAAABWKLW/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAcSURBVBhXYwzdevs/AxCs8lJhYAIxYACJw8AAAIlKBAKlNXzqAAAAAElFTkSuQmCC);
+ background-repeat: repeat-y;
+ background-position: left top;
+}
+.annotationOverview {
+ cursor: pointer;
+ border-radius: 2px;
+ left: 2px;
+ width: 8px;
+}
+.annotationOverview.task {
+ background-color: #93bb7a;
+ border: 1px solid #79aa59;
+}
+.annotationOverview.breakpoint {
+ background-color: lightblue;
+ border: 1px solid blue;
+}
+.annotationOverview.bookmark {
+ background-color: #84b3cf;
+ border: 1px solid #9cc2d8;
+}
+.annotationOverview.error {
+ background-color: #EFA1A7;
+ border: 1px solid #ec8a91;
+}
+.annotationOverview.warning {
+ background-color: #fce1a9;
+ border: 1px solid #face70;
+}
+.annotationOverview.currentBracket {
+ background-color: #00cc00;
+ border: 1px solid #00aa00;
+}
+.annotationOverview.matchingBracket {
+ background-color: #00cc00;
+ border: 1px solid #00aa00;
+}
+.annotationOverview.currentLine {
+ background-color: #EAF2FE;
+ border: 1px solid black;
+}
+.annotationOverview.matchingSearch {
+ background-color: #C3E1FF;
+ border: 1px solid #afcae5;
+}
+.annotationOverview.currentSearch {
+ background-color: #53D1FF;
+ border: 1px solid #42a7cc;
+}
+.annotationOverview.readOccurrence {
+ background-color: lightgray;
+ border: 1px solid black;
+}
+.annotationOverview.writeOccurrence {
+ background-color: Gold;
+ border: 1px solid darkred;
+}
+.annotationOverview.currentBlame {
+ background-color: rgb(184, 103, 163);
+ border: 1px solid black;
+}
+.annotationOverview.diffAdded {
+ background-color: rgba(159, 202, 86, 0.52);
+ border: 1px solid black;
+}
+.annotationOverview.diffDeleted {
+}
+.annotationOverview.diffModified {
+ background-color: rgba(85, 181, 219, 0.61);
+ border: 1px solid black;
+}
+.annotationRange {
+ background-repeat: repeat-x;
+ background-position: left bottom;
+}
+.annotationRange.task {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sLDhEoIrb7JmcAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAGUlEQVQI12NggIH/DGdhDCM45z/DfyiBAADgdQjGhI/4DAAAAABJRU5ErkJggg==");
+}
+.annotationRange.breakpoint {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sLDhEqHTKradgAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAIklEQVQI11XJMQ0AMAzAMGMafwrFlD19+sUKIJTFo9k+B/kQ+Qr2bIVKOgAAAABJRU5ErkJggg==");
+}
+.annotationRange.bookmark {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=");
+}
+.annotationRange.error {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==");
+}
+.annotationRange.warning {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=");
+}
+.annotationRange.currentBracket {
+ background-color: #00FE00;
+}
+.annotationRange.matchingBracket {
+ background-color: #00FE00;
+}
+.annotationRange.readOccurrence {
+ background-color: lightgray;
+}
+.annotationRange.writeOccurrence {
+ background-color: yellow;
+}
+.annotationRange.matchingSearch {
+ background-color: #C3E1FF;
+}
+.annotationRange.currentSearch {
+ background-color: #53D1FF;
+}
+.annotationRange.linkedGroup {
+ outline: 1px solid grey;
+}
+.annotationRange.currentLinkedGroup {
+ background-color: #C3E1FF;
+}
+.annotationRange.selectedLinkedGroup {
+ background-color: #53D1FF;
+}
+.annotationLine {
+}
+.annotationLine.currentLine {
+ background-color: #EAF2FE;
+}
+
+.headerLayout {
+ height: 60px;
+}
+.toolbarLayout {
+ height: 50px;
+
+ display: -webkit-box;
+ display: -moz-box;
+ display: -ms-flexbox;
+ display: -webkit-flex;
+ display: flex;
+ flex-direction: row;
+ -ms-flex-direction: row;
+ -webkit-flex-direction: row;
+ -webkit-align-items: center;
+ align-items: center;
+}
+.fsToolbarLayout {
+ height: 30px;
+}
+.bannerLeftArea{
+
+ -ms-flex: 1 6 20%;
+ -moz-box-ordinal-group: 1;
+ -webkit-order: 1;
+ -ms-flex-order: 1;
+ order: 1;
+ -moz-box-flex: 1;
+ -webkit-box-flex:1;
+ -webkit-box-ordinal-group: 1;
+
+ width: 20%;
+
+ padding-left:5px;
+}
+.bannerMiddleArea{
+ -ms-flex: 3 1 60%;
+
+ -webkit-order: 2;
+ -ms-flex-order: 2;
+ order: 2;
+ -moz-box-flex: 1;
+ -moz-box-ordinal-group: 2;
+
+ -webkit-box-flex:1;
+ -webkit-box-ordinal-group: 2;
+ width: 60%;
+}
+@media only screen and (device-width: 768px) {
+
+
+ .bannerMiddleArea{
+ -ms-flex: 3 1 60%;
+
+ -webkit-order: 2;
+ -ms-flex-order: 2;
+ order: 2;
+ -moz-box-flex: 1;
+ -moz-box-ordinal-group: 2;
+
+ -webkit-box-flex:1;
+ -webkit-box-ordinal-group: 2;
+ width: 59%;
+ }
+
+}
+.bannerRightArea{
+ -ms-flex: 1 6 20%;
+ -moz-box-ordinal-group: 3;
+ -webkit-order: 3;
+ -ms-flex-order: 3;
+ order: 3;
+ -moz-box-flex: 1;
+
+ -webkit-box-flex:1;
+ -webkit-box-ordinal-group: 3;
+ width: 20%;
+ padding-right:5px;
+}
+.content-fixedHeight {
+ clear: both;
+ overflow: hidden;
+ position: absolute;
+ top: 0;
+
+ bottom: 0;
+ left: 50px;
+ right: 0;
+ background: #3b4b54;
+
+}
+.content-fixedHeight-animation {
+ transition: left 0.3s ease;
+}
+.content-fixedHeight-maximized {
+ top: 0;
+ bottom: 0;
+}
+.content-sideMenu-closed {
+ left: 0;
+}
+.content-fluid {
+}
+.footer-fixed-bottom {
+ position: fixed;
+ bottom: 0;
+ z-index: 50;
+ right: 0;
+ left: 0;
+
+ height: 0;
+ background:#ededed;
+}
+.layoutBlock {
+ clear: both;
+ margin: 0;
+
+ padding: 4px 4px 0 4px;
+ vertical-align: baseline;
+}
+.layoutLeft {
+ float: left;
+ margin: 0;
+}
+.layoutRight {
+ float: right;
+ margin: 0;
+}
+.layoutFlexStretch {
+ flex: 1 1;
+ -ms-flex: 1 1;
+ -webkit-flex: 1 1;
+}
+.spacingLeft {
+ margin-left: 5px;
+}
+.spacingRight {
+ margin-right: 5px;
+}
+.clear {
+ clear: both;
+}
+.hidden {
+ visibility: hidden;
+}
+.sidePanelLayout {
+ display: block;
+ position: absolute;
+ left: 0;
+ width: 33%;
+ height: 100%;
+}
+.generalAnimation {
+ -webkit-transition: all 0.5s ease;
+ -moz-transition: all 0.5s ease;
+ -o-transition: all 0.5s ease;
+ transition: all 0.5s ease;
+ z-index: 50;
+ overflow: auto;
+}
+.sidePanelLayoutAnimation {
+ -webkit-transition: width 0.5s ease;
+ -moz-transition: width 0.5s ease;
+ -o-transition: width 0.5s ease;
+ transition: width 0.5s ease;
+ z-index: 50;
+ overflow: auto;
+}
+.sidePanelVerticalLayout {
+ display: block;
+ position: absolute;
+ top: 0;
+ height: 33%;
+ width: 100%;
+}
+.sidePanelVerticalLayoutAnimation {
+ -webkit-transition: height 0.5s ease;
+ -moz-transition: height 0.5s ease;
+ -o-transition: height 0.5s ease;
+ transition: height 0.5s ease;
+ z-index: 50;
+ overflow: auto;
+}
+.sidePanelMargins {
+ margin-left: 8px;
+ margin-top: 2px;
+ margin-bottom: 8px;
+ width: auto;
+}
+.mainPanelLayout {
+ display: block;
+ position: absolute;
+ right: 0;
+ height: 100%;
+}
+.mainPanelLayoutAnimation {
+ -webkit-transition: left 0.5s ease;
+ -moz-transition: left 0.5s ease;
+ -o-transition: left 0.5s ease;
+ transition: left 0.5s ease;
+}
+.mainPanelVerticalLayout {
+ display: block;
+ position: absolute;
+ bottom: 0;
+ width: 100%;
+}
+.mainPanelVerticalLayoutAnimation {
+ -webkit-transition: top 0.5s ease;
+ -moz-transition: top 0.5s ease;
+ -o-transition: top 0.5s ease;
+ transition: top 0.5s ease;
+}
+.fixedToolbarHolder {
+ position: relative;
+ left: 0;
+ top: 0;
+ height: 100%;
+ width: 100%;
+ min-width:140px;
+ background:#3b4b54;
+}
+.sidebarWrapper {
+ overflow-x: auto;
+ overflow-y: hidden;
+ min-width: 0;
+}
+.sidebarWrapper > .sidebar {
+ position: relative;
+ left: 0;
+ top: 0;
+ height: calc(100% - 29px);
+ overflow-x: visible;
+}
+.projectNavSidebarWrapper > .sidebar {
+ height: calc(100% - 0px);
+}
+.workingTarget {
+ position: absolute;
+ top: 0;
+ width: 100%;
+ bottom: 0;
+ overflow-y: auto;
+ background:white;
+}
+.toolbarTarget {
+ position: absolute;
+ top: 50px;
+ width: 100%;
+ overflow-y: auto;
+}
+.toolbarTarget-toolbarHidden {
+ top: 0;
+}
+.pageLayoutTarget {
+ position: absolute;
+ width: calc( 100% - 60px );
+ bottom: 0;
+ overflow-y: auto;
+ box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.33);
+ margin: 20px;
+ margin-right: 0;
+ padding-top: 10px;
+ padding-bottom: 5px;
+ background: white;
+}
+.hasSplit {
+ display: none;
+}
+.editorViewerFrame {
+ width: 100%;
+ height: 100%;
+}
+.editorViewerHeader {
+ display:flex;
+ background: #3B4B54;
+ color: white;
+ flex-direction:row;
+ align-items:center;
+ line-height:26px;
+ border-bottom: 1px solid #263238;
+}
+.editorViewerHeaderDirtyIndicator {
+ padding-left: 5px;
+}
+.editorViewerHeaderTitle {
+ padding-left: 5px;
+}
+.editorViewerContent {
+ position: absolute;
+ width: 100%;
+ top: 27px;
+ bottom: 0;
+ overflow: auto
+}
+.editorViewerPicInPic {
+ position: absolute;
+ border: 1px solid #ccc;
+ background-color: white;
+ z-index: 100;
+ bottom: 35px;
+ right: 35px;
+ width: 40%;
+ height: 40%;
+}
+.splitLayout {
+ position: absolute;
+ left: 33%;
+ height: 100%;
+ z-index: 51;
+ width: 3px;
+ cursor: e-resize;
+ visibility: hidden;
+}
+.splitVerticalLayout {
+ position: absolute;
+ top: 33%;
+ width: 100%;
+ z-index: 51;
+ height: 3px;
+ cursor: n-resize;
+ visibility: hidden;
+}
+@media only screen
+and (min-device-width : 768px)
+and (max-device-width : 1024px) {
+
+ .splitLayout {
+ position: absolute;
+ left: 33%;
+ height: 100%;
+ z-index: 50;
+ width: 20px;
+ cursor: e-resize;
+ visibility: hidden;
+ }
+
+
+ .splitVerticalLayout {
+ position: absolute;
+ top: 33%;
+ width: 100%;
+ z-index: 50;
+ height: 20px;
+ cursor: n-resize;
+ visibility: hidden;
+ }
+
+}
+.splitThumbLeftLayout {
+ position: absolute;
+ left: 100%;
+ height: 4em;
+ width: 4px;
+ top: calc(50% - 2em);
+ margin-left: -1px;
+ cursor: pointer;
+ border-top-right-radius: 5px;
+ border-bottom-right-radius: 5px;
+}
+.splitThumbRightLayout {
+ position: absolute;
+ right: 100%;
+ height: 4em;
+ width: 4px;
+ top: calc(50% - 2em);
+ margin-right: -1px;
+ cursor: pointer;
+ border-top-left-radius: 5px;
+ border-bottom-left-radius: 5px;
+}
+.splitVerticalThumbUpLayout {
+ position: absolute;
+ top: 100%;
+ width: 4em;
+ height: 4px;
+ left: calc(50% - 2em);
+ margin-top: -1px;
+ cursor: pointer;
+ border-bottom-left-radius: 5px;
+ border-bottom-right-radius: 5px;
+}
+.splitVerticalThumbDownLayout {
+ position: absolute;
+ bottom: 100%;
+ width: 4em;
+ height: 4px;
+ left: calc(50% - 2em);
+ cursor: pointer;
+ border-top-left-radius: 5px;
+ border-top-right-radius: 5px;
+}
+.splitLayoutAnimation {
+ -webkit-transition: left 0.5s ease;
+ -moz-transition: left 0.5s ease;
+ -o-transition: left 0.5s ease;
+ transition: left 0.5s ease;
+}
+.splitVerticalLayoutAnimation {
+ -webkit-transition: top 0.5s ease;
+ -moz-transition: top 0.5s ease;
+ -o-transition: top 0.5s ease;
+ transition: top 0.5s ease;
+}
+.panelTracking {
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ overflow: auto;
+}
+.commandList {
+ padding: 0;
+ margin-left: 0;
+ margin-right: 0;
+ list-style-type: none;
+ vertical-align: baseline;
+}
+.commandList > li {
+ float: left;
+ margin-left: 4px;
+ margin-right: 4px;
+}
+.commandMargins {
+ margin-left: 4px !important;
+ margin-right: 4px !important;
+}
+.commandMargins:last-child {
+ margin-right: 0 !important;
+}
+.sideMenu{
+ width: 50px;
+ background: #26343F;
+ float: left;
+ position: absolute;
+ top: 0;
+
+ bottom: 0;
+ -webkit-animation: slide 0.5s forwards;
+ -webkit-animation-delay: 2s;
+ animation: slide 0.5s forwards;
+ animation-delay: 2s;
+ display:block;
+ margin:0;
+ font-family: sans-serif;
+ font-size:10px;
+ text-decoration:none !important;
+ user-select: none;
+ -webkit-user-select: none;
+ -moz-user-select: -moz-none;
+}
+.sideMenu.animating {
+ z-index: 0;
+}
+.sideMenu-maximized {
+ top: 0;
+ bottom: 0;
+}
+.sideMenu-closed {
+ width: 0;
+ display: none;
+}
+.sideMenuHome{
+ width: 100%;
+ height: 50px;
+}
+.sideMenuList{
+ display:inline-block !important;
+ height: calc(100% - 64px);
+ margin: 0;
+ overflow-y: hidden;
+ padding: 0;
+ text-align: center;
+ width: 100%;
+}
+.sideMenuItem{
+ list-style-type: none;
+ font-size:16px !important;
+ padding: 0;
+ margin: 3px;
+}
+.sideMenuItem:hover, .sideMenuItem.expanded {
+ text-decoration:none;
+ color:#F47D64 !important;
+}
+.sideMenu:hover > .sideMenuScrollButton {
+ opacity: 1;
+}
+.sideMenuScrollButton {
+ background-color: rgba(0,0,0,0.5) !important;
+ color: white !important;
+ cursor: pointer;
+ display: none;
+ height: 19px;
+ opacity: 0.5;
+ position: absolute;
+ width: 100%;
+ z-index: 100;
+}
+.sideMenuScrollButton.visible {
+ display: block;
+}
+.sideMenuTopScrollButton {
+ -webkit-transform: rotate(180deg);
+ transform: rotate(180deg);
+}
+.sideMenuBottomScrollButton {
+ bottom: 0;
+ left: 0;
+}
+.sideMenuItem > .submenu-trigger {
+ color: #6D8B93 !important;
+ font-size:16px;
+ text-decoration:none !important;
+ width: 100%;
+ display: inline-block;
+ padding: 9px 0px 12px 0px;
+}
+.sideMenuItem>.submenu-trigger:hover, .sideMenuItem.expanded>.submenu-trigger{
+ text-decoration:none;
+ color:white !important;
+}
+.sideMenuItemActive {
+}
+.sideMenuItemActive > .submenu-trigger {
+ color: white !important;
+}
+.sideMenuToggle {
+ display: none;
+}
+.sideMenu-notification {
+ position: relative;
+}
+.sideMenu-notification[level=info] {
+ background-image: radial-gradient(#1EB3DC, #1EB3DC 2px, transparent 3px);
+ background-size: 6px 6px;
+ background-repeat: no-repeat;
+ background-position: 30px 29px;
+}
+.sideMenu-notification[level=warn] {
+ background-image: radial-gradient(#FFFF66, #FFFF66 2px, transparent 3px);
+ background-size: 6px 6px;
+ background-repeat: no-repeat;
+ background-position: 30px 29px;
+}
+.sideMenu-notification[level=error] {
+ background-image: radial-gradient(#FF0000, #FF0000 2px, transparent 3px);
+ background-size: 6px 6px;
+ background-repeat: no-repeat;
+ background-position: 30px 29px;
+}
+.sideMenuSubMenu{
+ display: none;
+ list-style-type:none;
+ position:absolute;
+ font-family:sans-serif;
+ padding-left: 0;
+ z-index:100;
+ text-align: left;
+ left: 40px;
+}
+.sideMenuSubMenuItem{
+ display: inline-block;
+ width: 100%;
+ white-space: nowrap;
+ font-size: 12px;
+ background: white;
+ border-right:1px solid #ddd;
+}
+.sideMenuSubMenuItem:before {
+ width: 0;
+ height: 0;
+ top: 13px;
+ content: "";
+ left: -8px;
+ position: absolute;
+ z-index: 200;
+ border-top: 8px solid transparent;
+ border-bottom: 8px solid transparent;
+ border-right: 8px solid white;
+}
+.sideMenuSubMenuItem:first-child{
+ border-top:1px solid #ddd;
+ border-top-right-radius: 4px;
+}
+.sideMenuSubMenuItem:last-child{
+ border-bottom:1px solid #ddd;
+ border-bottom-right-radius: 4px;
+}
+.sideMenuSubMenuItem a {
+ display: inline-block;
+ color: #444;
+ padding: 12px 30px 12px 10px;
+ width: calc(100% - 30px - 10px + 8px);
+}
+.sideMenuSubMenuItem a:hover{
+ text-decoration:none;
+ color: black !important;
+}
+
+.sideMenuSubMenuItem:hover {
+ background-color: #fde7cf;
+}
+.sideMenuSubMenuItem:only-child:hover {
+
+}
+.sideMenuSubMenuItem:only-child:hover a {
+ color: #333;
+}
+.sideMenuSubMenuItem a span {
+ display: inline-block;
+}
+.sideMenuItem:hover .sideMenuSubMenu, .sideMenuSubMenu.expanded {
+ display:inline-block;
+}
+.sidebar-decorate-active {
+ position: relative;
+ background:
+ radial-gradient(#1EB3DC, #1EB3DC 2px, #47575F 3px) no-repeat,
+ #47575F;
+ background-position:
+ 30px 29px,
+ 0 0;
+ background-size:
+ 8px 8px;
+}
+.mainContent{
+ position:absolute;
+ left:50px;
+}
+.innerPanels{
+ position:absolute;
+ width:100%;
+ top:50px;
+ bottom:0;
+}
+.userMenu {
+}
+.splash {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ background-color: rgb(38,52,63);
+ z-index: 1000;
+ display: block;
+}
+.splashSeeThrough {
+ -webkit-animation-name: splashSeeThrough;
+ animation-name: splashSeeThrough;
+ animation-duration: 0.7s;
+ background-color: rgba(38,52,63, 0.7);
+}
+@-webkit-keyframes splashSeeThrough {
+ from {background-color: rgb(38,52,63);}
+ to {background-color: rgba(38,52,63, 0.7);}
+}
+@keyframes splashSeeThrough {
+ from {background-color: rgb(38,52,63);}
+ to {background-color: rgba(38,52,63, 0.7);}
+}
+.splashContainer {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ height:100%;
+ flex-direction: column;
+ font-family: sans-serif;
+ font-size: 14px;
+}
+.splashLoader {
+ display: flex;
+ height:300px;
+ width:400px;
+ flex-direction: column;
+ align-items: center;
+ background-color: rgb(57,75,84);
+ padding: 20px;
+ padding-top: 60px;
+ padding-bottom: 0px;
+ border-radius: 4px;
+ box-shadow: 5px 5px 5px 0 rgba(0,0,0,0.2);
+ border-bottom: 1px solid rgb(59,222,255);
+}
+.splashAbout {
+ text-align: center;
+ color: #FFFFFF;
+ font-size:16px;
+ font-family: 'helvetica';
+ font-weight: bold;
+ margin-bottom: 10px;
+}
+.splashSteps {
+ margin:20px;
+ max-width: 200px;
+}
+.splashStep {
+ display: flex;
+ flex-direction: row;
+ width:400px;
+ padding-top: 10px;
+ padding-bottom:10px;
+ height:24px;
+}
+.splashVisual {
+ width: 24px;
+}
+.splashVerbal {
+ margin-left:20px;
+ color: #3BDEFF;
+ font-family: 'helvetica';
+ font-weight: bold;
+ margin-top: 3px;
+}
+.splashVerbalwaiting {
+ color:grey;
+}
+.splashLoadingImage {
+ background: url(../../images/loading_24.gif) no-repeat top left;
+ vertical-align: middle;
+ display: inline-block;
+ border: none;
+ height:24px;
+ width:24px;
+}
+.splashSuccessImage {
+ background: url(../../images/message_success_24.png) no-repeat top left;
+ vertical-align: middle;
+ display: inline-block;
+ border: none;
+ height:24px;
+ width:24px;
+}
+.orionPage {
+ background-color: #26343F;
+ width: 100%;
+ height: 100%;
+}
+.topRowBanner {
+ margin: 0;
+ border: 0;
+ display: -moz-box;
+ display: -ms-flexbox;
+ display: -webkit-flex;
+ display: flex;
+ border-top-width: 0px;
+ border-right-width: 0px;
+ border-left-width: 0px;
+ border-bottom-style: none;
+ background-color: white;
+ height: 16px;
+ padding: 8px 2px 7px 6px !important;
+ box-shadow: rgba(0, 0, 0, 0.0980392) 0px 2px 2px 0px, rgba(0, 0, 0, 0.0980392) 0px 1px 0px 0px;
+ z-index: 100;
+ display: none;
+}
+a {
+ text-decoration: none;
+ color: #00AED1;
+}
+a:hover {
+ cursor: pointer;
+ text-decoration: underline;
+}
+.primaryNav {
+ font-size: 8pt;
+ font-weight: normal;
+ color: #BFBFBF;
+ vertical-align: baseline;
+}
+.primaryNav > div {
+ padding-top: 6px;
+}
+.primaryNav > nav {
+ padding-top: 6px;
+}
+.primaryNav > nav > a {
+ color: #BFBFBF;
+ margin-right: 6px;
+ margin-left: 6px;
+ text-decoration: none;
+}
+.primaryNav > nav > a:hover, .primaryNav span.dropdownTrigger:hover {
+ cursor: pointer;
+ color: white;
+}
+.titleArea {
+ margin: 0;
+ padding-top: 3px;
+ border: 0;
+ background: #EFEFEF;
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#EFEFEF), color-stop(100%,#EFEFEF));
+ border-bottom: 1px solid #DEDEDE;
+ min-height: 20px;
+}
+.checkedRow {
+ color: white !important;
+ background-color: #1bb199 !important;
+}
+.checkedRow.disabledRow {
+ background-color: #dadada !important;
+}
+.checkedRow > td > span > a
+{
+ color:white !important;
+}
+.checkedRow > td > span > span
+{
+ color:white !important;
+}
+.checkedRow > td > span > a > span
+{
+ color:white !important;
+}
+.checkedRow > td > a > span > span
+{
+ color:white !important;
+}
+.checkedRow .secondaryColumn {
+ color: white;
+}
+.checkedRow .navColumnNoIcon {
+ color: white;
+}
+.checkedRow .secondaryColumn > a:hover {
+ color: white !important;
+ font-weight:bold;
+ text-decoration: none;
+}
+.checkedRow .sectionTableItem {
+ color: white !important;
+}
+.checkedRow a {
+ color: white;
+}
+.checkedRow .jazz-description {
+ color: white;
+}
+.checkedRow .commandButton {
+ color: white;
+ border-color: white;
+}
+.checkedRow .commandImage {
+ color: white;
+}
+.navRow > td:first-child {
+
+}
+.navRow.checkedRow > td:first-child {
+ border-left-color: #d57152;
+}
+.navbar-item-selected {
+ color: #FFFFFF !important;
+ font-weight: bold;
+ position: relative;
+ background: #1bb199 !important;
+}
+.breadcrumbContainer {
+ align-items: baseline;
+ display: inline-flex;
+ justify-content: center;
+
+ -webkit-align-items: baseline;
+ display: -webkit-inline-flex;
+ -webkit-justify-content: center;
+
+ margin-right: 0;
+ overflow: hidden;
+ visibility: visible;
+ width: 100%;
+}
+.breadcrumb {
+ color: #E6E6E6;
+ -webkit-flex-grow: 0;
+ flex-grow: 0;
+ font: 9pt;
+ font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue",
+ Helvetica, Tahoma, Geneva, Arial, "Lucida Grande", sans-serif;
+ overflow: hidden;
+ text-decoration: none;
+ text-overflow: ellipsis;
+}
+a.breadcrumb:hover {
+ text-decoration: none;
+ border-bottom: 1px dotted;
+ color: #00AED1;
+ cursor: pointer;
+}
+.breadcrumbSeparator {
+ color: #E6E6E6;
+ font-size: 9pt;
+ font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue",
+ Helvetica, Tahoma, Geneva, Arial, "Lucida Grande", sans-serif;
+ font-weight: bold;
+ -webkit-flex-shrink: 0;
+ flex-shrink: 0;
+ margin: 2px;
+ text-decoration: none;
+}
+.currentLocation {
+ padding-top:1px;
+ font-weight: bold;
+ font-size: 9pt;
+ font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue",
+ Helvetica, Tahoma, Geneva, Arial, "Lucida Grande", sans-serif;
+ color: #E6E6E6;
+ text-decoration: none;
+ line-height: 10pt;
+ white-space:nowrap;
+}
+div.currentLocation {
+ width: 100%;
+}
+.breadcrumbContainer > .currentLocation {
+ margin: 0;
+}
+a.currentLocation:hover {
+ font-weight: bold;
+ color: #00AED1;
+ text-decoration: none;
+ border-bottom: 1px dotted;
+}
+a.breadcrumb.currentLocation {
+ font-weight: bold;
+ margin: 0;
+}
+.tooltipContainer .currentLocation {
+ color: white;
+}
+.tooltipContainer .breadcrumb {
+ color: white;
+}
+.tooltipContainer .breadcrumbSeparator {
+ color: white;
+}
+.tooltipContainer a.currentLocation:hover {
+ color: white;
+}
+.tooltipContainer a.breadcrumb:hover {
+ color: white;
+}
+.auxpane {
+ border: 0;
+ background: #3B4B54;
+ color: white;
+}
+.mainpane {
+ border: 0;
+ background: #3B4B54 !important;
+ padding-right:20px;
+}
+.mainToolbar {
+ color: white;
+ background: #26343f;
+ padding-left: 2px;
+ padding-right: 5px;
+ white-space: nowrap;
+}
+.fsToolbar {
+ padding: 2px 4px 2px 4px;
+ background-color: #DFE6EB;
+
+
+}
+.filesystemName {
+ display: inline-block;
+ font-weight: normal;
+ margin-left: 10px;
+ margin-top: 8px;
+ margin-bottom: 8px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+
+ max-width: calc(100% - 6px - 4px - 24px);
+ max-width: -webkit-calc(100% - 6px - 4px - 24px);
+ -moz-user-select: -moz-none;
+ -webkit-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ color: white;
+}
+.filesystemSwitcher {
+ display: inline-block;
+ margin: 0;
+}
+.filesystemSwitcherWrapper {
+ display: block;
+ max-width: 100%;
+ white-space: nowrap;
+}
+.sidebarToolbar {
+ display: inline;
+ overflow: visible;
+ padding: 0 !important;
+}
+.searchbox {
+ background-image: url(../../images/core_sprites.png);
+ background-repeat: no-repeat;
+ background-position: 4px -297px;
+ width: 12px; height: 12px;
+ background-color: #444;
+ border: 1px solid #222;
+ font-size: 11px;
+ width: 15em;
+ height: 16px;
+ border-radius: 10px;
+ color: #999;
+ padding: 0;
+ padding-left: 20px;
+ padding-right: 16px;
+ margin-left: 5px;
+ font-size: 7pt;
+}
+.searchbox:focus{
+ color: white;
+ outline: none;
+}
+
+.orionButton {
+ border: 1px solid transparent;
+ text-align: center;
+ vertical-align: baseline;
+ display: inline-block;
+ padding: 4px 6px;
+ border-radius: 1px;
+ line-height: 12px;
+ font-size: 9pt;
+ font-family: "HelveticaNeue", "Helvetica Neue", "HelveticaNeueRoman", "HelveticaNeue-Roman", "Helvetica Neue Roman",
+ 'TeXGyreHerosRegular', "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif;
+ margin: 0;
+}
+.commandButton.orionButton.dropdownTrigger {
+
+}
+.commandButton.orionButton.dropdownTrigger:hover {
+ border-color: #ccc;
+}
+.mainToolbar .commandButton.orionButton.dropdownTrigger {
+ color:white;
+}
+.commandButton {
+ color: #00AED1;
+ border: 1px solid #00AED1;
+ background-color: rgba(0, 0, 0, 0);
+
+ vertical-align: middle;
+ -webkit-transition: color 0.2s ease;
+ transition: color 0.2s ease;
+}
+.commandButton:not(.dropdownTrigger) {
+
+}
+.extraActions .commandButton {
+ text-transform: uppercase;
+}
+.commandButton.dropdownDefaultButton {
+
+}
+.commandButton:not(.primaryButton):hover, .commandButton:not(.primaryButton):focus {
+ color: white;
+ background-color: #a5b5bc;
+ box-shadow: 0 1px 2px 0 rgba(0,0,0,0.2);
+}
+.commandButton.disabled {
+ color: #cdcdcd;
+}
+.primaryButton{
+ background: #1bb199;
+ border-color: #1bb199;
+ color: white;
+}
+.primaryButton:hover, .primaryButton:focus {
+ background: #01CDB0;
+ border-color: #01CDB0;
+}
+.commandImage {
+ border: 1px solid transparent;
+ border-radius: 1px;
+ color: inherit;
+ background-color: transparent;
+ vertical-align: baseline;
+ cursor: pointer;
+ display: inline-block;
+ padding: 2px;
+ padding-top: 0;
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+.commandImage:hover, .commandImage:focus {
+ background-color: #a5b5bc;
+ border: 1px solid #ccc;
+}
+.mainToolbar .commandImage.dropdownTrigger {
+ color: white;
+}
+.orionToggleOff {
+ color: inherit;
+ border-radius: 3px;
+ vertical-align:middle;
+ -webkit-animation-duration: .2s;
+ animation-duration: .2s;
+ -webkit-animation-fill-mode: both;
+ animation-fill-mode: both;
+ -webkit-animation-timing-function: linear;
+ animation-timing-function: linear;
+}
+.orionToggleOn {
+ color: inherit;
+ background-color: whitesmoke;
+ border-radius: 3px;
+ box-shadow: inset 1px 1px 2px 1px rgba(0,0,0,0.3);
+ vertical-align:middle;
+ -webkit-animation-duration: .2s;
+ animation-duration: .2s;
+ -webkit-animation-fill-mode: both;
+ animation-fill-mode: both;
+ -webkit-animation-timing-function: linear;
+ animation-timing-function: linear;
+}
+.orionToggleOn:hover {
+ background: white;
+ box-shadow: inset 0 0 1px 1px rgba(0,0,0,0.2);
+}
+.orionToggleOff:hover {
+ background: whitesmoke;
+ box-shadow: inset 0 0 1px 1px rgba(0,0,0,0.2);
+}
+.orionToggleAnimate {
+ -webkit-animation-name: pulse;
+ animation-name: pulse;
+}
+@-webkit-keyframes pulse {
+ 0% { -webkit-transform: scale(1); }
+ 50% { -webkit-transform: scale(1.3); }
+ 100% { -webkit-transform: scale(1); }
+}
+@keyframes pulse {
+ 0% { transform: scale(1); }
+ 50% { transform: scale(1.3); }
+ 100% { transform: scale(1); }
+}
+.orionSwitch {
+ position: relative;
+ width: auto;
+}
+.orionSwitchCheck {
+ display: none;
+}
+.orionSwitchLabel {
+ display: block;
+ overflow: hidden;
+ cursor: pointer;
+ border: 1px solid #DFE6EB;
+ border-radius: 3px;
+ height: 20px;
+}
+.orionSwitchInner {
+ display: block;
+ width: 200%;
+ margin-left: -100%;
+ margin-top:-1px;
+ text-align: left;
+ -moz-transition: margin 0.2s ease-in 0s;
+ -webkit-transition: margin 0.2s ease-in 0s;
+ -o-transition: margin 0.2s ease-in 0s;
+ transition: margin 0.2s ease-in 0s;
+}
+.orionSwitchInner:before, .orionSwitchInner:after {
+ display: block;
+ float: left;
+ width: 50%;
+ padding: 0;
+ padding-bottom: 2px;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+}
+.orionSwitchInner:before {
+ padding-left: 3px;
+ padding-right: 2px;
+ background-color: #FFF;
+ color: #808080;
+}
+.orionSwitchInner:after {
+ padding-right: 3px;
+ background-color: #eee;
+ color: #808080;
+ text-align: right;
+}
+.orionSwitchSwitch {
+ display: block;
+ width: calc(50% - 2px);
+ margin: 0;
+ background: #DFE6EB;
+ border: 1px solid #DFE6EB;
+ border-radius: 3px;
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ right: calc(50% + 2px);
+ -moz-transition: all 0.2s ease-in 0s;
+ -webkit-transition: all 0.2s ease-in 0s;
+ -o-transition: all 0.2s ease-in 0s;
+ transition: all 0.2s ease-in 0s;
+}
+.orionSwitchCheck:checked + .orionSwitchLabel .orionSwitchInner {
+ margin-left: 0;
+}
+.orionSwitchCheck:checked + .orionSwitchLabel .orionSwitchSwitch {
+ right: 0px;
+}
+.commandMissingImageButton {
+ font-weight: normal;
+}
+.commandLink {
+ display: inline-block;
+ vertical-align: middle;
+ padding: 4px 0 1px;
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+.commandSeparator {
+ padding: 2px;
+}
+.commandActive {
+ background-color: #e6e6e6 !important;
+ border: 1px solid #808080 !important;
+ border-radius: 2px !important;
+}
+.commandActiveItem {
+}
+.commandInactiveItem {
+}
+.split {
+ background: #3B4B54;
+}
+.splitTracking {
+ background: #3B4B54;
+}
+.splitThumb {
+ background: #3B4B54;
+}
+.dropdown {
+}
+.dropdownArrowDown {
+ display: inline-block;
+ vertical-align: top;
+ line-height: 12px;
+ text-transform: lowercase;
+}
+.dropdownArrowRight {
+ flex-grow: 0;
+ -webkit-flex-grow: 0;
+ font-size: 12px;
+}
+.dropdownTrigger:not(.dropdownDefaultButton) {
+ font-weight: normal;
+ color: #FFFFFF;
+ border-color: transparent;
+}
+.dropdownTrigger a {
+ text-decoration: none;
+}
+.dropdownMenu {
+ box-shadow: 2px 2px 5px 3px rgba(0, 0, 0, .2);
+ color: #3b4b54;
+ background-color: white;
+ border-collapse: separate;
+ border: 1px solid #bbbbbb;
+ border-radius: 1px;
+ visibility: hidden;
+ z-index: 150;
+ position: absolute;
+ list-style-type: none;
+ display: none;
+ line-height: normal;
+ margin: 0;
+ cursor: default;
+ font-size: 12px;
+ margin: 0;
+ outline: none;
+ padding: 3px 0 3px;
+}
+.dropdownMenuOpen {
+ min-width: 120px;
+ display: block;
+ visibility: visible;
+}
+.dropdownSubMenu {
+ position: relative;
+ line-height: normal;
+}
+.dropdownSubMenu > ul {
+ top: 0;
+ left: 100%;
+}
+.dropdownMenu > li {
+ min-width: 120px;
+ display: flex;
+ display: -webkit-flex;
+}
+.dropdownMenu > li > a, .dropdownMenu > li > span {
+ width: calc( 100% - 9px );
+ margin: 0;
+}
+.dropdownMenu > li > *:focus {
+ outline: none;
+}
+.dropdownSeparator {
+ height: 1px;
+ background-color: #ddd;
+ color: #ddd;
+ padding: 0 !important;
+ margin: 0;
+}
+.dropdownMenuItem, .dropdownMenuItem a {
+ align-items: center;
+ -webkit-align-items: center;
+ align-content: stretch;
+ -webkit-align-content: stretch;
+ display: inline-flex;
+ display: -webkit-inline-flex;
+ vertical-align: middle;
+ color: #3b4b54 !important;
+ padding: 3px 3px 3px 5px;
+ cursor: pointer;
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ white-space: nowrap;
+ border-left: 4px solid transparent;
+}
+.dropdownMenu .dropdownMenuItemSelected {
+ background-color: rgba(27,177,153, 0.1);
+ border-left-color: #1BB199;
+}
+.dropdownMenuItem .check {
+ display: inline-block;
+ width: 12px;
+}
+.dropdownMenuItem .dropdownKeyBinding {
+ color: grey !important;
+ flex-grow: 0;
+ -webkit-flex-grow: 0;
+ font-size: 11px;
+ padding-left: 15px;
+ padding-right: 10px;
+}
+.dropdownMenuItem .dropdownCommandName {
+ -webkit-align-items: center;
+ align-items: center;
+ display: inline-flex;
+ display: -webkit-inline-flex;
+
+ flex-grow: 1;
+ -webkit-flex-grow: 1;
+ text-decoration: inherit;
+}
+.dropdownSelection {
+ background-color: white !important;
+ color: #3b4b54 !important;
+ border: 1px solid #bbbbbb !important;
+ border-bottom: none !important;
+ border-bottom-left-radius: 0 !important;
+ border-bottom-right-radius: 0 !important;
+ box-shadow: -1px -1px 2px 0 rgba(0, 0, 0, .2) !important;
+ margin-bottom: -1px !important;
+ position: relative !important;
+ z-index: 200 !important;
+}
+.checkedMenuItem {
+ margin: 4px 6px 2px 0;
+ vertical-align: bottom;
+}
+.tooltipContainer {
+ display: none;
+ z-index: 200;
+ background: transparent;
+ position: absolute;
+ max-width: 110em;
+}
+.tooltip .textContent {
+ max-width: 40em;
+}
+.tooltip {
+ color: white;
+ background-color: #158d7a;
+ border-radius: 3px;
+ padding: 8px;
+ clear: both;
+ float: left;
+ border: 1px solid #158d7a;
+ box-shadow: 0px 0px 10pt -2pt rgba(0, 0, 0, 0.5);
+}
+.tooltip.left {
+}
+.tooltip .navlinkonpage {
+ color: #00aed1 !important;
+}
+.tooltip h2 {
+ color: #3b4b54;
+}
+.tooltip .operationStatus {
+ color: #00aed1;
+}
+.tooltip .operationError {
+ color: #a6b5bc;
+}
+.tooltipTailFromleft {
+ position: absolute;
+ display: inline-block;
+ top: 14px;
+ content: '';
+ z-index: 201;
+}
+.tooltipTailFromleft:after, .tooltipTailFromleft:before {
+ left: -1px;
+ top: 50%;
+ border: solid transparent;
+ content: " ";
+ height: 0;
+ width: 0;
+ position: absolute;
+ pointer-events: none;
+}
+.tooltipTailFromleft:after {
+ border-color: transparent;
+ border-left-color: #158d7a;
+ border-width: 8px;
+ margin-top: -8px;
+}
+.tooltipTailFromleft:before {
+ border-color: transparent;
+ border-left-color: #158d7a;
+ border-width: 9px;
+ margin-top: -9px;
+}
+.tooltipTailBorderFromleft {
+ position: absolute;
+ display: inline-block;
+ border: 10px solid;
+ border-color: transparent transparent transparent #158d7a;
+ top: 2px;
+ right: -17px;
+ content: '';
+}
+.tooltipTailFromright {
+ position: absolute;
+ display: inline-block;
+ left: 0;
+ top: 14px;
+ content: '';
+ z-index: 201;
+}
+.tooltipTailFromright:after, .tooltipTailFromright:before {
+ right: -1px;
+ top: 50%;
+ border: solid transparent;
+ content: " ";
+ height: 0;
+ width: 0;
+ position: absolute;
+ pointer-events: none;
+}
+.tooltipTailFromright:after {
+ border-color: transparent;
+ border-right-color: #158d7a;
+ border-width: 8px;
+ margin-top: -8px;
+}
+.tooltipTailFromright:before {
+ border-color: transparent;
+ border-right-color: #158d7a;
+ border-width: 9px;
+ margin-top: -9px;
+}
+.tooltipTailBorderFromright {
+ position: absolute;
+ display: inline-block;
+ border: 10px solid;
+ border-color: transparent #158d7a transparent transparent;
+ left: -17px;
+ top: 2px;
+ content: '';
+}
+.tooltipTailFrombelow {
+ position: absolute;
+ display: block;
+ left: 16px;
+ top: 0;
+ content: '';
+ z-index: 201;
+}
+.tooltipTailFrombelow:after, .tooltipTailFrombelow:before {
+ bottom: -1px;
+ left: 50%;
+ border: solid transparent;
+ content: " ";
+ height: 0;
+ width: 0;
+ position: absolute;
+ pointer-events: none;
+}
+.tooltipTailFrombelow:after {
+ border-color: transparent;
+ border-bottom-color: #158d7a;
+ border-width: 8px;
+ margin-left: -8px;
+}
+.tooltipTailFrombelow:before {
+ border-color: transparent;
+ border-bottom-color: #158d7a;
+ border-width: 9px;
+ margin-left: -9px;
+}
+.tooltipTailBorderFrombelow {
+ position: absolute;
+ display: block;
+ border: 10px solid;
+ border-color: transparent transparent #158d7a transparent;
+ left: 14px;
+ top: -17px;
+ content: '';
+}
+.tooltipTailFromabove {
+ position: absolute;
+ display: block;
+ left: 16px;
+ content: '';
+ bottom: 0;
+ z-index: 201;
+}
+.tooltipTailFromabove:after, .tooltipTailFromabove:before {
+ top: -1px;
+ left: 50%;
+ border: solid transparent;
+ content: " ";
+ height: 0;
+ width: 0;
+ position: absolute;
+ pointer-events: none;
+}
+.tooltipTailFromabove:after {
+ border-color: transparent;
+ border-top-color: #158d7a;
+ border-width: 8px;
+ margin-left: -8px;
+}
+.tooltipTailFromabove:before {
+ border-color: transparent;
+ border-top-color: #158d7a;
+ border-width: 9px;
+ margin-left: -9px;
+}
+.tooltipTailBorderFromabove {
+ position: absolute;
+ display: block;
+ border: 10px solid;
+ border-color: #158d7a transparent transparent transparent;
+ left: 14px;
+ bottom: -17px;
+ content: '';
+}
+.tooltipShowing {
+ display: block;
+}
+.tooltip > .parametersDismiss > .dismissButton {
+ color: whitesmoke;
+}
+.tooltip > .parametersDismiss > .dismissButton:hover {
+ color: white;
+}
+.dialog {
+ visibility: hidden;
+ z-index: 175;
+ position: absolute;
+ background-color: #fbfbfb;
+ border-radius: 2px;
+ border: 1px solid #BBB;
+ box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
+ padding-bottom:5px;
+}
+.dialogShowing {
+ visibility: visible;
+}
+.dialogTitle {
+ display: block;
+}
+.dialogTitle {
+ padding-top: 5px;
+ display: inline-block;
+ background: #555;
+ width: 100%;
+ padding-bottom: 5px;
+ border-top-left-radius: 1px;
+ border-top-right-radius: 1px;
+}
+.dialogTitle > .dismissButton {
+ margin-right: 0;
+}
+.dialogTitleText {
+ margin: 2px 2px 0;
+ color: whitesmoke;
+ font-size: 1em;
+ height: 18px;
+ padding-left: 4px;
+ font-weight: bold;
+}
+.dialogDismiss {
+ display: block;
+ cursor: pointer;
+ padding: 2px;
+}
+.dialogContent {
+ padding: 8px;
+}
+.parameterPopup .dismissButton, .dialogTitle .dismissButton {
+ color: rgb(221, 221, 221);
+ cursor: pointer;
+}
+.parameterPopup .dismissButton:hover, .dialogTitle .dismissButton:hover {
+ color: white;
+}
+.dialogButtons {
+ -webkit-align-items: center;
+ align-items: center;
+
+ display: -webkit-flex;
+ display: flex;
+
+ -webkit-justify-content: center;
+ justify-content: center;
+ margin: 2px 4px 4px 4px;
+}
+.dialogButtons > button.commandButton {
+ min-width: 60px;
+}
+.confirmDialog {
+ min-width: 300px;
+ max-width: 450px;
+}
+.confirmDialog .checkboxWrapper {
+ margin: 10px 2px 5px 2px;
+}
+.checkboxMessage > .confirmDialogCheckbox {
+ margin: 0 5px 0 0;
+ outline: none;
+ vertical-align: top;
+}
+.modalBackdrop {
+ opacity: 0.5;
+ -webkit-transition: opacity 0.2s ease-in;
+ transition: opacity 0.2s ease-in;
+}
+.textviewTooltip {
+ background-color: #303030;
+}
+.textviewTooltip .commandButton {
+ border-color: white;
+ color: white;
+ margin-bottom: 2px;
+}
+.core-sprite-git-logo {
+ font-size: 20px !important;
+}
+.outlineExplorer .navlinkonpage {
+ color: #333 !important;
+}
+.outlineExplorer .treeIterationCursorRow_Dotted {
+ background-color: #1BB199;
+}
+.outlineExplorer .treeIterationCursorRow_Dotted .modelDecorationSprite {
+ color: white;
+}
+.outlineExplorer .treeIterationCursorRow_Dotted .navlinkonpage {
+ color: white !important;
+}
+.contentassist .selected {
+ /*background-color: #1BB199 !important;*/
+ background: #08f;
+ border-radius: 0;
+ color: #FFF;
+}
diff --git a/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-editor-compat.css b/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-editor-compat.css
deleted file mode 100644
index c8e6391d5..000000000
--- a/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-editor-compat.css
+++ /dev/null
@@ -1,617 +0,0 @@
-/*******************************************************************************
- * @license
- * Copyright (c) 2014 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials are made
- * available under the terms of the Eclipse Public License v1.0
- * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
- * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
- /*****
- * Above copyright notice is the verbatim orion one.
- * This file is orion 'built-editor.css' file where the cm-* classes are commented out
- *****/
-.textview {
- background-color: white;
- font-family: "Consolas", "Monaco", "Vera Mono", monospace;
- font-size: 10pt;
- min-width: 50px;
- min-height: 50px;
-}
-.textviewScroll {
- padding: 5px 2px 2px 2px;
-}
-.textviewContent {
- cursor: auto;
-}
-.textviewLeftRuler {
- border-right: 1px solid #eaeaea;
-}
-.textviewRightRuler {
- border-left: 1px solid #eaeaea;
-}
-.textviewMarginRuler {
- border-left: 1px solid #eaeaea;
-}
-.textviewBlockCursor {
- background: black;
- opacity: 0.4;
-}
-.ruler {
-}
-.ruler.annotations {
- width: 16px;
-}
-.ruler.folding {
- width: 14px;
-}
-.ruler.lines {
- text-align: right;
-}
-.ruler.overview {
- width: 14px;
-}
-.rulerLines {
- color: silver;
-}
-.rulerLines.even
-.rulerLines.odd {
-}
-.tooltipTheme.textview {
- background-color: InfoBackground !important;
- color: InfoText !important;
-}
-.tooltipTheme .textviewScroll {
- padding: 0px;
-}
-.textviewTooltip {
- font-family: "Consolas", "Monaco", "Vera Mono", monospace;
- font-size: 10pt;
- background-color: InfoBackground;
- color: InfoText;
- padding: 2px;
- border-radius: 4px;
- border: 1px solid black;
- z-index: 100;
- position: fixed;
- overflow: hidden;
-}
-.textviewTooltip em {
- font-style: normal;
- font-weight: bold;
-}
-.textviewTooltip span {
- vertical-align: baseline;
-}
-.textviewTooltip .tooltipRow {
- display: table-row;
-}
-.textviewTooltip .tooltipTitle {
- float: right;
-}
-.tooltipTheme .annotationLine.currentLine {
- background-color: transparent !important;
-}
-.textViewFind {
- background-color: #ddd;
- position: absolute;
- top: -50px;
- right: -1000px;
- border: 1px solid #aaa;
- border-top: 0;
- border-bottom-right-radius: 4px;
- border-bottom-left-radius: 4px;
- padding: 2px;
- z-index: 100;
-}
-.textViewFind.show {
- top: 0;
- right: 40px;
- transition: top 0.3s ease-out;
- -ms-transition: top 0.3s ease-out;
- -moz-transition: top 0.3s ease-out;
- -webkit-transition: top 0.3s ease-out;
- -o-transition: top 0.3s ease-out;
-}
-.textViewFindButton {
- margin-right: 1px;
- margin-left: 0;
-}
-.textViewFindButton:first-child {
- margin-left: 5px;
-}
-.textViewFindButton:last-child {
- margin-right: 5px;
-}
-.textViewFindButton.checked {
- color: blue;
- text-decoration: underline;
-}
-.textViewReplaceInput {
-}
-.textViewFindInput {
-}
-.textViewFindCloseButton {
- width: 16px;
- height: 16px;
- border-width: 0;
- background-color: transparent;
- vertical-align: baseline;
- background-position: center;
- background-repeat: no-repeat;
- background-image: url(data:image/gif;base64,R0lGODlhEAAQAJEAAAAAAP///4CAgP///yH5BAEAAAMALAAAAAAQABAAAAIdnI+py+1vhECSyTluu9px+HkctnSdUh0pxLYuVAAAOw==);
-}
-.contentassist {
- font-size:9pt;
- display: none;
- background-color: white;
- position: fixed;
- top: 100px;
- left: 100px;
- z-index:100;
- cursor: default;
- min-width: 70px;
- max-width: 350px;
- max-height: 170px;
- overflow: hidden;
- white-space: nowrap;
- border-radius: 5px;
- box-shadow: rgba(0, 0, 0, 0.3) 2px 2px 10px;
- line-height: 18px;
-}
-.contentassist:focus {
- outline: none;
-}
-.contentassist:hover {
- overflow-y: auto;
-}
-.contentassist .proposal-emphasis {
- font-weight: normal;
-}
-.contentassist hr{
- border: 0;
- height: 0;
- border-top: 1px solid rgba(0, 0, 0, 0.1);
- border-bottom: 1px solid rgba(255, 255, 255, 0.3);
-}
-.contentassist .proposal-noemphasis-keyword {
- background-color: aliceblue;
- color: #CC4C07;
- font-weight: bold;
-}
-.contentassist .proposal-noemphasis {
- background-color: aliceblue;
- font-weight: lighter;
- color: black;
-}
-.contentassist .proposal-noemphasis-title-keywords {
- background-color: aliceblue;
- color: grey;
-}
-.contentassist .proposal-noemphasis-title {
- background-color: aliceblue;
- color: grey;
- padding-top: 5px;
-}
-.contentassist .proposal-noemphasis-title::before {
- content: "- ";
-}
-.contentassist .proposal-noemphasis-title::after {
- content: " -";
-}
-.contentassist .proposal-default {
-
-}
-.contentassist .proposal-name {
- font-weight: bold;
-}
-.contentassist > div:hover {
- background-color: #fab467;
- background: linear-gradient(#fabb76, #e1a25c);
- border-radius: 3px;
-}
-.contentassist>div.proposal-hr:hover {
- background-color: white;
- background: none;
-}
-.contentassist .selected {
- background-color: rgb(48, 135, 179);
- background: linear-gradient(rgb(60, 150, 190), rgb(30, 120, 160));
- border-radius: 3px;
- color: white;
-}
-.contentassist .cloneProposal {
- box-shadow: rgba(0, 0, 0, 0.9) 2px 2px 8px;
- position: fixed;
- z-index: 1000;
-}
-.contentassist>div {
- padding: 1px 3px 1px 5px;
-}
-.cloneWrapper {
- display: block;
- overflow: visible;
- z-index: 1000;
-}
-.contentassist.cloneWrapper:hover {
- overflow: visible;
-}
-.comment.block.documentation, .comment-block-documentation {
- color: #00008F;
-}
-.comment {
- color: #3C802C;
-}
-.constant.character.entity, .constant-character-entity {
- font-style: normal;
-}
-.constant {
- color: blue;
-}
-.entity.name.function, .entity.name.type, .entity-name-function, .entity-name-type {
- font-weight: bold;
-}
-.entity.name, .entity-name-tag {
- color: #CC4C07;
-}
-.entity.other.attribute.name, .entity-other-attribute-name {
- color: #3C802C;
-}
-.entity {
- color: #3f7f7f;
-}
-.invalid.illegal, .invalid-illegal {
- color: white;
- background-color: red;
-}
-.invalid.deprecated, .invalid-deprecated {
- text-decoration: line-through;
-}
-.invalid {
- color: red;
- font-weight: bold;
-}
-.keyword.other.documentation.markup {
- color: #7F7F9F;
-}
-.keyword.other.documentation {
- color: #7F9FBF;
-}
-.keyword.operator, .keyword-operator {
- color: #ddd;
-}
-.keyword {
- color: #CC4C07;
- font-weight: bold;
-}
-.markup.bold {
- font-weight: bold;
-}
-.markup.heading, .markup-heading {
- color: blue;
-}
-.markup.italic {
- font-style: italic;
-}
-.markup.list {
- color: #CC4C07;
-}
-.markup.other.separator {
- color: #00008F;
-}
-.markup.other.strikethrough {
- text-decoration: line-through;
-}
-.markup.other.table {
- color: #3C802C;
-}
-.markup.quote, .markup-quote {
- color: #446fbd;
-}
-.markup.raw {
- font-family: monospace
-}
-.markup.underline.link {
- text-decoration: underline;
-}
-.meta.annotation.currentLine {
- background-color: #EAF2FE;
-}
-.meta.tag {
- color: #3f7f7f;
-}
-.punctuation.definition.comment, .punctuation-definition-comment {
- color: #3f5fbf;
-}
-.punctuation.definition.string, .punctuation-definition-string {
- color: blue;
-}
-.punctuation.separator.space {
-
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAAXNSR0IArs4c6QAAABVJREFUCNdj3L17938GBgYGJgYoAAAxOAM004kASgAAAABJRU5ErkJggg==");
- background-repeat: no-repeat;
- background-position: center center;
-}
-.punctuation.separator.tab {
-
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAFCAYAAABmWJ3mAAAAAXNSR0IArs4c6QAAABtJREFUCNdj2L17938GKEBmYwgQJ0m8IAMDAwDemh/hgxuOkwAAAABJRU5ErkJggg==");
- background-repeat: no-repeat;
- background-position: left center;
-}
-.storage {
- color: #7F0055;
-}
-.string {
- color: #446fbd;
-}
-.support {
- color: #21439c;
-}
-.variable.parameter, .variable-parameter {
- color: black;
-}
-.variable.language, .variable-language {
- color: #7F0055;
- font-weight: bold;
-}
-.variable {
- color: #0000c0;
-}
-.variable.other {
- color: #E038AD;
-}
-/* .cm-meta { color: #00008F; } */
-/* .cm-keyword { font-weight: bold; color: #7F0055; } */
-/* .cm-atom { color: #21439c; } */
-/* .cm-number { color: black; } */
-/* .cm-def { color: green; } */
-/* .cm-variable { color: black; } */
-/* .cm-variable-2 { color: #004080; } */
-/* .cm-variable-3 { color: #004080; } */
-/* .cm-property { color: black; } */
-/* .cm-operator { color: #222; } */
-/* .cm-comment { color: green; } */
-/* .cm-string { color: blue; } */
-/* .cm-error { color: #ff0000; } */
-/* .cm-qualifier { color: gray; } */
-/* .cm-builtin { color: #7F0055; } */
-/* .cm-bracket { color: white; background-color: gray; } */
-/* .cm-tag { color: #3f7f7f; } */
-/* .cm-attribute { color: #7f007f; } */
-.annotation {
-}
-.annotation.error,
-.annotation.warning,
-.annotation.task,
-.annotation.bookmark,
-.annotation.breakpoint,
-.annotation.collapsed,
-.annotation.expanded,
-.annotation.currentBracket,
-.annotation.matchingBracket,
-.annotation.currentLine,
-.annotation.matchingSearch,
-.annotation.currentSearch,
-.annotation.readOccurrence,
-.annotation.writeOccurrence,
-.annotation.linkedGroup,
-.annotation.currentLinkedGroup,
-.annotation.selectedLinkedGroup {
-}
-.annotation.blame {
- color: gray;
- background-color: rgb(255, 132, 44);
-}
-.annotation.currentBlame {
- color: black;
- background-color: rgb(184, 103, 163);
-}
-.annotationHTML {
- cursor: pointer;
- width: 16px;
- height: 16px;
- display: inline-block;
- vertical-align: middle;
- background-position: center;
- background-repeat: no-repeat;
-}
-.annotationHTML.error {
-
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjNGNTlDOUMxMUVDNDExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjNGNTlDOUMyMUVDNDExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6M0Y1OUM5QkYxRUM0MTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6M0Y1OUM5QzAxRUM0MTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4Be44kAAAAqklEQVR42mL8//8/AyWAiYFCQLEBLNgEX+aURgGpAiA2gAqdB+KJ4lO6l6GrZUQPA6DmqUAqC4eF04CGZOP0AtRmkOZ/QHwLSeoWVCwLqgZnGORD6TtA7ArEp6DYFSqGrAZrGBhCaTUgXg3EoVD+aqgYshraRON5JD+HQm2GueQWmhqsBkyE0ipAvBuIzaB4N1QMWQ11opERW16ARlU+UoARn5CGXmYCCDAAPz09iI0KJ9QAAAAASUVORK5CYII=");
-}
-.annotationHTML.warning {
-
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkREMTE1OUNDMUVDMjExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkREMTE1OUNEMUVDMjExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6REQxMTU5Q0ExRUMyMTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6REQxMTU5Q0IxRUMyMTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4Kzt/qAAAA0ElEQVR42mL8//8/AyWAiYFCQLEBLLgkfl8obARSZUD8HYiLWQ3652NTx4gtDICao4HUbCDeBRVyBmI3oCHHCRoA1MwOpO4A8V+gBgWo2AMg9QaITYFi/wl5IRaIZYD4K1AjI8gSIBYBYnkg9gLirYQCMRdKc0M1KUDZIFCM1wtAG02B1Ckk+WlQSzKQxLSA3riOywUpaHxHILZHE8vA54VQNL4XFCODaHyB+B6IBZH4s7CE0Ud8LvCHhsFfKN8VihmgYqegavAnpKGVmQACDACxJDv3vmRk+gAAAABJRU5ErkJggg==");
-}
-.annotationHTML.task {
-
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjdEMjg0RkI2MUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjdEMjg0RkI3MUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6N0QyODRGQjQxRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6N0QyODRGQjUxRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6Utm8RAAAAl0lEQVR42mL8//8/AyWAiYFCQLEBLMicqtVRRPmnLXQZIzkuuEuJF04BsTEQ15JjAEizGxB/AmJpYgz4DsTLoewrQOwJ9PNHID0ViDPwBiIURAPxBqjm2UDN74CB2wFkZxKMBSioAOJ9QI1t0JgBaS4nKhqhwAyIdwE1ugLpLHyacRkAM+QcECtTkhKViYlfxqGfmQACDAAjXCa0hW/NdQAAAABJRU5ErkJggg==");
-}
-.annotationHTML.bookmark {
-
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjdEMjg0RkIyMUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjdEMjg0RkIzMUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6N0QyODRGQjAxRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6N0QyODRGQjExRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz54SgjJAAAAuUlEQVR42mL8//8/AyWAiYFCQFsDWrdcMAViY3xqWAhYEADEv4H4LLle8IVinIARORaAzpUHiUG5qkC8C8p2AOKHQPwDhKt9DD7gcoEREJ8H4vtImkHgAFTsKhB743QB1BWyQGo+EDujGb4JiNOBtr/AawDUEH0gdQFNWBGo+QGxgRgEpV8C8SsoO4KUWAAZsAeIDYBYB4g3A3EUwViAOl8Falsb0Mn/kMRTQYYCxe4TDIOhlZkAAgwAunFAhB2QB2cAAAAASUVORK5CYII=");
-}
-.annotationHTML.breakpoint {
-
- background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAFheoFxkoFxnpmt0pmZxpnF7rYyWwmJwpnaFs3aDrWt8rXGBrYycwmZ3mXuNs42cu77F03GIs3aJrYGVu2J5oKCuxeDj6LK/03GLrYieu3aIoIygu6m4zcLN3MTM1m6Rs2aLriRgkSZilXGXtoGcs7LD0QBLhSZikihol3ScubrO2Yaqu5q4xpO0wpm7yabF0ZO9yaXI0r3X3tHj6P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADQALAAAAAAQABAAAAafQJpwSCwWLYZBIDAwWIw0A+FFpW6aRUPCxe1yE4ahhdCCxWSzmSwGgxGeUceKpUqhUCkVa7UK0wgkJCUjJoUmIyWBBEIEGhoeJ4YmJx6OAUIADQ0QIZIhEJoAQgEUFBUgkiAVpZdRCxIPFx8iIh8XDw4FfhYHDhgZHB0dHBkYEwdwUQoTEc3OEwp+QwYHCBMMDBMIB9JESAJLAk5Q5EVBADs=");
-}
-.annotationHTML.collapsed {
-
- width: 14px;
- height: 14px;
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAWBJREFUeNpi/P//PwMlgImBQkCxASzoAp++fo+6de+Z+fXbD/Jev/nAICoiwKCpqrBBTUlqNR835zJ09YzIYfDxy7eo/cevLmXlYGNQUJAEahZieP3mHcODB08Zfv/4w+BoqR3Nz8O1DKcXzt94HPqXmZlBU1+LgZNfkMHazIOBA0hr6uswgMTP33gYijcMLlx/EMAnLs7w7sc/hg9AG0HgPZB+B8S84hJA+UcBeMPg+at3DJIMnAxZzt5wsUhnXzDdsmIVWB6vAcLCfAys3z4wzN64huEfkJ/uH8IwexOQDQymD2/fgeXxekFLRWHD51evGDhZGRi4WSFSnCwgNjB2Xr1m0AbK4zXAQkdhNdPf3wx3r91g+PruLcOqnasYvn54x3Dv2k0G5r+/GMyB8nijEQTefvoadeH6w9Cbtx8GvH//kUFQkJ9BQ1V+g76m/GphPu5lBA0YenmBYgMAAgwA34GIKjmLxOUAAAAASUVORK5CYII=");
-}
-.annotationHTML.expanded {
-
- width: 14px;
- height: 14px;
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAT5JREFUeNrUksFKw0AURW+mTWw67SSEiG209U90r4jddFO34l+5U0HdZCHiFwiCOz9AlMSmGEpMOqk1TWJSFGyFbATR2dyZd+Dw3mOENE3xkyP8PYHrBT3OX7uW43ZefA6FUaw1dJPSyrmu1k8KBYOh37Od4XFZLEPXFdRrFMGIw3U9TKMYqw1tb0VjcxLy9eEF425CCIxWE5JcxSQGxCyNloG87gXhwWIHc4J767lTZQw8ShFGSZbxRyaQmZJxd3NRUJ6ffwQNEi6PzG/L2tjdmvFCgcKqKL2F2Olu43MzggDka+IjPuOFI7Sbujn2fUglYKkkzFIi+R0I/QDrGS8UqDX5QkhiOHYfE84hkhSTkGNgOyDJFCzjhYLTq+vDtrG8r1LZtB6fcHtzB+uhD5VWzLx+lvF/8JV/XfAuwADsrJbMGG4l4AAAAABJRU5ErkJggg==");
-}
-.annotationHTML.multiple {
-
- background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAOdpa+yJiuFYXOFYXeBYXONwded8f+NwdmhwkHB4iPr7/ezx+fP2+2h4kOzy+Wh4iPr8/gCBwTaczjaXyjaYyjaXyTaYyfr8/QCMzQCMzACHxzao2jal2Dak1zag03iAgI/Ckn64fZrHmX+4fZLCianPopPCiarOoqbLlafLlbnXq7nWq6fLlMTcsoCIeJCQcIiIeKCYaJiQcO16ee16evGVlfGWlfahn/ahoPWhn/WhoPe1tP///////wAAAAAAACH5BAEAAD0ALAAAAAAQABAAAAaRwJ5wSCwaj8WYcslcDmObaDTGq1Zjzw4mk+FQIRcFTzaUeTRoj4zHaI+HL0lkLnnxFgsH7zWEWSoTFBMwVlUwQy6JMDCJjYwuQx8tk5MfOzk4OjcfkSssKCkqHzY0MzQ1nEIJJSYkJCcJAQCzAQlDDyIjISMiCQYEAgMGD0MNIMfHDQUHBc3EQgjR0tPSSNY9QQA7");
-}
-.annotationHTML.overlay {
-
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJEAQvB2JVdrAAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAAD1JREFUCNdtjkESADAEAzemf69f66HMqGlOIhYiFRFRtSQBWAY7mzx+EDTL6sSgb1jTk7Q87rxyqe37fXsAa78gLyZnRgEAAAAASUVORK5CYII=");
- background-position: right bottom;
- position: relative;
- top: -16px;
-}
-.annotationHTML.currentBracket {
-
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sLEBULCGQmEKAAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAnklEQVQ4y7VTsRHDIBATJg1HCUzAHEzFBExAzwZsRMkE9gifKhc72ODYibr/+xcnoQdugq0LAujEwmbn0UxQh4OxpjX1XgshwFqLnPM5PQTQGlprWpbl3RhJ/CSQUm7qPYLp7i8cEpRSoJT6ju0lIaVEQgiKMQ4lHHpQayVjzHWCn5jIOcc8z9dMBADvPZxz3SC1tzCI8vgWdvL+VzwB8JSj2GFTyxIAAAAASUVORK5CYII=");
-}
-.annotationHTML.matchingBracket {
-
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sLEBUMAsuyb3kAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAoklEQVQ4y61TsQ3EIAw80DcI0USKGIApWIsB2IGGKbJPugxBR3VfvfRRCOSTvw7LPuPzGXgI8f0gwAsFu5rXIYMdDiEOIdnKW5YFzjnEGH+bhwA/KKVwmibu0BhRnpEZY1BrHTaVT7fQJZjnGeu63tOAJFNKVEox53yqQZfAWstt27oidgm01ve3UEqBaBjnspG89wgh3LiFgZXHt3Dh23/FGxKViehm0X85AAAAAElFTkSuQmCC");
-}
-.annotationHTML.currentLine {
-
- background-image: url("data:image/gif;base64,R0lGODlhEAAQAMQAALxe0bNWzbdZzrlb0KpPx61RybBTy6VLxadNxZGctIeUroyYsG92hHyMqIKRq2l9nmyAoHGDonaIpStXj6q80k1aXf///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABYALAAAAAAQABAAAAVCoCWOZGmeKDql5ppOMGXBk/zOoltSNO6XrlXwxIPNYiMGq8SoLC2MaNPygEQkDYdikUg6LQcEoWAICAaA5HPNLoUAADs=");
-}
-.annotationHTML.matchingSearch {
-
- background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAALClrLu1ubOpsKqdp6eapKufqMTAw7attLSrsrGnr62jq8C7v765vaebpb22vLmyuMbCxsnGycfEx8G+wcrIysTBxUltof//yf///v70jergpPvws+nWc/npqvrpqvrpq/raffffnvXVkfTVkvXUkd+9f+SiOemvV+uyXa2OX7mYZqeIXKuNX/ClO7KQYqiIXJ59Vp19VpFvTo9uTZBvTpNyUJNyUf///////wAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADgALAAAAAAQABAAAAZ4QJxwSCwajS2aS1U6DlunzcagcuKgG4sn5HJiLZ2QiHbEbj6hEapVTKVYr3OItG5TIhVGLF0npigUEAsPAjV9Q24pEhMBCAoybEUmGRcrDgcAAzNGkxcYNzAJBQSbRJ0YqBc2DaVEHJ6pGTStRBqfGBcZILRWvThBADs=");
-}
-.annotationHTML.currentSearch {
-
- background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAALClrLu1ubOpsKqdp6eapKufqMTAw7attLSrsrGnr62jq8C7v765vaebpb22vLmyuMbCxsnGycfEx8G+wcrIysTBxUltof//yf///v70jergpPvws+nWc/npqvrpqvrpq/raffffnvXVkfTVkvXUkd+9f+SiOemvV+uyXa2OX7mYZqeIXKuNX/ClO7KQYqiIXJ59Vp19VpFvTo9uTZBvTpNyUJNyUf///////wAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADgALAAAAAAQABAAAAZ4QJxwSCwajS2aS1U6DlunzcagcuKgG4sn5HJiLZ2QiHbEbj6hEapVTKVYr3OItG5TIhVGLF0npigUEAsPAjV9Q24pEhMBCAoybEUmGRcrDgcAAzNGkxcYNzAJBQSbRJ0YqBc2DaVEHJ6pGTStRBqfGBcZILRWvThBADs=");
-}
-.annotationHTML.readOccurrence {
-
- background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAP3ykf3zn/7lIv7kI/fbI/7nRf7scLe0oMXDtfXXHsG4gaKdgOXBF+rIJqKdhaijjNWxHeLBL6GafLuYJpmQcvvdg5OHZpyRcJ+UdLavm4+BXqGWeYZ1TYx7VZ6QcJ2NbI+Ebv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACEALAAAAAAQABAAAAZewJBwSCwaj0KMBFlULphDJwIakh6gGckCcXgyLxjuYol0PA6YMQbZqFAOhw/Gc2wHABaJhAMy2gEGBRoSHRtFf4ECDRpGERV3iQ0TRwyQBQSSRAmbAwEMnxAQClRQQQA7");
-}
-.annotationHTML.writeOccurrence {
-
- background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAP3ykf3zn/7lIv7kI/fbI/7nRf7scLe0oMXDtfXXHsG4gaKdgOXBF+rIJqKdhaijjNWxHeLBL6GafLuYJpmQcvvdg5OHZpyRcJ+UdLavm4+BXqGWeYZ1TYx7VZ6QcJ2NbI+Ebv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACEALAAAAAAQABAAAAZewJBwSCwaj0KMBFlULphDJwIakh6gGckCcXgyLxjuYol0PA6YMQbZqFAOhw/Gc2wHABaJhAMy2gEGBRoSHRtFf4ECDRpGERV3iQ0TRwyQBQSSRAmbAwEMnxAQClRQQQA7");
-}
-.annotationHTML.blame {
- float: left;
-}
-.annotationHTML.currentBlame {
- float: left;
-}
-.annotationHTML.blame.single {
- width: 32px;
- height: 32px;
-}
-.annotationHTML.currentBlame.single {
- width: 32px;
- height: 32px;
-}
-.annotationOverview {
- cursor: pointer;
- border-radius: 2px;
- left: 2px;
- width: 8px;
-}
-.annotationOverview.task {
- background-color: #93bb7a;
- border: 1px solid #79aa59;
-}
-.annotationOverview.breakpoint {
- background-color: lightblue;
- border: 1px solid blue;
-}
-.annotationOverview.bookmark {
- background-color: #84b3cf;
- border: 1px solid #9cc2d8;
-}
-.annotationOverview.error {
- background-color: #EFA1A7;
- border: 1px solid #ec8a91;
-}
-.annotationOverview.warning {
- background-color: #fce1a9;
- border: 1px solid #face70;
-}
-.annotationOverview.currentBracket {
- background-color: lightgray;
- border: 1px solid red;
-}
-.annotationOverview.matchingBracket {
- background-color: #ff7f7f;
- border: 1px solid #ff3232;
-}
-.annotationOverview.currentLine {
- background-color: #EAF2FE;
- border: 1px solid black;
-}
-.annotationOverview.matchingSearch {
- background-color: #C3E1FF;
- border: 1px solid #afcae5;
-}
-.annotationOverview.currentSearch {
- background-color: #53D1FF;
- border: 1px solid #42a7cc;
-}
-.annotationOverview.readOccurrence {
- background-color: lightgray;
- border: 1px solid black;
-}
-.annotationOverview.writeOccurrence {
- background-color: Gold;
- border: 1px solid darkred;
-}
-.annotationOverview.currentBlame {
- background-color: rgb(184, 103, 163);
- border: 1px solid black;
-}
-.annotationRange {
- background-repeat: repeat-x;
- background-position: left bottom;
-}
-.annotationRange.task {
-
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sLDhEoIrb7JmcAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAGUlEQVQI12NggIH/DGdhDCM45z/DfyiBAADgdQjGhI/4DAAAAABJRU5ErkJggg==");
-}
-.annotationRange.breakpoint {
-
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sLDhEqHTKradgAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAIklEQVQI11XJMQ0AMAzAMGMafwrFlD19+sUKIJTFo9k+B/kQ+Qr2bIVKOgAAAABJRU5ErkJggg==");
-}
-.annotationRange.bookmark {
-
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=");
-}
-.annotationRange.error {
-
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==");
-}
-.annotationRange.warning {
-
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=");
-}
-.annotationRange.currentBracket {
-}
-.annotationRange.matchingBracket {
- outline: 1px solid red;
-}
-.annotationRange.readOccurrence {
- background-color: lightgray;
-}
-.annotationRange.writeOccurrence {
- background-color: yellow;
-}
-.annotationRange.matchingSearch {
- background-color: #C3E1FF;
-}
-.annotationRange.currentSearch {
- background-color: #53D1FF;
-}
-.annotationRange.linkedGroup {
- outline: 1px solid grey;
-}
-.annotationRange.currentLinkedGroup {
- background-color: #C3E1FF;
-}
-.annotationRange.selectedLinkedGroup {
- background-color: #53D1FF;
-}
-.annotationLine {
-}
-.annotationLine.currentLine {
- background-color: #EAF2FE;
-}
diff --git a/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/orion-10.0/che/plugins/jsContentAssistPlugin.html b/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/orion-10.0/che/plugins/jsContentAssistPlugin.html
new file mode 100644
index 000000000..baf97eb72
--- /dev/null
+++ b/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/orion-10.0/che/plugins/jsContentAssistPlugin.html
@@ -0,0 +1,24 @@
+
+
+
+
+
+ External JavaScript proposals support for Orion
+
+
+
+
+ This plugin provides loading JavaScript content assist proposals over HTTP
+
+
diff --git a/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/orion-10.0/che/plugins/jsContentAssistPlugin.js b/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/orion-10.0/che/plugins/jsContentAssistPlugin.js
new file mode 100644
index 000000000..129c04409
--- /dev/null
+++ b/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/orion-10.0/che/plugins/jsContentAssistPlugin.js
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2014-2015 Codenvy, S.A.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Codenvy, S.A. - initial API and implementation
+ */
+window.onload = function () {
+
+ /**
+ * Plug-in headers
+ */
+ var headers = {
+ name: "External JavaScript proposals support for Orion",
+ version: "1.0",
+ description: "This plugin provides loading JavaScript content-assist proposals over HTTP."
+ };
+ var provider = new orion.PluginProvider(headers);
+
+ var contentAssistServiceProvider = {
+ computeProposals: function (buffer, offset, context) {
+ var proposalsURL = window.document.location.search.replace('?proposals=', '');
+ if (proposalsURL == undefined) {
+ return [];
+ }
+
+ return getContent(proposalsURL).then(function (proposalsContent) {
+ var newLineDelimiterRegExp = new RegExp(context.delimiter, 'g');
+
+ var keywords;
+ try {
+ keywords = JSON.parse(proposalsContent);
+ } catch(e) {
+ throw Error("Unable to parse proposals.json: " + e.message);
+ }
+
+ var prefixLength = context.prefix.length;
+ var proposals = [];
+ for (var i = 0; i < keywords.length; i++) {
+ var keyword = keywords[i];
+
+ // skip inappropriate proposals
+ if (keyword.proposal !== undefined && keyword.proposal.indexOf(context.prefix) != 0) {
+ continue;
+ }
+
+ var proposal = {
+ proposal: keyword.proposal,
+ description: keyword.description,
+ overwrite: true,
+ doc: keyword.doc
+ };
+ if (keyword.group == true) {
+ proposal.unselectable = true;
+ proposal.style = "noemphasis_title";
+ }
+ // indent multiline block
+ if (keyword.proposal !== undefined && keyword.proposal.indexOf(context.delimiter) > -1) {
+ proposal.proposal = keyword.proposal.replace(newLineDelimiterRegExp, context.delimiter + context.indentation)
+ }
+ if (keyword.escapePosition > 0) {
+ proposal.escapePosition = keyword.escapePosition + offset + context.indentation.length - prefixLength;
+ }
+ if (keyword.positions !== undefined) {
+ for (var j = 0; j < keyword.positions.length; j++) {
+ var pos = keyword.positions[j];
+ pos.offset = pos.offset + offset - prefixLength;
+ }
+ proposal.positions = keyword.positions;
+ }
+ proposals.push(proposal);
+ //}
+ }
+ return proposals;
+ }).catch(function (err) {
+ console.log(err.message);
+ });
+ }
+ };
+
+ var hoverServiceProvider = {
+ computeHoverInfo: function (editorContext, context) {
+ if (context.proposal !== undefined && context.proposal.doc !== undefined) {
+ return {
+ type: "markdown",
+ content: context.proposal.doc
+ };
+ } else {
+ return null;
+ }
+ }
+ };
+
+ var serviceProviderProps = {
+ name: "External proposals for JavaScript content assist",
+ contentType: ["application/javascript"]
+ };
+
+ provider.registerServiceProvider("orion.edit.contentAssist", contentAssistServiceProvider, serviceProviderProps);
+ provider.registerServiceProvider("orion.edit.hover", hoverServiceProvider, serviceProviderProps);
+ provider.connect();
+};
+
+function getContent(url) {
+ return new Promise(function (resolve, reject) {
+ var request = new XMLHttpRequest();
+ request.open('GET', url);
+
+ request.onload = function () {
+ if (this.status == 200) {
+ resolve(this.response);
+ } else {
+ reject(Error("Unable to get " + url + ": " + this.statusText));
+ }
+ };
+ // handle network errors
+ request.onerror = function () {
+ reject(Error("Unable to get " + url + ": " + this.statusText));
+ };
+
+ request.send();
+ });
+}
diff --git a/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/orion-10.0/code_edit/built-codeEdit-amd.min.js b/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/orion-10.0/code_edit/built-codeEdit-amd.min.js
new file mode 100644
index 000000000..7e1986d66
--- /dev/null
+++ b/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/orion-10.0/code_edit/built-codeEdit-amd.min.js
@@ -0,0 +1,19 @@
+!function(e,t){"function"==typeof define&&define.amd?define("orion/Deferred",t):"object"==typeof exports?module.exports=t():(e.orion=e.orion||{},e.orion.Deferred=t())}(this,function(){function e(){for(var e;e=o.shift();)e();s=!1}function t(e){o.push(e),s||(s=!0,a())}function n(e){return function(t){e(t)}}function i(e,t,i){try{var r=e(t),o=r&&("object"==typeof r||"function"==typeof r)&&r.then;if("function"==typeof o)if(r===i.promise)i.reject(new TypeError);else{var s=r.cancel;"function"==typeof s?i._parentCancel=s.bind(r):delete i._parentCancel,o.call(r,n(i.resolve),n(i.reject),n(i.progress))}else i.resolve(r)}catch(a){i.reject(a)}}function r(){function e(){for(var e;e=d.shift();){var t=e.deferred,n="fulfilled"===l?"resolve":"reject",r=e[n];"function"==typeof r?i(r,a,t):t[n](a)}}function n(n){delete h._parentCancel,l="rejected",a=n,d.length&&t(e)}function o(i){function s(e){return function(t){l&&"assumed"!==l||e(t)}}delete h._parentCancel;try{var c=i&&("object"==typeof i||"function"==typeof i)&&i.then;if("function"==typeof c)if(i===h)n(new TypeError);else{l="assumed";var u=i&&i.cancel;if("function"!=typeof u){var f=new r;i=f.promise;try{c(f.resolve,f.reject,f.progress)}catch(p){f.reject(p)}u=i.cancel,c=i.then}a=i,c.call(i,s(o),s(n)),h._parentCancel=u.bind(i)}else l="fulfilled",a=i,d.length&&t(e)}catch(g){s(n)(g)}}function s(){var e=h._parentCancel;if(e)delete h._parentCancel,e();else if(!l){var t=new Error("Cancel");t.name="Cancel",n(t)}}var a,l,d=[],h=this;this.resolve=function(e){return l||o(e),h},this.reject=function(e){return l||n(e),h},this.progress=function(e){return l||d.forEach(function(t){if(t.progress)try{t.progress(e)}catch(n){}}),h.promise},this.cancel=function(){return h._parentCancel?setTimeout(s,0):s(),h},this.then=function(n,i,o){var s=new r;return s._parentCancel=h.promise.cancel,d.push({resolve:n,reject:i,progress:o,deferred:s}),("fulfilled"===l||"rejected"===l)&&t(e),s.promise},this.promise={then:h.then,cancel:h.cancel}}var o=[],s=!1,a=function(){if("undefined"!=typeof process&&"function"==typeof process.nextTick){var t=process.nextTick;return function(){t(e)}}if("function"==typeof MutationObserver){var n=document.createElement("div"),i=new MutationObserver(e);return i.observe(n,{attributes:!0}),function(){n.setAttribute("class","_tick")}}return function(){setTimeout(e,0)}}();return r.all=function(e,t){function n(e,t){a||(s[e]=t,0===--o&&l.resolve(s))}function i(e,i){if(!a){if(t)try{return void n(e,t(i))}catch(r){i=r}l.reject(i)}}var o=e.length,s=[],a=!1,l=new r;return l.then(void 0,function(){a=!0,e.forEach(function(e){e.cancel&&e.cancel()})}),0===o?l.resolve(s):e.forEach(function(e,t){e.then(n.bind(void 0,t),i.bind(void 0,t))}),l.promise},r.when=function(e,t,n,i){var o,s;return e&&"function"==typeof e.then?o=e:(s=new r,s.resolve(e),o=s.promise),o.then(t,n,i)},r}),function(e){function t(){Error.apply(this,arguments)}function n(e,t,n){return e>=t&&n>=e}function i(e,t){var n=e||"utf-8";if("utf-8"!==n&&"utf8"!==n&&"unicode-1-1-utf-8"!==n)throw new TypeError("only utf-8 supported");Object.defineProperties(this,{encoding:{value:n,enumerable:!0},_fatal:{value:t&&t.fatal},_saved:{value:[],writable:!0},_checkBOM:{value:!0,writable:!0}})}function r(e){var t=e||"utf-8";if("utf-8"!==t&&"utf8"!==t&&"unicode-1-1-utf-8"!==t)throw new TypeError("only utf-8 supported");Object.defineProperties(this,{encoding:{value:t,enumerable:!0},_saved:{value:null,writable:!0}})}t.prototype=new Error,t.prototype.constructor=t,t.prototype.name="EncodingError",i.prototype.decode=function(e,i){function r(){if(this._fatal)throw this._saved.length=c=0,p=f,this._checkBOM=this._checkBOM||!h,new t;g[v++]=65533}e=e instanceof Uint8Array?e:new Uint8Array(e);var o,s,a,l,d,h=i&&i.stream,c=this._saved.length,u=e.length,f=0,p=0,g=new Uint16Array(u+c),v=0;if(this._checkBOM&&u)if(c+u>2){for(var m=c;3>m;m++)this._saved.push(e[f++]);239!==this._saved[0]||187!==this._saved[1]||191!==this._saved[2]?(f=0,this._saved.length=c):c=this._saved.length-=3,this._checkBOM=!1}else if(h)for(;u>f;)this._saved.push(e[f++]);for(;u>f;){if(o=c>0?this._saved[0]:e[f++],128>o)g[v++]=o;else if(n(o,194,223)){if(f===u)break;if(s=c>1?this._saved[1]:e[f++],!n(s,128,191)){r();continue}g[v++]=(31&o)<<6|63&s}else if(n(o,224,239)){if(f===u)break;if(s=c>1?this._saved[1]:e[f++],224===o&&!n(s,160,191)||237===o&&!n(s,128,159)||!n(s,128,191)){r();continue}if(f===u)break;if(a=c>2?this._saved[2]:e[f++],!n(a,128,191)){r();continue}g[v++]=(15&o)<<12|(63&s)<<6|63&a}else if(n(o,240,244)){if(f===u)break;if(s=c>1?this._saved[1]:e[f++],240===o&&!n(s,144,191)||244===o&&!n(s,128,143)||!n(s,128,191)){r();continue}if(f===u)break;if(a=c>2?this._saved[2]:e[f++],!n(a,128,191)){r();continue}if(f===u)break;if(l=e[f++],!n(l,128,191)){r();continue}d=65535&((7&o)<<18|(63&s)<<12|(63&a)<<6|63&l),g[v++]=d>>10|55296,g[v++]=1023&d|56320}else r();p=f,c&&(this._saved.length=c=0)}for(;p!==f;)this._saved.push(e[p++]);if(this._checkBOM=this._checkBOM||!h,!h&&0!==this._saved.length)throw new t;for(var _=[],y=0;v>y;y+=65536)_.push(String.fromCharCode.apply(null,g.subarray(y,Math.min(v,y+65536))));return _.join("")},r.prototype.encode=function(e,i){e=String(void 0!==e?e:"");for(var r,o,s,a=i&&i.stream,l=e.length,d=0,h=new Uint8Array(3*(l+(null===this._saved?0:1))),c=0;l>d;)if(null===this._saved?r=e.charCodeAt(d++):(r=this._saved,this._saved=null),128>r)h[c++]=r;else if(2048>r)h[c++]=192|r>>6,h[c++]=128|63&r;else if(55296>r||r>56319)h[c++]=224|r>>12,h[c++]=128|r>>6&63,h[c++]=128|63&r;else{if(!(l>d)){if(a){this._saved=r;break}throw new t}if(o=e.charCodeAt(d++),!n(o,56320,57343))throw new t;s=65536|(1023&r)<<10|1023&o,h[c++]=240|s>>18,h[c++]=128|s>>12&63,h[c++]=128|s>>6&63,h[c++]=128|63&s}if(!a&&null!==this._saved)throw new t;return h.buffer.slice?new Uint8Array(h.buffer.slice(0,c)):h.subarray(0,c)},e.TextDecoder=e.TextDecoder||i,e.TextEncoder=e.TextEncoder||r}("undefined"==typeof global?this||self:global),define("orion/encoding-shim",function(){}),function(){function e(e){if("string"!=typeof e)throw new TypeError}function t(e){return e?e.split("&"):[]}function n(e){return 0===e.length?"":e.join("&")}function i(e){var t=/([^=]*)(?:=?)(.*)/.exec(e),n=t[1]?decodeURIComponent(t[1]):"",i=t[2]?decodeURIComponent(t[2]):"";return[n,i]}function r(e){var t=encodeURIComponent(e[0]);return e[1]&&(t+="="+encodeURIComponent(e[1])),t}function o(e,n){var r="",o=[],s=0;return{next:function(){if(r!==e.query&&(r=e.query,o=t(r)),s1&&t.pop():"."!==e&&t.push(e)}),t.join("/")}function c(e){e.scheme&&(e.scheme=l(e.scheme)),e.port&&(e.port=d(e.port)),e.host&&e.path&&(e.path=h(e.path))}function u(e){return e.replace(/\s/g,function(e){return"%"+e.charCodeAt(0).toString(16)})}function f(e,t){if("string"!=typeof e)throw new TypeError;e=u(e);var n=_.exec(e);if(!n)return null;var i={};if(i.scheme=n[1]||"",i.scheme&&!w.test(i.scheme))return null;var r=n[2];if(r){var o=y.exec(r);if(i.userinfo=o[1],i.host=o[2],i.port=o[3],i.port&&!x.test(i.port))return null}return i.path=n[3],i.query=n[4],i.fragment=n[5],a(i,t),c(i),i}function p(e){var t=e.scheme?e.scheme+":":"";return e.host&&(t+="//",e.userinfo&&(t+=e.userinfo+"@"),t+=e.host,e.port&&(t+=":"+e.port)),t+=e.path,e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t}function g(e,t){var n;if(t){if(t=t.href||t,n=f(t),!n||!n.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:n})}var i=f(e,n);if(!i)throw new SyntaxError;Object.defineProperty(this,"_input",{value:e,writable:!0}),Object.defineProperty(this,"_url",{value:i,writable:!0});var r=new s(this);Object.defineProperty(this,"query",{get:function(){return this._url?r:null},enumerable:!0})}try{var v;if("function"==typeof self.URL&&0!==self.URL.length&&"http:"===(v=new self.URL("http://www.w3.org?q")).protocol&&v.query)return}catch(m){}var _=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,y=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,C=/^\S*$/,w=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,x=/^\d*$/,S=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,b=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,T=/^([^?#\s]*)$/,E=/^([^\s]*)$/,L=C,k=/([^:]*):?(.*)/,A="undefined"!=typeof StopIteration?StopIteration:new Error("Stop Iteration"),M={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(s.prototype,{get:{value:function(n){e(n);var r,o=t(this._url.query);return o.some(function(e){var t=i(e);return t[0]===n?(r=t[1],!0):void 0}),r},enumerable:!0},set:{value:function(o,s){e(o),e(s);var a=t(this._url.query),l=a.some(function(e,t){var n=i(e);return n[0]===o?(n[1]=s,a[t]=r(n),!0):void 0});l||a.push(r([o,s])),this._url.query=n(a)},enumerable:!0},has:{value:function(n){e(n);var r=t(this._url.query);return r.some(function(e){var t=i(e);return t[0]===n?!0:void 0})},enumerable:!0},"delete":{value:function(r){e(r);var o=t(this._url.query),s=o.filter(function(e){var t=i(e);return t[0]!==r});return s.length!==o.length?(this._url.query=n(s),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(e,t){if("function"!=typeof e)throw new TypeError;var n=o(this._url,"keys+values");try{for(;;){var i=n.next();e.call(t,i[1],i[0],this)}}catch(r){if(r!==A)throw r}},enumerable:!0},keys:{value:function(){return o(this._url,"keys")},enumerable:!0},values:{value:function(){return o(this._url,"values")},enumerable:!0},items:{value:function(){return o(this._url,"keys+values")}},size:{get:function(){return t(this._url.query).length},enumerable:!0},getAll:{value:function(n){e(n);var r=[],o=t(this._url.query);return o.forEach(function(e){var t=i(e);t[0]===n&&r.push(t[1])}),r},enumerable:!0},append:{value:function(i,o){e(i),e(o);var s=t(this._url.query);s.push(r([i,o])),this._url.query=n(s)},enumerable:!0}}),Object.defineProperties(g.prototype,{toString:{value:function(){return this.href}},href:{get:function(){return this._url?p(this._url):this._input},set:function(t){e(t),this._input=t,this._url=f(this._input,this._baseURL)},enumerable:!0},origin:{get:function(){return this._url&&this._url.host?this.protocol+"//"+this.host:""},enumerable:!0},protocol:{get:function(){return this._url?this._url.scheme+":":":"},set:function(t){if(e(t),this._url){var n=":"===t.slice(-1)?t.substring(0,t.length-1):t;(""===n||w.test(n))&&(this._url.scheme=l(n))}},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(t){e(t),this._url&&(this._url.userinfo=t)}},username:{get:function(){if(!this._url)return"";var e=k.exec(this._userinfo),t=decodeURIComponent(e[1]||"");return t},set:function(t){if(e(t),this._url){var n=k.exec(this._userinfo),i=[encodeURIComponent(t||"")];n[2]&&i.push(n[2]),this._userinfo=i.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var e=k.exec(this._userinfo),t=decodeURIComponent(e[2]||"");return t},set:function(t){if(e(t),this._url){var n=k.exec(this._userinfo),i=[n[1]||""];t&&i.push(encodeURIComponent(t)),this._userinfo=i.join(":")}},enumerable:!0},host:{get:function(){var e="";return this._url&&this._url.host&&(e+=this._url.host,this._url.port&&(e+=":"+this._url.port)),e},set:function(t){if(e(t),this._url){var n=b.exec(t);n&&(this._url.host=n[1],this._url.port=d(n[2]))}},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(t){if(e(t),this._url){var n=S.exec(t);n&&(this._url.host=t)}},enumerable:!0},port:{get:function(){var e=this._url?this._url.port||"":"";return e&&e===M[this.protocol]&&(e=""),e},set:function(t){if(e(t),this._url){var n=x.exec(t);n&&(this._url.port=d(t))}},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(t){if(e(t),this._url){var n=T.exec(t);n&&(this._url.host&&t&&"/"!==t[0]&&(t="/"+t),this._url.path=t?h(t):"")}},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(t){if(e(t),this._url){t&&"?"===t[0]&&(t=t.substring(1));var n=E.exec(t);n&&(this._url.query=t)}},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(t){if(e(t),this._url){t&&"#"===t[0]&&(t=t.substring(1));var n=L.exec(t);n&&(this._url.fragment=t)}},enumerable:!0}});var D=self.URL||self.webkitURL;D&&D.createObjectURL&&(Object.defineProperty(g,"createObjectURL",{value:D.createObjectURL.bind(D),enumerable:!1}),Object.defineProperty(g,"revokeObjectURL",{value:D.revokeObjectURL.bind(D),enumerable:!1})),self.URL=g}(),define("orion/URL-shim",function(){}),define("embeddedEditor/helper/embeddedFileImpl",["orion/Deferred","orion/encoding-shim","orion/URL-shim"],function(e){function t(e){this.fileBase=e,this.fileRoot={}}return t.prototype={fetchChildren:function(){return(new e).resolve([])},loadWorkspaces:function(){return(new e).resolve([])},loadWorkspace:function(){return(new e).resolve([])},createProject:function(){throw new Error("Not supported")},createFolder:function(){throw new Error("Not supported")},createFile:function(){throw new Error("Not supported")},moveFile:function(){throw new Error("Not supported")},copyFile:function(){throw new Error("Not supported")},remoteImport:function(){throw new Error("Not supported")},remoteExport:function(){throw new Error("Not supported")},writeBlob:function(){throw new Error("Not supported")},_getFile:function(e,t){var n=new URL(e),i=n.pathname;return!this.fileRoot[i]&&t&&(this.fileRoot[i]={Name:n.pathname.split("/").pop(),Location:i,LocalTimeStamp:Date.now(),ETag:0}),this.fileRoot[i]},read:function(t,n){var i=this._getFile(t);if(!i)return(new e).reject();if(n){var r={Length:i.length,Directory:!!i.Directory,LocalTimeStamp:i.LocalTimeStamp,ETag:i.ETag,Location:i.Location,Name:i.Name,Parents:[]};return(new e).resolve(r)}return(new e).resolve(i.contents)},write:function(t,n){var i=this._getFile(t,!0);return"string"==typeof n&&(i.ETag++,i.LocalTimeStamp=Date.now(),i.contents=n),(new e).resolve(n)},deleteFile:function(t){var n=new URL(t),i=n.pathname;return delete this.fileRoot[i],(new e).resolve()}},t.prototype.constructor=t,t}),define("orion/EventTarget",[],function(){function e(){this._namedListeners={}}return e.prototype={dispatchEvent:function(e){if(!e.type)throw new Error("unspecified type");var t=this._namedListeners[e.type];return t&&t.forEach(function(t){try{"function"==typeof t?t(e):t.handleEvent(e)}catch(n){"undefined"!=typeof console&&console.log(n)}}),!e.defaultPrevented},addEventListener:function(e,t){("function"==typeof t||t.handleEvent)&&(this._namedListeners[e]=this._namedListeners[e]||[],this._namedListeners[e].push(t))},removeEventListener:function(e,t){var n=this._namedListeners[e];if(n)for(var i=0;ir;r++){var s=n[r];if(s!==i[r])return!1;var a=e[s],l=t[s];if(a!==l&&JSON.stringify(a)!==JSON.stringify(l))return!1}return!0}function i(e){for(var t=Object.prototype.hasOwnProperty,n=1,i=arguments.length;i>n;n++){var r=arguments[n];for(var o in r)t.call(r,o)&&(e[o]=r[o])}return e}function r(e){if(-1===e.indexOf("://"))try{return new URL(e,location.href).href}catch(t){}return e}function o(e){function t(){return n=n||Object.keys(e)}var n=null,i={key:function(e){return t()[e]},getItem:function(t){return e[t]},setItem:function(t,i){e[t]=i,n=null},removeItem:function(t){delete e[t],n=null},clear:function(){t().forEach(function(t){delete e[t]}.bind(this)),n=null}};return Object.defineProperty(i,"length",{get:function(){return t().length}}),i}function s(e,t){if(t&&t instanceof XMLHttpRequest){var n,i;try{n=t.status,i=t.statusText}catch(r){n=0,i=""}return{status:n||0,statusText:i}}return t}function a(e){var t=e?JSON.parse(JSON.stringify(e,s)):e;return e instanceof Error&&(t.__isError=!0,t.message=t.message||e.message,t.name=t.name||e.name),t}function l(e,t){this.type=e,this.plugin=t}function d(e,t){this.__objectId=e,this.__methods=t}function h(i,r,o){function s(e){w&&o.postMessage(e,w)}function h(t){if(!w)return(new e).reject(new Error("plugin not connected"));t.id=String(D++);var n=new e;I[t.id]=n,n.then(null,function(e){"active"===A&&e instanceof Error&&"Cancel"===e.name&&s({requestId:t.id,method:"cancel",params:e.message?[e.message]:[]})});var i=Object.prototype.toString;return t.params.forEach(function(e,r){if("[object Object]"===i.call(e)&&!(e instanceof d)){var o,s;for(o in e)"[object Function]"===i.call(e[o])&&(s=s||[],s.push(o));if(s){var a=O++;R[a]=e;var l=function(){delete R[a]};n.then(l,l),t.params[r]=new d(a,s)}}}),o.postMessage(t,w),n.promise}function c(e,t){e||0===e?s({id:e,result:null,error:t}):console.log(t)}function u(e,t,n,i){i.forEach(function(e,t){if(e&&"undefined"!=typeof e.__objectId){var n={};e.__methods.forEach(function(t){n[t]=function(){return h({objectId:e.__objectId,method:t,params:Array.prototype.slice.call(arguments)})}}),i[t]=n}});var r="undefined"==typeof e?null:{id:e,result:null,error:null};try{var o=n.apply(t,i);if(!r)return;o&&"function"==typeof o.then?(N[e]=o,o.then(function(t){delete N[e],r.result=t,s(r)},function(t){N[e]&&(delete N[e],r.error=a(t),s(r))},function(){s({responseId:e,method:"progress",params:Array.prototype.slice.call(arguments)})})):(r.result=o,s(r))}catch(l){r&&(r.error=a(l),s(r))}}function f(e){try{if(e.method){var t=e.method,n=e.params||[];if("serviceId"in e){var i=B[e.serviceId];i?t in i?u(e.id,i,i[t],n):c(e.id,"method not found"):c(e.id,"service not found")}else if("objectId"in e){var r=R[e.objectId];r?t in r?u(e.id,r,r[t],n):c(e.id,"method not found"):c(e.id,"object not found")}else if("requestId"in e){var s=N[e.requestId];s&&"cancel"===t&&s.cancel&&s.cancel.apply(s,n)}else if("responseId"in e){var a=I[e.responseId];a&&"progress"===t&&a.progress&&a.progress.apply(a,n)}else if("loading"===e.method)w.loading();else if("plugin"===e.method){w.connected();var l=e.params[0];S({headers:l.headers,services:l.services}).then(function(){C&&C.resolve(_)})}else{if("timeout"!==e.method&&"error"!==e.method)throw new Error("Bad method: "+e.method);C&&C.reject(e.error)}}else if(e.id){var d=I[String(e.id)];if(d)if(delete I[String(e.id)],e.error){var h=o.handleServiceError(_,e.error);d.reject(h)}else d.resolve(e.result)}}catch(f){console.log("Plugin._messageHandler "+f)}}function p(e){var n={};if(e.methods&&(e.methods.forEach(function(t){n[t]=function(){var n={serviceId:e.serviceId,method:t,params:Array.prototype.slice.call(arguments)};return"active"===A?h(n):_.start({"transient":!0}).then(function(){return h(n)})}}),n.addEventListener&&n.removeEventListener)){var i=new t,r=O++;R[r]={handleEvent:i.dispatchEvent.bind(i)};var o=new d(r,["handleEvent"]),s=n.addEventListener;n.addEventListener=function(e,t){i._namedListeners[e]||s(e,o),i.addEventListener(e,t)};var a=n.removeEventListener;n.removeEventListener=function(e,t){i.removeEventListener(e,t),i._namedListeners[e]||a(e,o)}}return n}function g(e){var t=JSON.parse(JSON.stringify(e.properties));t.__plugin__=i;var n=e.names||e.type||[];return Array.isArray(n)||(n=[n]),t.objectClass=n,t}function v(e){var t=p(e),n=g(e),i=o.registerService(e.names||e.type,t,n);M[e.serviceId]={registration:i,proxy:t}}function m(){o.persist(i,{created:b,headers:T,services:E,autostart:L,lastModified:k})}var _=this;r=r||{};var y,C,w,x,S,b=r.created||(new Date).getTime(),T=r.headers||{},E=r.services||[],L=r.autostart,k=r.lastModified||0,A="installed",M={},D=0,O=0,N={},I={},R={},B={};this._default=!1,this._persist=m,this._resolve=function(){A="resolved",o.dispatchEvent(new l("resolved",_))},this._getAutostart=function(){return L},this._getCreated=function(){return b},this.getLocation=function(){return i},this.getHeaders=function(){return JSON.parse(JSON.stringify(T))},this.getName=function(){var e=this.getHeaders();return e?e.name||"":null},this.getVersion=function(){var e=this.getHeaders();return e?e.version||"0.0.0":null},this.getLastModified=function(){return k},this.getServiceReferences=function(){var e=[];return Object.keys(M).forEach(function(t){e.push(M[t].registration.getReference())}),e},this.setParent=function(t){return x!==t?(x=t,_.stop({"transient":!0}).then(function(){return"started"===L?_.start({"transient":!0}):"lazy"===L?_.start({lazy:!0,"transient":!0}):void 0})):(new e).resolve()},this.getState=function(){return A},this.getProblemLoading=function(){return _._problemLoading?!0:!1},this.start=function(t){if("uninstalled"===A)return(new e).reject(new Error("Plugin is uninstalled"));if(y)return y.promise.then(this.start.bind(this,t));if("active"===A)return(new e).resolve();if(!t||!t["transient"]){var n=t&&t.lazy?"lazy":"started";n!==L&&(L=n,m())}var r=o.getState();if("starting"!==r&&"active"!==r)return t["transient"]?(new e).reject(new Error("start transient error")):(new e).resolve();if("installed"===A)try{this._resolve()}catch(s){return(new e).reject(s)}if("resolved"===A&&E.forEach(function(e){v(e)}),t&&t.lazy){"starting"!==A&&(A="starting",o.dispatchEvent(new l("lazy activation",_)));var a=(new Date).getTime();return!this.getLastModified()||a>this.getLastModified()+864e5?this.update():(new e).resolve()}var d=new e;return y=d,A="starting",_._problemLoading=null,o.dispatchEvent(new l("starting",_)),C=new e,w=o.connect(i,f,x),C.then(function(){C=null,A="active",o.dispatchEvent(new l("started",_)),y=null,d.resolve()},function(e){C=null,A="stopping",o.dispatchEvent(new l("stopping",_)),Object.keys(M).forEach(function(e){M[e].registration.unregister(),delete M[e]}),o.disconnect(w),w=null,A="resolved",y=null,o.dispatchEvent(new l("stopped",_)),_._problemLoading=!0,d.reject(new Error("Failed to load plugin: "+i+(e&&e.message?"\n Reason: "+e.message:""))),_._default&&(k=0,m())}),d.promise},this.stop=function(t){if("uninstalled"===A)return(new e).reject(new Error("Plugin is uninstalled"));if(y)return y.promise.then(this.stop.bind(this,t));if(t&&t["transient"]||"stopped"!==L&&(L="stopped",m()),"active"!==A&&"starting"!==A)return(new e).resolve();var n=new e;return y=n,A="stopping",o.dispatchEvent(new l("stopping",_)),Object.keys(M).forEach(function(e){M[e].registration.unregister(),delete M[e]}),w&&(o.disconnect(w),w=null),A="resolved",y=null,o.dispatchEvent(new l("stopped",_)),n.resolve(),n.promise},S=function(t){if(_.problemLoading=null,"uninstalled"===A)return(new e).reject(new Error("Plugin is uninstalled"));if(!t)return 0===k&&(k=(new Date).getTime(),m()),o.loadManifest(i).then(S,function(){_._problemLoading=!0,_._default&&(k=0,m()),console.log("Failed to load plugin: "+i)});var r=T,s=E,a=L;if(T=t.headers||{},E=t.services||[],L=t.autostart||L,t.lastModified?k=t.lastModified:(k=(new Date).getTime(),m()),n(T,r)&&n(E,s)&&L===a)return(new e).resolve();if("active"===A||"starting"===A){var d=[];Object.keys(E).forEach(function(e){var t=E[e];d.push(e);var i=M[e];if(i){if(n(t.methods,Object.keys(i.proxy))){var r=g(t),o=i.registration.getReference(),s={};return o.getPropertyKeys().forEach(function(e){s[e]=o.getProperty(e)}),void(n(r,s)||i.registration.setProperties(r))}i.registration.unregister(),delete M[e]}v(t)}),Object.keys(M).forEach(function(e){-1===d.indexOf(e)&&(M[e].registration.unregister(),delete M[e])})}return"active"===A&&(o.disconnect(w),C=new e,w=o.connect(i,f,x),C.then(function(){C=null},function(){C=null,A="stopping",o.dispatchEvent(new l("stopping"),_),Object.keys(M).forEach(function(e){M[e].registration.unregister(),delete M[e]}),o.disconnect(w),w=null,A="resolved",o.dispatchEvent(new l("stopped",_))})),(new e).resolve()},this.update=function(e){return S(e).then(function(){o.dispatchEvent(new l("updated",_))})},this.uninstall=function(){return"uninstalled"===A?(new e).reject(new Error("Plugin is uninstalled")):"active"===A||"starting"===A||"stopping"===A?this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this)):(o.removePlugin(this),A="uninstalled",o.dispatchEvent(new l("uninstalled",_)),(new e).resolve())}}function c(n,s){function a(e,t){try{var n;if("undefined"==typeof e.useStructuredClone){var i="string"!=typeof t.data;n=i?t.data:JSON.parse(t.data),e.useStructuredClone=i}else n=e.useStructuredClone?t.data:JSON.parse(t.data);e.handler(n)}catch(r){}}function d(e){var t=e.source;w.some(function(n){return t===n.target?(a(n,e),!0):void 0})}s=s||{};var c=s.storage||localStorage;c.getItem||(c=o(c));var m,_=parseInt(c.getItem("pluginregistry.default.timeout"),10)||void 0,y="installed",C=[],w=[],x=new t,S={},b={registerService:n.registerService.bind(n),connect:function(e,t,n,i){function r(t){localStorage.pluginLogging&&console.log(t+"("+((new Date).getTime()-s._startTime)+"ms)="+e)}function o(e){r("timeout");var n=new Error(e);n.name="timeout",t({method:"timeout",error:n})}var s={handler:t,url:e};i=i||_,s._updateTimeout=function(){var t,n;if(!this._connected&&!this._closed)if(this._handshake){var r=0;w.forEach(function(e){e._connected||e._closed||(r+=1e3)}),t="Plugin handshake timeout for: "+e,n=this._loading?5e3:(i||6e4)+r}else t="Plugin load timeout for: "+e,n=i||15e3;this._loadTimeout&&clearTimeout(this._loadTimeout),this._loadTimeout=0,n&&(this._loadTimeout=setTimeout(o.bind(null,t),n))};var l=!(!e.match(f)||"undefined"==typeof Worker),d=!(!e.match(p)||"undefined"==typeof SharedWorker);if(localStorage.useSharedWorkers&&d||!e.match(p)||(e=e.replace(p,v),d=!1),localStorage.useWorkers&&l||!e.match(f)||(e=e.replace(f,g),l=d=!1),s.url=e,s._updateTimeout(),s._startTime=(new Date).getTime(),l){var h;d?(h=new SharedWorker(e),s.target=h.port,h.port.start(),s._close=function(){h.port.close()}):(h=new Worker(e),s.target=h,s._close=function(){h.terminate()}),s.postMessage=function(e){this.target.postMessage(this.useStructuredClone?e:JSON.stringify(e),[])},s.target.addEventListener("message",function(e){a(s,e)})}else{var c=document.createElement("iframe");c.name=e+"_"+s._startTime,c.src=e,c.onload=function(){r("handshake"),s._handshake=!0,s._updateTimeout()},c.sandbox="allow-scripts allow-same-origin allow-forms allow-popups",c.style.width=c.style.height="100%",c.frameBorder=0,(n||m).appendChild(c),s.target=c.contentWindow,s.postMessage=function(e){this.target.postMessage(this.useStructuredClone?e:JSON.stringify(e),this.url)},s._close=function(){if(c){var e=c.parentNode;e&&e.removeChild(c),c=null}}}return s.connected=function(){r("connected"),this._connected=!0,this._updateTimeout()},s.loading=function(){r("loading"),this._loading=!0,this._updateTimeout()},s.close=function(){r("closed"),this._closed=!0,this._updateTimeout(),this._close()},w.push(s),s},disconnect:function(e){for(var t=0;t0){for(var j=0;2>j;j++){for(var i=0;i<_all_script.length;i++)if(0===j){if("orion.codeEdit"===_all_script[i].id){_code_edit_script_source=_all_script[i].src;break}}else{var regex=/.*built-codeEdit.*.js/;if(_all_script[i].src&®ex.exec(_all_script[i].src)){_code_edit_script_source=_all_script[i].src;break}}if(_code_edit_script_source)break}_code_edit_script_source||(_code_edit_script_source=_all_script[_all_script.length-1].src)}define("embeddedEditor/helper/bootstrap",["embeddedEditor/helper/embeddedFileImpl","orion/serviceregistry","orion/pluginregistry","orion/Deferred","orion/URL-shim"],function(e,t,n,i){function r(r){if(o)return o;var l=document.createElement("div");l.id="_orion_hidden_actions",document.body.appendChild(l),l.style.display="none";var d=r&&r._defaultPlugins?r._defaultPlugins:a;o=new i;var h=new t.ServiceRegistry,c=new e(s);h.registerService("orion.core.file",c,{Name:"Embedded File System",top:s,pattern:s});var u={};d.forEach(function(e){var t=new URL(e,_code_edit_script_source);u[t.href]={autostart:"lazy"}}),d=r&&r.userPlugins?r.userPlugins:[],d.forEach(function(e){u[e]={autostart:"lazy"}});var f=new n.PluginRegistry(h,{storage:{},plugins:u});return f.start().then(function(){var e={serviceRegistry:h,pluginRegistry:f};return o.resolve(e),e})}var o,s="/__embed/",a=["../javascript/plugins/javascriptPlugin.html","../webtools/plugins/webToolsPlugin.html","../plugins/embeddedToolingPlugin.html"];return{startup:r}}),define("orion/editor/eventTarget",[],function(){function e(){}return e.addMixin=function(t){var n=e.prototype;for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},e.prototype={addEventListener:function(e,t,n){this._eventTypes||(this._eventTypes={});var i=this._eventTypes[e];i||(i=this._eventTypes[e]={level:0,listeners:[]});var r=i.listeners;r.push({listener:t,useCapture:n})},dispatchEvent:function(e){var t=e.type;this._dispatchEvent("pre"+t,e),this._dispatchEvent(t,e),this._dispatchEvent("post"+t,e)},_dispatchEvent:function(e,t){var n=this._eventTypes?this._eventTypes[e]:null;if(n){var i=n.listeners;try{if(n.level++,i)for(var r=0,o=i.length;o>r;r++)if(i[r]){var s=i[r].listener;"function"==typeof s?s.call(this,t):s.handleEvent&&"function"==typeof s.handleEvent&&s.handleEvent(t)}}finally{if(n.level--,n.compact&&0===n.level){for(var a=i.length-1;a>=0;a--)i[a]||i.splice(a,1);0===i.length&&delete this._eventTypes[e],n.compact=!1}}}},isListening:function(e){return this._eventTypes?void 0!==this._eventTypes[e]:!1},removeEventListener:function(e,t,n){if(this._eventTypes){var i=this._eventTypes[e];if(i){for(var r=i.listeners,o=0,s=r.length;s>o;o++){var a=r[o];if(a&&a.listener===t&&a.useCapture===n){0!==i.level?(r[o]=null,i.compact=!0):r.splice(o,1);break}}0===r.length&&delete this._eventTypes[e]}}}},{EventTarget:e}}),define("orion/regex",[],function(){function e(e){return e.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")}function t(e){var t=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(e);return t?{pattern:t[1],flags:t[2]}:null}return{escape:e,parse:t}}),define("orion/util",[],function(){function e(e){var t=arguments;return e.replace(/\$\{([^\}]+)\}/g,function(e,n){return t[(n<<0)+1]})}function t(e,t){return e.createElementNS?e.createElementNS(_,t):e.createElement(t)}var n=navigator.userAgent,i=-1!==n.indexOf("MSIE")||-1!==n.indexOf("Trident")?document.documentMode:void 0,r=parseFloat(n.split("Firefox/")[1]||n.split("Minefield/")[1])||void 0,o=-1!==n.indexOf("Opera")?parseFloat(n.split("Version/")[1]):void 0,s=parseFloat(n.split("Chrome/")[1])||void 0,a=-1!==n.indexOf("Safari")&&!s,l=parseFloat(n.split("WebKit/")[1])||void 0,d=-1!==n.indexOf("Android"),h=-1!==n.indexOf("iPad"),c=-1!==n.indexOf("iPhone"),u=h||c,f=-1!==navigator.platform.indexOf("Mac"),p=-1!==navigator.platform.indexOf("Win"),g=-1!==navigator.platform.indexOf("Linux"),v="undefined"!=typeof document&&"ontouchstart"in document.createElement("input"),m=p?"\r\n":"\n",_="http://www.w3.org/1999/xhtml";return{formatMessage:e,createElement:t,isIE:i,isFirefox:r,isOpera:o,isChrome:s,isSafari:a,isWebkit:l,isAndroid:d,isIPad:h,isIPhone:c,isIOS:u,isMac:f,isWindows:p,isLinux:g,isTouch:v,platformDelimiter:m}}),define("orion/editor/textModel",["orion/editor/eventTarget","orion/regex","orion/util"],function(e,t,n){function i(e,t){this._lastLineIndex=-1,this._text=[""],this._lineOffsets=[0],this.setText(e),this.setLineDelimiter(t)}return i.prototype={destroy:function(){},find:function(e){this._text.length>1&&(this._text=[this._text.join("")]);var n=e.string,i=e.regex,r=n,o="",s=e.caseInsensitive;if(r)if(i){var a=t.parse(r);a&&(r=a.pattern,o=a.flags)}else r=n.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&"),s&&(r=r.replace(/[iI\u0130\u0131]/g,"[Iiİı]"));var l,d=null;if(r){var h=e.reverse,c=e.wrap,u=e.wholeWord,f=e.start||0,p=e.end,g=null!==p&&void 0!==p;-1===o.indexOf("g")&&(o+="g"),-1===o.indexOf("m")&&(o+="m"),s&&-1===o.indexOf("i")&&(o+="i"),u&&(r="\\b"+r+"\\b");var v,m,_=this._text[0],y=0;if(g){var C=p>f?f:p,w=p>f?p:f;_=_.substring(C,w),y=C}var x=new RegExp(r,o);h?l=function(){var e=null;for(x.lastIndex=0;;){if(m=x.lastIndex,v=x.exec(_),m===x.lastIndex)return null;if(!v)break;if(v.index+y=0&&n>e))return null;var i=this._lineOffsets[e];if(n>e+1){var r=this.getText(i,this._lineOffsets[e+1]);if(t)return r;for(var o,s=r.length;10===(o=r.charCodeAt(s-1))||13===o;)s--;return r.substring(0,s)}return this.getText(i)},getLineAtOffset:function(e){var t=this.getCharCount();if(!(e>=0&&t>=e))return-1;var n=this.getLineCount();if(e===t)return n-1;var i,r,o=this._lastLineIndex;if(o>=0&&n>o&&(i=this._lineOffsets[o],r=n>o+1?this._lineOffsets[o+1]:t,e>=i&&r>e))return o;for(var s=n,a=-1;s-a>1;)if(o=Math.floor((s+a)/2),i=this._lineOffsets[o],r=n>o+1?this._lineOffsets[o+1]:t,i>=e)s=o;else{if(r>e){s=o;break}a=o}return this._lastLineIndex=s,s},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(e,t){var n=this.getLineCount();if(!(e>=0&&n>e))return-1;if(n>e+1){var i=this._lineOffsets[e+1];if(t)return i;for(var r,o=this.getText(Math.max(this._lineOffsets[e],i-2),i),s=o.length;10===(r=o.charCodeAt(s-1))||13===r;)s--;return i-(o.length-s)}return this.getCharCount()},getLineStart:function(e){return e>=0&&e=e));)i+=n,r++;for(var o=i,s=r;r=t));)i+=n,r++;var a=i,l=r;if(s===l)return this._text[s].substring(e-o,t-a);var d=this._text[s].substring(e-o),h=this._text[l].substring(0,t-a);return d+this._text.slice(s+1,l).join("")+h},onChanging:function(e){return this.dispatchEvent(e)},onChanged:function(e){return this.dispatchEvent(e)},setLineDelimiter:function(e,t){if("auto"===e&&(e=void 0,this.getLineCount()>1&&(e=this.getText(this.getLineEnd(0),this.getLineEnd(0,!0)))),this._lineDelimiter=e?e:n.platformDelimiter,t){var i=this.getLineCount();if(i>1){for(var r=new Array(i),o=0;i>o;o++)r[o]=this.getLine(o);this.setText(r.join(this._lineDelimiter))}}},setText:function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=0),void 0===n&&(n=this.getCharCount()),t!==n||""!==e){for(var i=this.getLineAtOffset(t),r=this.getLineAtOffset(n),o=t,s=n-t,a=r-i,l=e.length,d=0,h=this.getLineCount(),c=0,u=0,f=0,p=[];;){if(-1!==c&&f>=c&&(c=e.indexOf("\r",f)),-1!==u&&f>=u&&(u=e.indexOf("\n",f)),-1===u&&-1===c)break;f=-1!==c&&-1!==u?c+1===u?u+1:(u>c?c:u)+1:-1!==c?c+1:u+1,p.push(t+f),d++}var g={type:"Changing",text:e,start:o,removedCharCount:s,addedCharCount:l,removedLineCount:a,addedLineCount:d};if(this.onChanging(g),0===p.length){var v,m=this.getLineStart(i);v=h>r+1?this.getLineStart(r+1):this.getCharCount(),t!==m&&(e=this.getText(m,t)+e,t=m),n!==v&&(e+=this.getText(n,v),n=v)}for(var _=l-s,y=i+a+1;h>y;y++)this._lineOffsets[y]+=_;var C,w=5e4,x=w;if(p.length=t));)T+=b,E++;for(var L=T,k=E;E=n));)T+=b,E++;var A=T,M=E,D=this._text[k],O=this._text[M],N=D.substring(0,t-L),I=O.substring(n-A),R=[k,M-k+1];N&&R.push(N),e&&R.push(e),I&&R.push(I),Array.prototype.splice.apply(this._text,R),0===this._text.length&&(this._text=[""]);var B={type:"Changed",start:o,removedCharCount:s,addedCharCount:l,removedLineCount:a,addedLineCount:d};this.onChanged(B)}}},e.EventTarget.addMixin(i.prototype),{TextModel:i}}),define("orion/editor/undoStack",[],function(){function e(e,t,n,i,r){this.model=e,this.offset=t,this.text=n,this.previousText=i,this.type=r}function t(e){this.owner=e,this.changes=[]}function n(e,t){this.size=void 0!==t?t:100,this.reset();var n=this;if(this._listener={onChanging:function(e){n._onChanging(e)},onDestroy:function(e){n._onDestroy(e)}},e.getModel){var i=e.getModel();i.getBaseModel&&(i=i.getBaseModel()),this.model=i,this.setView(e)}else this.shared=!0,this.model=e;this.model.addEventListener("Changing",this._listener.onChanging)}return e.prototype={getRedoChanges:function(){return[{start:this.offset,end:this.offset+this.previousText.length,text:this.text}]},getUndoChanges:function(){return[{start:this.offset,end:this.offset+this.text.length,text:this.previousText}]},undo:function(e,t){return this._doUndoRedo(this.offset,this.previousText,this.text,e,t),!0},redo:function(e,t){return this._doUndoRedo(this.offset,this.text,this.previousText,e,t),!0},merge:function(e,t,n,i,r){if(i===this.type){if(1===i&&e===this.offset+this.text.length)return this.text+=t,!0;if(-1===i&&r===this.offset)return this.offset=e,this.previousText=n+this.previousText,!0;if(-1===i&&e===this.offset)return this.previousText=this.previousText+n,!0}return!1},_doUndoRedo:function(e,t,n,i,r){if(this.model.setText(t,e,e+n.length),r&&i){var o=i.getModel();o!==this.model&&(e=o.mapOffset(e,!0)),i.setSelection(e,e+t.length)}}},t.prototype={getRedoChanges:function(){for(var e=[],t=0;t=0;t--)e=e.concat(this.changes[t].getUndoChanges());return e},add:function(e){this.changes.push(e)},end:function(e){e&&(this.endSelection=e.getSelections());var t=this.owner;t&&t.end&&t.end()},undo:function(e,t){this.changes.length>1&&e&&e.setRedraw(!1);for(var n=this.changes.length-1;n>=0;n--)this.changes[n].undo(e,!1);t&&e&&e.setSelections(this.startSelection),this.changes.length>1&&e&&e.setRedraw(!0);var i=this.owner;return i&&i.undo&&i.undo(),this.changes.length>0},redo:function(e,t){this.changes.length>1&&e&&e.setRedraw(!1);for(var n=0;n1,e&&e.setRedraw(!0);var i=this.owner;return i&&i.redo&&i.redo(),this.changes.length>0},merge:function(e,t,n,i,r,o){var s=this.changes.length;return s>0&&this===o?this.changes[s-1].merge(e,t,n,i,r):!1},start:function(e){e&&(this.startSelection=e.getSelections());var t=this.owner;t&&t.start&&t.start()}},n.prototype={destroy:function(){this._onDestroy()},add:function(e){if(this.compoundChange)this.compoundChange.add(e);else{var t=this.stack.length;this.stack.splice(this.index,t-this.index,e),this.index++,this.stack.length>this.size&&(this.stack.shift(),this.index--)}},markClean:function(){this._commitUndo(),this.cleanChange=this.stack[this.index-1],this.cleanChange&&(this.cleanChange.type=2)},isClean:function(){return this.cleanChange===this.stack[this.index-1]},canUndo:function(){return this.index>0},canRedo:function(){return this.stack.length-this.index>0},endCompoundChange:function(){this.compoundChange&&this.compoundChange.end(this.view),this.compoundChange=void 0},getSize:function(){return{undo:this.index,redo:this.stack.length-this.index}},getRedoChanges:function(){this._commitUndo();for(var e=[],t=this.index;t=0;t--)e=e.concat(this.stack[t].getUndoChanges());return e},undo:function(){this._commitUndo();var e,t=!1;this._ignoreUndo=!0;do{if(this.index<=0)break;e=this.stack[--this.index]}while(!(t=e.undo(this.view,!0)));return this._ignoreUndo=!1,t},redo:function(){this._commitUndo();var e,t=!1;this._ignoreUndo=!0;do{if(this.index>=this.stack.length)break;e=this.stack[this.index++]}while(!(t=e.redo(this.view,!0)));return this._ignoreUndo=!1,t},reset:function(){this.index=0,this.cleanChange=void 0,this.stack=[],this._ignoreUndo=!1,this._compoundChange=void 0},setView:function(e){this.view!==e&&(this.view&&e.removeEventListener("Destroy",this._listener.onDestroy),this.view=e,this.view&&e.addEventListener("Destroy",this._listener.onDestroy))},startCompoundChange:function(e){this._commitUndo();var n=new t(e);return this.add(n),this.compoundChange=n,this.compoundChange.start(this.view),this.compoundChange},_commitUndo:function(){this.endCompoundChange()},_onDestroy:function(e){e&&this.shared||this.model.removeEventListener("Changing",this._listener.onChanging),this.view&&(this.view.removeEventListener("Destroy",this._listener.onDestroy),this.view=null)},_trackUnsavedChanges:function(e){if(this._unsavedChanges){var t=this._unsavedChanges.length,n=e.addedCharCount,i=e.removedCharCount,r=e.start,o=e.start+i,s=0;if(0===n?s=-1:0===i&&(s=1),t>0&&s===this._previousChangeType){var a=this._unsavedChanges[t-1];if(0===i&&r===a.end+a.text.length)return void(a.text+=e.text);if(0===e.addedCharCount&&o===a.start)return void(a.start=r)}this._previousChangeType=s,this._unsavedChanges.push({start:r,end:o,text:e.text})}},_onChanging:function(t){if(this._trackUnsavedChanges(t),!this._ignoreUndo){var n=t.text,i=t.start,r=t.addedCharCount,o=t.removedCharCount,s=i+o,a=0;0===r&&1===o?a=-1:1===r&&0===o&&(a=1);var l=this.stack.length,d=this.model.getText(i,s);if(l>0&&this.index===l){var h=this.stack[l-1];if(h.merge(i,n,d,a,s,this.compoundChange))return}this.add(new e(this.model,i,n,d,a))}}},{UndoStack:n}}),define("orion/webui/littlelib",["orion/util"],function(e){function t(e,t){return t||(t=document),t.querySelector(e)}function n(e,t){return t||(t=document),t.querySelectorAll(e)}function i(e,t){return Array.prototype.slice.call(n(e,t))}function r(e){var t=e;return"string"==typeof e&&(t=document.getElementById(e)),t}function o(e,t){if(!e||!t)return!1;if(e===t)return!0;var n=e.compareDocumentPosition(t);return Boolean(16&n)}function s(e){var t=e.getBoundingClientRect(),n=Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),i=Math.max(document.documentElement.scrollTop,document.body.scrollTop);return{left:t.left+n,top:t.top+i,width:t.width,height:t.height}}function a(e){for(;e.hasChildNodes();){var t=e.firstChild;e.removeChild(t)}}function l(t){var n=t.tabIndex;if(0===n&&e.isIE){var i={a:!0,body:!0,button:!0,frame:!0,iframe:!0,img:!0,input:!0,isindex:!0,object:!0,select:!0,textarea:!0};i[t.nodeName.toLowerCase()]||t.attributes.tabIndex||(n=-1)}return n}function d(e){if(l(e)>=0)return e;if(e.hasChildNodes())for(var t=0;t=0)return e;if(e.hasChildNodes())for(var t=e.childNodes.length-1;t>=0;t--){var n=h(e.childNodes[t]);if(n)return n}return null}function c(e,t){if(3===e.nodeType){var n=x.exec(e.nodeValue);n&&n.length>1&&t(e,n)}if(e.hasChildNodes())for(var i=0;i2&&-1!==o.indexOf("px",o.length-2)){o=o.slice(0,-2);var s=parseInt(o,10);return s!==s?0:s}}return 0}function f(e,t){c(e,function(e,n){var i=t[n[1]]||n[1];e.parentNode.replaceChild(document.createTextNode(i),e)})}function p(e,t){c(e,function(e,n){var i=t[n[1]];if(i){var r=document.createRange(),o=n.index;r.setStart(e,o),r.setEnd(e,o+n[0].length),r.deleteContents(),r.insertNode(i)}})}function g(t,n){function i(e){S.forEach(function(t){var n=!1,i=t.excludeNodes.some(function(t){return document.body.contains(t)?(n=!0,t.contains(e.target)):!1});if(n&&!i)try{t.dismiss(e)}catch(r){"undefined"!=typeof console&&console&&console.error(r&&r.message)}}),S=S.filter(function(e){return e.excludeNodes.some(function(e){return document.body.contains(e)})})}null===S&&(S=[],document.addEventListener("click",i,!0),e.isIOS&&document.addEventListener("touchend",function(e){function t(){e.target.removeEventListener("click",t)}0===e.touches.length&&e.target.addEventListener("click",t)},!1)),S.push({excludeNodes:t,dismiss:n})}function v(e){S=S.filter(function(t){return e!==t.dismiss})}function m(e){for(var t=e.parentNode,n=document.documentElement;t&&t!==n;){var i=window.getComputedStyle(t,null);if(!i)break;var r=i.getPropertyValue("overflow-y");if("auto"===r||"scroll"===r)break;t=t.parentNode}return t}function _(e){window.document.all&&(e.keyCode=0),e.preventDefault&&(e.preventDefault(),e.stopPropagation())}function y(e){for(var t=document.getElementsByTagName("iframe"),n=0;n1?n.children:n.firstChild}var x=/\$\{([^\}]+)\}/,S=null,b={BKSPC:8,TAB:9,ENTER:13,SHIFT:16,CONTROL:17,ALT:18,ESCAPE:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DEL:46,COMMAND:991},T=Object.create(null);return Object.keys(b).forEach(function(e){T[b[e]]=e}),{$:t,$$:n,$$array:i,node:r,contains:o,bounds:s,empty:a,firstTabbable:d,lastTabbable:h,pixelValueOf:u,stop:_,processTextNodes:f,processDOMNodes:p,addAutoDismiss:g,setFramesEnabled:y,getOffsetParent:m,removeAutoDismiss:v,keyName:C,KEY:b,createNodes:w}}),define("orion/commandsProxy",["orion/util","orion/webui/littlelib"],function(e,t){function n(t,n){function i(t){if(e.isMac){if(t.metaKey&&!t.altKey)return t.shiftKey||t.ctrlKey||65!==t.keyCode&&67!==t.keyCode&&86!==t.keyCode&&88!==t.keyCode&&90!==t.keyCode?!1:!0;if(t.ctrlKey)return!1}else{if(t.ctrlKey&&!t.altKey)return t.shiftKey||65!==t.keyCode&&67!==t.keyCode&&86!==t.keyCode&&88!==t.keyCode&&90!==t.keyCode?!1:!0;if(t.altKey&&!t.ctrlKey)return!1;if(t.ctrlKey&&t.altKey)return!1}if(t["char"])return t["char"].length>0;if(t.charCode||t.keyCode){var n=t.charCode||t.keyCode;switch(n){case 8:case 9:case 13:case 46:return!0;default:return n>=32&&112>n||n>123}}return!1}if(t=t||window.event,i(t)){if("true"===t.target.contentEditable)return;var r=t.target.nodeName.toLowerCase();if("input"===r){var o=t.target.type.toLowerCase();switch(o){case"text":case"password":case"search":case"color":case"date":case"datetime":case"datetime-local":case"email":case"month":case"number":case"range":case"tel":case"time":case"url":case"week":return}}else if("textarea"===r)return}n(t)}function i(){this._init()}return i.prototype={destroy:function(){this._listener&&(document.removeEventListener("keydown",this._listener),this._listener=null)},setProxy:function(e){this.proxy=e},setKeyBindings:function(e){this.bindings=e},_init:function(){var e=this;document.addEventListener("keydown",this._listener=function(i){return n(i,function(n){var i=e.proxy,r=e.bindings;if(r&&i)for(var o=0;o0){this._boundAutoDismiss&&e.removeAutoDismiss(this._boundAutoDismiss),this._boundAutoDismiss=this._autoDismiss.bind(this);var r=e.$$array(".dropdownSubMenu",this._dropdownNode);e.addAutoDismiss([this._triggerNode].concat(r),this._boundAutoDismiss),this._triggerNode.classList.add("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.add(this._selectionClass),this._dropdownNode.classList.add("dropdownMenuOpen"),this._isVisible=!0,this._positionDropdown(t),this._focusDropdownNode(),n=!0,this._parentDropdown&&this._parentDropdown.submenuOpen(this)}}return n},_focusDropdownNode:function(){this._dropdownNode.focus()},_autoDismiss:function(e){if(this.close(!1)&&this._dropdownNode.contains(e.target))for(var t=this._parentDropdown;t;)t.close(!1),t=t._parentDropdown},_positionDropdown:function(){if(this._dropdownNode.style.left="",this._dropdownNode.style.top="",this._positioningNode)return void(this._dropdownNode.style.left=this._positioningNode.offsetLeft+"px");var t=e.bounds(this._dropdownNode),n=e.bounds(document.body);if(t.left+t.width>n.left+n.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-t.width+"px";else{var i=e.bounds(this._boundingNode(this._triggerNode)),r=e.bounds(this._triggerNode);this._dropdownNode.style.left=r.left-i.left-t.width+r.width+"px"}var o=t.top+t.height-(n.top+n.height);o>0&&(this._dropdownNode.style.top=Math.floor(this._dropdownNode.style.top-o)+"px")},_boundingNode:function(e){var t=window.getComputedStyle(e,null);if(null===t)return e;var n=t.getPropertyValue("position");return"absolute"!==n&&e.parentNode&&e!==document.body?this._boundingNode(e.parentNode):e},close:function(t){var n=!1;return this.isVisible()&&(this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),e.setFramesEnabled(!0),t&&this._triggerNode.focus(),this._isVisible=!1,this._selectedItem&&(this._selectedItem.classList.remove("dropdownMenuItemSelected"),this._selectedItem=null),this._boundAutoDismiss&&(e.removeAutoDismiss(this._boundAutoDismiss),this._boundAutoDismiss=null),n=!0),n},getItems:function(){var t=e.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0),n=[],i=this;return t.forEach(function(e){e.parentNode.parentNode===i._dropdownNode&&n.push(e)}),n.forEach(function(t){t._hasDropdownMouseover||(t.addEventListener("mouseover",function(n){t.dropdown?t.dropdown.open(n):(i._closeSelectedSubmenu(),e.stop(n)),i._selectItem(t)}),t._hasDropdownMouseover=!0)}),n},empty:function(){var t=e.$$array("li",this._dropdownNode),n=this;t.forEach(function(e){e.parentNode===n._dropdownNode&&e.parentNode.removeChild(e)})},_dropdownKeyDown:function(t){if(t.keyCode===e.KEY.UP||t.keyCode===e.KEY.DOWN||t.keyCode===e.KEY.RIGHT||t.keyCode===e.KEY.ENTER||t.keyCode===e.KEY.LEFT){var n=this.getItems();if(n.length&&n.length>0){if(this._selectedItem){var i=n.indexOf(this._selectedItem);0>i&&(i=n.indexOf(this._selectedItem.parentNode)),i>=0&&(t.keyCode===e.KEY.UP&&i>0?(i--,this._selectItem(n[i])):t.keyCode===e.KEY.DOWN&&i/im,l=/]*>\s*([\s\S]+)\s*<\/body>/im,d="undefined"!=typeof location&&location.href,h=d&&location.protocol&&location.protocol.replace(/\:/,""),c=d&&location.hostname,u=d&&(location.port||void 0),f={},p=e.config&&e.config()||{};return t={version:"2.0.12",strip:function(e){if(e){e=e.replace(a,"");var t=e.match(l);t&&(e=t[1])}else e="";return e},jsEscape:function(e){return e.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:p.createXhr||function(){var e,t,n;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!=typeof ActiveXObject)for(t=0;3>t;t+=1){n=s[t];try{e=new ActiveXObject(n)}catch(i){}if(e){s=[n];break}}return e},parseName:function(e){var t,n,i,r=!1,o=e.indexOf("."),s=0===e.indexOf("./")||0===e.indexOf("../");return-1!==o&&(!s||o>1)?(t=e.substring(0,o),n=e.substring(o+1,e.length)):t=e,i=n||t,o=i.indexOf("!"),-1!==o&&(r="strip"===i.substring(o+1),i=i.substring(0,o),n?n=i:t=i),{moduleName:t,ext:n,strip:r}
+},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(e,n,i,r){var o,s,a,l=t.xdRegExp.exec(e);return l?(o=l[2],s=l[3],s=s.split(":"),a=s[1],s=s[0],!(o&&o!==n||s&&s.toLowerCase()!==i.toLowerCase()||(a||s)&&a!==r)):!0},finishLoad:function(e,n,i,r){i=n?t.strip(i):i,p.isBuild&&(f[e]=i),r(i)},load:function(e,n,i,r){if(r&&r.isBuild&&!r.inlineText)return void i();p.isBuild=r&&r.isBuild;var o=t.parseName(e),s=o.moduleName+(o.ext?"."+o.ext:""),a=n.toUrl(s),l=p.useXhr||t.useXhr;return 0===a.indexOf("empty:")?void i():void(!d||l(a,h,c,u)?t.get(a,function(n){t.finishLoad(e,o.strip,n,i)},function(e){i.error&&i.error(e)}):n([s],function(e){t.finishLoad(o.moduleName+"."+o.ext,o.strip,e,i)}))},write:function(e,n,i){if(f.hasOwnProperty(n)){var r=t.jsEscape(f[n]);i.asModule(e+"!"+n,"define(function () { return '"+r+"';});\n")}},writeFile:function(e,n,i,r,o){var s=t.parseName(n),a=s.ext?"."+s.ext:"",l=s.moduleName+a,d=i.toUrl(s.moduleName+a)+".js";t.load(l,i,function(){var n=function(e){return r(d,e)};n.asModule=function(e,t){return r.asModule(e,d,t)},t.write(e,l,n,o)},o)}},"node"===p.env||!p.env&&"undefined"!=typeof process&&process.versions&&process.versions.node&&!process.versions["node-webkit"]?(n=require.nodeRequire("fs"),t.get=function(e,t,i){try{var r=n.readFileSync(e,"utf8");0===r.indexOf("")&&(r=r.substring(1)),t(r)}catch(o){i&&i(o)}}):"xhr"===p.env||!p.env&&t.createXhr()?t.get=function(e,n,i,r){var o,s=t.createXhr();if(s.open("GET",e,!0),r)for(o in r)r.hasOwnProperty(o)&&s.setRequestHeader(o.toLowerCase(),r[o]);p.onXhr&&p.onXhr(s,e),s.onreadystatechange=function(){var t,r;4===s.readyState&&(t=s.status||0,t>399&&600>t?(r=new Error(e+" HTTP status: "+t),r.xhr=s,i&&i(r)):n(s.responseText),p.onXhrComplete&&p.onXhrComplete(s,e))},s.send(null)}:"rhino"===p.env||!p.env&&"undefined"!=typeof Packages&&"undefined"!=typeof java?t.get=function(e,t){var n,i,r="utf-8",o=new java.io.File(e),s=java.lang.System.getProperty("line.separator"),a=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(o),r)),l="";try{for(n=new java.lang.StringBuffer,i=a.readLine(),i&&i.length()&&65279===i.charAt(0)&&(i=i.substring(1)),null!==i&&n.append(i);null!==(i=a.readLine());)n.append(s),n.append(i);l=String(n.toString())}finally{a.close()}t(l)}:("xpconnect"===p.env||!p.env&&"undefined"!=typeof Components&&Components.classes&&Components.interfaces)&&(i=Components.classes,r=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),o="@mozilla.org/windows-registry-key;1"in i,t.get=function(e,t){var n,s,a,l={};o&&(e=e.replace(/\//g,"\\")),a=new FileUtils.File(e);try{n=i["@mozilla.org/network/file-input-stream;1"].createInstance(r.nsIFileInputStream),n.init(a,1,0,!1),s=i["@mozilla.org/intl/converter-input-stream;1"].createInstance(r.nsIConverterInputStream),s.init(n,"utf-8",n.available(),r.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),s.readString(n.available(),l),s.close(),n.close(),t(l.value)}catch(d){throw new Error((a&&a.path||"")+": "+d)}}),t}),define("text!orion/webui/dropdowntriggerbutton.html",[],function(){return'${ButtonText} '}),define("text!orion/webui/dropdowntriggerbuttonwitharrow.html",[],function(){return'${ButtonText} '}),define("text!orion/webui/checkedmenuitem.html",[],function(){return' '}),define("orion/webui/tooltip",["orion/webui/littlelib"],function(e){function t(e){this._init(e)}return t.prototype={_init:function(t){if(this._node=e.node(t.node),!this._node)throw"no dom node for tooltip found";this._position=t.position||["right","above","below","left"],this._text=t.text,this._hideDelay=void 0===t.hideDelay?200:t.hideDelay,this._tailSize=t.tailSize||10,this._trigger=t.trigger||"mouseover",this._afterShowing=t.afterShowing,this._afterHiding=t.afterHiding;var n=this;if("click"===this._trigger)this._showDelay=0,this._node.addEventListener("click",this._clickHandler=function(t){t.target===n._node&&(n.show(),e.stop(t))},!1);else if("mouseover"===this._trigger){this._showDelay=void 0===t.showDelay?500:t.showDelay;var i=["mouseout","click"];this._node.addEventListener("mouseover",this._mouseoverHandler=function(t){e.contains(n._node,t.target)&&(n.show(),e.stop(t))},!1),this._leaveHandler=function(t){e.contains(n._node,t.target)&&n.hide()};for(var r=0;rf){if(!n)return!1;o=f-a.height-1}if(s+a.width>u){if(!n)return!1;s=u-a.width-1}if(h>s){if(!n)return!1;s=h+4}if(c>o){if(!n)return!1;o=c+4}return this._tail&&this._tail.previousPosition!==t&&(this._tip.removeChild(this._tail),this._tail=null),this._tail||(this._tail=document.createElement("span"),this._tail.classList.add("tooltipTailFrom"+t),"above"===t||"left"===t?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner),this._tail.previousPosition=t),this._tip.style.top=o+"px",this._tip.style.left=s+"px",!0},contentContainer:function(){return this._makeTipNode(),this._tipInner},isShowing:function(){return this._tip&&this._tip.classList.contains("tooltipShowing")},show:function(){this.isShowing()||(this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null),this._showDelay?this._timeout=window.setTimeout(this._showImmediately.bind(this),this._showDelay):this._showImmediately())},_showImmediately:function(){for(var e=!1,t=0;!e&&t"+i.name),i.callback.call(i,n)}.bind(this),!1),s.addEventListener("keydown",function(t){(t.keyCode===e.KEY.ENTER||t.keyCode===e.KEY.SPACE)&&(a.logEvent("command","invoke",this.id+">"+i.name),i.callback.call(i,n))}.bind(this),!1)}else o._generateMenuSeparator(t)}.bind(this))},getChoices:function(e,t,n){return this.choiceCallback?this.choiceCallback.call(t,e,n):null},makeChoiceCallback:function(e,t){return function(n){e.callback&&e.callback.call(e,t,n)}},hasImage:function(){return this.imageClass||this.image!==C}},y.prototype.constructor=y,{Command:y,CommandInvocation:_,createDropdownMenu:p,createCheckedMenuItem:g,createCommandItem:v,createCommandMenuItem:m,executeBinding:d,setKeyBindingProvider:l,localKeyBindings:x,getKeyBindings:c,processKey:u,NO_IMAGE:C,_testMethodProcessKey:h}}),define("orion/keyBinding",["orion/util"],function(e){function t(e,t,n,i,r,o){this.type=o||"keydown",this.keyCode="string"==typeof e&&"keydown"===this.type?e.toUpperCase().charCodeAt(0):e,this.mod1=void 0!==t&&null!==t?t:!1,this.mod2=void 0!==n&&null!==n?n:!1,this.mod3=void 0!==i&&null!==i?i:!1,this.mod4=void 0!==r&&null!==r?r:!1}function n(e){this.keys=e}return t.prototype={getKeys:function(){return[this]},match:function(t,n){if(void 0!==n){if(0!==n)return!1}else if(t instanceof Array){if(t.length>1)return!1;t=t[0]}if(t.type!==this.type)return!1;if(this.keyCode===t.keyCode||this.keyCode===String.fromCharCode(e.isOpera?t.which:void 0!==t.charCode?t.charCode:t.keyCode)){var i=e.isMac?t.metaKey:t.ctrlKey;return this.mod1!==i?!1:"keydown"===this.type&&this.mod2!==t.shiftKey?!1:this.mod3!==t.altKey?!1:e.isMac&&this.mod4!==t.ctrlKey?!1:!0}return!1},equals:function(e){return e?this.keyCode!==e.keyCode?!1:this.mod1!==e.mod1?!1:this.mod2!==e.mod2?!1:this.mod3!==e.mod3?!1:this.mod4!==e.mod4?!1:this.type!==e.type?!1:!0:!1}},n.prototype={getKeys:function(){return this.keys.slice(0)},match:function(e,t){var n=this.keys;if(void 0!==t)return t>n.length?!1:n[t].match(e)?t===n.length-1?!0:t+1:!1;if(e instanceof Array||(e=[e]),e.length>n.length)return!1;var i;for(i=0;i-1&&r[e];e--)o=r[e],i=t[o],(i===!0||1===i)&&(i=s(f+o+"/"+g)),n(_,i);a(_)})})}}})}(),define("orion/nls/messages",{root:!0}),define("orion/nls/root/messages",{Navigator:"Navigator",Sites:"Sites",Shell:"Shell",ShellLinkWorkspace:"Shell","Get Plugins":"Get Plug-ins",Global:"Global",Editor:"Editor",EditorRelatedLink:"Show Current Folder",EditorRelatedLinkParent:"Show Enclosing Folder",EditorLinkWorkspace:"Edit",EditorRelatedLinkProj:"Show Project",navigationBar:"Navigation Bar","Filter bindings":"Filter bindings",BindingPrompt:"Enter the new binding",NoBinding:"---",orionClientLabel:"Orion client repository","Orion Editor":"Orion Editor","Orion Image Viewer":"Orion Image Viewer","Orion Markdown Editor":"Orion Markdown Editor","Orion Markdown Viewer":"Orion Markdown Viewer","Orion JSON Editor":"Orion JSON Editor","View on Site":"View on Site","View this file or folder on a web site hosted by Orion":"View this file or folder on a web site hosted by Orion.",ShowAllKeyBindings:"Show a list of all the keybindings on this page","Show Keys":"Show Keys",HideShowBannerFooter:"Hide or show the page banner","Toggle banner and footer":"Toggle banner",ChooseFileOpenEditor:"Choose a file by name and open an editor on it",FindFile:"Open File...","System Configuration Details":"System Configuration Details","System Config Tooltip":"Go to the System Configuration Details page","Background Operations":"Background Operations","Background Operations Tooltip":"Go to the Background Operations page","Operation status is unknown":"Operation status is unknown","Unknown item":"Unknown item",NoSearchAvailableErr:"Can't search: no search service is available",Related:"Related",Options:"Options","LOG: ":"LOG: ",View:"View",SplashTitle:"Setting up Workspace",SplashTitleSettings:"Loading Settings",SplashTitleGit:"Loading Git Repositories",LoadingPage:"Loading Page",LoadingPlugins:"Loading Plugins",LoadingResources:"Loading Resources",plugin_started:'"${0}" started',"plugin_lazy activation":'"${0}" lazily activated',plugin_starting:'"${0}" starting',"no parent":"no parent","no tree model":"no tree model","no renderer":"no renderer","could not find table row ":"could not find table row ",Operations:"Operations","Operations running":"Operations running",SomeOpWarning:"Some operations finished with warning",SomeOpErr:"Some operations finished with error","no service registry":"no service registry",Tasks:"Tasks",Close:"Close","Expand all":"Expand all","Collapse all":"Collapse all",Search:"Search","Advanced search":"Advanced search",Submit:"Submit",More:"More","Recent searches":"Recent searches","Regular expression":"Regular expression","Search options":"Search options","Global search":"Global search","Orion Home":"Orion Home","Close notification":"Close notification",OpPressSpaceMsg:"Operations - Press spacebar to show current operations","Toggle side panel":"Toggle side panel","Open or close the side panel":"Open or close the side panel",Projects:"Projects","Toggle Sidebar":"Toggle Sidebar","Sample HTML5 Site":"Sample HTML5 Site","Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.":"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.","Sample Orion Plugin":"Sample Orion Plug-in","Generate a sample plugin for integrating with Orion.":"Generate a sample plug-in for integrating with Orion.",Browser:"Web Browser",OutlineProgress:"Getting outline for ${0} from ${1}",outlineTimeout:"Outline service timed out. Try reloading the page and opening the outline again.",UnknownError:"An unknown error occurred.",Filter:"Filter (* = any string, ? = any character)",TemplateExplorerLabel:"Templates",OpenTemplateExplorer:"Open Template Explorer",Edit:"Edit",CentralNavTooltip:"Toggle Navigation Menu","Wrote: ${0}":"Wrote: ${0}",GenerateHTML:"Generate HTML file",GenerateHTMLTooltip:"Write an HTML file generated from the current Markdown editor content","alt text":"alt text",blockquote:"blockquote",code:"code","code (block)":"code (block)","code (span)":"code (span)",emphasis:"emphasis","fenced code (${0})":"fenced code (${0})","header (${0})":"header (${0})","horizontal rule":"horizontal rule",label:"label","link (auto)":"link (auto)","link (image)":"link (image)","link (inline)":"link (inline)","link label":"link label","link label (optional)":"link label (optional)","link (ref)":"link (ref)","list item (bullet)":"list item (bullet)","list item (numbered)":"list item (numbered)","strikethrough (${0})":"strikethrough (${0})",strong:"strong","table (${0})":"table (${0})",text:"text","title (optional)":"title (optional)",url:"url",TogglePaneOrientationTooltip:"Toggle split pane orientation",WarningDuplicateLinkId:"Duplicate link ID: ${0} (link IDs are not case-sensitive)",WarningHeaderTooDeep:"Header level cannot exceed 6",WarningLinkHasNoText:"Link has no text",WarningLinkHasNoURL:"Link has no URL",WarningOrderedListItem:"Ordered list item within unordered list",WarningOrderedListShouldStartAt1:"The first item in an ordered list should have index 1",WarningUndefinedLinkId:"Undefined link ID: ${0}",WarningUnorderedListItem:"Unordered list item within ordered list",PageTitleFormat:"${0} - ${1}",KeyCTRL:"Ctrl",KeySHIFT:"Shift",KeyALT:"Alt",KeyBKSPC:"Backspace",KeyDEL:"Del",KeyEND:"End",KeyENTER:"Enter",KeyESCAPE:"Esc",KeyHOME:"Home",KeyINSERT:"Ins",KeyPAGEDOWN:"Page Down",KeyPAGEUP:"Page Up",KeySPACE:"Space",KeyTAB:"Tab","a year":"a year",years:"${0} years","a month":"a month",months:"${0} months","a day":"a day",days:"${0} days","an hour":"an hour",hours:"${0} hours","a minute":"a minute",minutes:"${0} minutes",timeAgo:"${0} ago",justNow:"just now"}),define("orion/i18nUtil",[],function(){function e(e){var t=/\$\{([^\}]+)\}/g,n=arguments;return 2===n.length&&n[1]&&"object"==typeof n[1]?e.replace(t,function(e,t){return n[1][t]}):e.replace(t,function(e,t){return n[(t<<0)+1]})}return{formatMessage:e}}),define("orion/uiUtils",["i18n!orion/nls/messages","orion/webui/littlelib","orion/i18nUtil"],function(e,t,n){function i(n){var i="";if(v)n.mod4&&(i+="⌃"),n.mod3&&(i+="⌥"),n.mod2&&(i+="⇧"),n.mod1&&(i+="⌘");else{var r="+";n.mod1&&(i+=e.KeyCTRL+r),n.mod2&&(i+=e.KeySHIFT+r),n.mod3&&(i+=e.KeyALT+r)}if(n.alphaKey)return i+n.alphaKey;if("keypress"===n.type)return i+n.keyCode;var o=n.keyCode,s=m[o];if(s)return i+s;var a=t.keyName(o);if(a)return a=e["Key"+a]||a,i+a;var l;switch(n.keyCode){case 59:l=n.mod2?":":";";break;case 61:l=n.mod2?"+":"=";break;case 188:l=n.mod2?"<":",";break;case 190:l=n.mod2?">":".";break;case 191:l=n.mod2?"?":"/";break;case 192:l=n.mod2?"~":"`";break;case 219:l=n.mod2?"{":"[";break;case 220:l=n.mod2?"|":"\\";break;case 221:l=n.mod2?"}":"]";break;case 222:l=n.mod2?'"':"'"}return l?i+l:n.keyCode>=112&&n.keyCode<=123?i+"F"+(n.keyCode-111):i+String.fromCharCode(n.keyCode)}function r(e){for(var t="",n=e.getKeys(),r=0;r0)if(e.createTextRange){var r=e.createTextRange();r.collapse(!0),r.moveStart("character",0),r.moveEnd("character",i),r.select()}else e.setSelectionRange?e.setSelectionRange(0,i):void 0!==e.selectionStart&&(e.selectionStart=0,e.selectionEnd=i);else e.select()}},0)}function s(e){var t=-1!==window.navigator.platform.indexOf("Mac");return t&&e.metaKey||!t&&e.ctrlKey}function a(e,t){t&&s(t)?window.open(e):window.location=e}function l(e,n){var i=document.createElement("button");return i.className="orionButton commandButton commandMargins",i.addEventListener("click",function(e){n(),t.stop(e)},!1),e&&i.appendChild(document.createTextNode(e)),i}function d(){}function h(e,t){if(!e||!e.tagName)return!1;switch(e.tagName.toLowerCase()){case"button":case"fieldset":case"form":case"input":case"keygen":case"label":case"legend":case"meter":case"optgroup":case"output":case"progress":case"select":case"textarea":return!0}return e.parentNode===t?!1:e.parentNode&&h(e.parentNode,t)}function c(e,t,n){var i=n?0:1;return e.substring(0,e.length-encodeURIComponent(t).length-i)}function u(e){var t=new Date,n=new Date(e),i=t.getTime()-n.getTime(),r=Math.floor(i/1e3/60/60/24/365);i-=1e3*r*60*60*24*365;var o=Math.floor(i/1e3/60/60/24/30);i-=1e3*o*60*60*24*30;var s=Math.floor(i/1e3/60/60/24);i-=1e3*s*60*60*24;var a=Math.floor(i/1e3/60/60);
+i-=1e3*a*60*60;var l=Math.floor(i/1e3/60);i-=1e3*l*60;var d=Math.floor(i/1e3);return{year:r,month:o,day:s,hour:a,minute:l,second:d}}function f(t,i,r){return t>0?1===t?e[i]:n.formatMessage(e[r],t):""}function p(e){var t=u(e),n=f(t.year,"a year","years"),i=f(t.month,"a month","months"),r=f(t.day,"a day","days"),o=f(t.hour,"an hour","hours"),s=f(t.minute,"a minute","minutes"),a="";return n?a=t.year>0?n:n+i:i?a=t.month>0?i:i+r:r?a=t.day>0?r:r+o:o?a=t.hour>0?o:o+s:s&&(a=s),a}function g(t){var i=p(t);return i?n.formatMessage(e.timeAgo,i):e.justNow}var v=-1!==navigator.platform.indexOf("Mac"),m=Object.create(null);return m[t.KEY.DOWN]="↓",m[t.KEY.UP]="↑",m[t.KEY.RIGHT]="→",m[t.KEY.LEFT]="←",v&&(m[t.KEY.BKSPC]="⌫",m[t.KEY.DEL]="⌦",m[t.KEY.END]="⇲",m[t.KEY.ENTER]="⏎",m[t.KEY.ESCAPE]="⎋",m[t.KEY.HOME]="⇱",m[t.KEY.PAGEDOWN]="⇟",m[t.KEY.PAGEUP]="⇞",m[t.KEY.SPACE]="␣",m[t.KEY.TAB]="⇥"),{getUserKeyString:r,getUserText:o,openInNewWindow:s,followLink:a,createButton:l,createDropdownButton:d,isFormElement:h,path2FolderName:c,timeElapsed:p,displayableTimeElapsed:g}}),define("text!orion/webui/submenutriggerbutton.html",[],function(){return''}),define("orion/commandRegistry",["orion/commands","orion/keyBinding","orion/explorers/navigationUtils","orion/PageUtil","orion/uiUtils","orion/webui/littlelib","orion/webui/dropdown","orion/webui/tooltip","text!orion/webui/submenutriggerbutton.html","orion/metrics","orion/Deferred","orion/EventTarget"],function(e,t,n,i,r,o,s,a,l,d,h,c){function u(e){this._commandList={},this._contributionsByScopeId={},this._activeBindings={},this._urlBindings={},this._pendingBindings={},this._parameterCollector=null,this._init(e||{})}function f(e,t){this.token=e,this.parameterName=t}function p(e,t,n){this.event=e,this.handler=t,this.capture=n||!1}function g(e,t,n,i,r,o,s){this.name=e,this.type=t,this.label=n,this.value=i,this.lines=r||1,this.validator=s,this.eventListeners=Array.isArray(o)?o:o?[o]:[]}function v(e,t,n){this._storeParameters(e),this._hasOptionalParameters=t&&t.hasOptionalParameters,this._options=t,this.optionsRequested=!1,this.getParameters=n,this.clientCollect=t&&t.clientCollect,this.getParameterElement=t&&t.getParameterElement,this.getSubmitName=t&&t.getSubmitName,this.getCancelName=t&&t.getCancelName,this.message=t&&t.message}return u.prototype={_init:function(t){this._selectionService=t.selection;var n=this;e.setKeyBindingProvider(function(){return n._activeBindings}),c.attach(u.prototype),this.addEventListener("bindingChanged",function(e){this._handleBindingChanges(e)}.bind(this)),this.addEventListener=function(e,t){this._bindingOverrides&&"bindingChanged"===e&&this._updateBindingOverrides(t),u.prototype.addEventListener.call(this,e,t)}},processURL:function(e){for(var t in this._urlBindings)if(this._urlBindings[t]&&this._urlBindings[t].urlBinding&&this._urlBindings[t].command){var n=this._urlBindings[t].urlBinding.match(e);if(n){var i=this._urlBindings[t],r=i.command,o=i.invocation;if(o&&o.parameters&&r.callback){o.parameters.setValue(n.parameterName,n.parameterValue);var s=this;return void window.setTimeout(function(){s._invoke(o)},0)}}}},findCommand:function(e){return this._commandList[e]},runCommand:function(t,n,i,r,o,s){var a=this;if(n){var l=this._commandList[t],d=l&&(l.visibleWhen?l.visibleWhen(n):!0);if(d&&l.callback){var h=new e.CommandInvocation(i,n,o,l,a);return h.domParent=s,a._invoke(h,r)}}else{var c=this._urlBindings[t];if(c&&c.command&&c.command.callback)return a._invoke(c.invocation,r)}},getSelectionService:function(){return this._selectionService},setParameterCollector:function(e){this._parameterCollector=e},openParameterCollector:function(e,t,n){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(e,t,n))},confirm:function(e,t,n,i,r,o){var s=!1;if(!this._parameterCollector||r)s=window.confirm(t),o(s);else{var l=this,d=function(){o(s)},h=function(){l._parameterCollector.close()},c=function(e,r){var o=document.createElement("span");o.classList.add("parameterPrompt"),o.textContent=t,e.appendChild(o);var a=document.createElement("button");a.addEventListener("click",function(){s=!0,d(),h()},!1),r.appendChild(a),a.appendChild(document.createTextNode(n)),a.className="dismissButton";var l=document.createElement("button");return l.addEventListener("click",function(){s=!1,h()},!1),r.appendChild(l),l.appendChild(document.createTextNode(i)),l.className="dismissButton",a};this._parameterCollector.close();var u=this._parameterCollector.open(e,c,function(){});if(!u){var f=new a.Tooltip({node:e,afterHiding:function(){this.destroy()},trigger:"click",position:["below","right","above","left"]}),p=f.contentContainer();p.classList.add("parameterPopup");var g=window.document.activeElement;h=function(){g&&g.focus(),f.destroy()};var v=document.createElement("div");v.classList.add("parameterMessage"),p.appendChild(v);var m=document.createElement("div");p.appendChild(m),m.classList.add("layoutRight"),m.classList.add("parametersDismiss");var _=c(v,m);f.show(),_&&window.setTimeout(function(){_.focus(),_.select&&_.select()},0)}}},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_invoke:function(e,t){return this._collectAndInvoke(e.makeCopy(t),!1)},_collectAndInvoke:function(e,t,n){if(e){if(!(this._parameterCollector&&e.parameters&&e.parameters.hasParameters()&&(t||e.parameters.shouldCollectParameters())))return d.logEvent("command","invoke",e.command.id),e.command.callback.call(e.handler||window,e);var i=!1;if(e.parameters.updateParameters(e),e.parameters.shouldCollectParameters()&&(i=this._parameterCollector.collectParameters(e,n),!i)){var r=new a.Tooltip({node:e.domNode||e.domParent,afterHiding:function(){this.destroy()},trigger:"click",position:["below","right","above","left"]}),o=r.contentContainer();o.classList.add("parameterPopup");var s=window.document.activeElement,l=this._parameterCollector.getFillFunction(e,function(){s&&s.focus(),r.destroy()},n)(o);r.show(),l&&window.setTimeout(function(){l.focus(),l.select&&l.select()},0),i=!0}if(!i)return d.logEvent("command","invoke",e.command.id),e.command.callback.call(e.handler||window,e)}else window.console.log("Client attempted to invoke command without an available (rendered) command invocation")},collectParameters:function(e,t){this._collectAndInvoke(e,!0,t)},showKeyBindings:function(t){function n(t){return function(){e.executeBinding(t)}}var i,r={},o=[];for(var s in this._activeBindings)i=this._activeBindings[s],i&&i.keyBinding&&i.command&&(i.command.name||i.command.tooltip)&&o.push(i);o.sort(function(e,t){var n=e.command.name||e.command.tooltip,i=t.command.name||t.command.tooltip;return n.localeCompare(i)});for(var a=0;a0&&(t.createHeader(l),r[l].forEach(function(e){t.createItem(e.keyBinding,e.command.name||e.command.tooltip,e.command.id,n(e))}))},_handleBindingChanges:function(t){var n=this.findCommand(t.id);if(n){var i=this._activeBindings[t.id];i?i.keyBinding=t.newBinding:this._addBinding(n,"key",t.newBinding)}if(this._renderedCommands&&this._renderedCommands[t.id])for(var o=this._renderedCommands[t.id],s=Object.keys(o),a=0;a=0;t--){var n=this._bindingOverrides[t];if(n.id===e)return n.newBinding}return null},addCommand:function(e){this._commandList[e.id]=e;var t=this._pendingBindings[e.id];if(t){var n=this;t.forEach(function(t){n._addBinding(e,t.type,t.binding,t.bindingOnly)}),delete this._pendingBindings[e.id]}},addCommandGroup:function(e,t,n,i,r,o,s,a,l,d,h){this._contributionsByScopeId[e]||(this._contributionsByScopeId[e]={});var c=this._contributionsByScopeId[e];r&&(c=this._createEntryForPath(c,r)),c[t]?(i&&(c[t].title=i),n&&(c[t].position=n),s&&(c[t].imageClass=s),a&&(c[t].tooltip=a),l&&(c[t].selectionClass=l),h&&(c[t].extraClass=h),d===!0?c[t].pretendDefaultActionId=!0:c[t].defaultActionId=d,c[t].emptyGroupMessage=o):(c[t]={title:i,position:n,emptyGroupMessage:o,imageClass:s,tooltip:a,selectionClass:l,defaultActionId:d===!0?null:d,pretendDefaultActionId:d===!0,children:{},extraClasses:h},c.sortedContributions=null)},_createEntryForPath:function(e,t){if(t){var n=t.split("/");n.forEach(function(t){t.length>1&&(e[t]||(e[t]={position:0,children:{}},e.sortedContributions=null),e=e[t].children)})}return e},registerSelectionService:function(e,t){this._contributionsByScopeId[e]||(this._contributionsByScopeId[e]={}),this._contributionsByScopeId[e].localSelectionService=t},setServiceRegistry:function(e){if(this._serviceRegistry=e,this._prefService=e.getService("orion.core.preference"),this._prefService){this._getBindingOverrides().then(function(e){this._bindingOverrides=e,this._updateBindingOverrides()}.bind(this));var t;this._prefService.listenForChangedSettings("/KeyBindings",function(e){e.key===t&&this._getBindingOverrides().then(function(e){if(e.length>this._bindingOverrides.length)for(var t=this._bindingOverrides.length;t1){if(!i[e])return;i=i[e].children}})}delete i[t],i.sortedContributions=null}},_addBinding:function(e,t,n,i){if(!e.id)throw new Error("No command id: "+e);"key"===t?this._activeBindings[e.id]={command:e,keyBinding:n,bindingOnly:i}:"url"===t&&(this._urlBindings[e.id]={command:e,urlBinding:n,bindingOnly:i})},_addPendingBinding:function(e,t,n,i){this._pendingBindings[e]=this._pendingBindings[e]||[],this._pendingBindings[e].push({type:t,binding:n,bindingOnly:i})},_checkForTrailingSeparator:function(e,t,n){var i;if(("tool"===t||"button"===t)&&(i=e.childNodes.length>0?e.childNodes[e.childNodes.length-1]:null,i&&i.classList.contains("commandSeparator")))return n?(e.removeChild(i),!1):!0;if("menu"===t){var r=o.$$array("li > *",e);if(r.length>0&&r[r.length-1].classList.contains("dropdownSeparator"))return i=r[r.length-1],n?(i.parentNode.parentNode.removeChild(i.parentNode),!1):!0}return!1},renderCommands:function(e,t,n,i,r,s,a){if("string"!=typeof e)throw"a scope id for rendering must be specified";if(t=o.node(t),!t)throw"no parent";var l=this._contributionsByScopeId[e];if(!n&&l){var d=l.localSelectionService||this._selectionService,h=this;return void(d&&d.getSelections(function(n){h.renderCommands(e,t,n,i,r,s)}))}l&&(this._render(e,l,t,n,i,r||"button",s,a),this._checkForTrailingSeparator(t,r,!0))},destroy:function(e){if(e=o.node(e),!e)throw"no parent";for(;e.hasChildNodes();){var t=e.firstChild;t.commandTooltip&&t.commandTooltip.destroy(),t.emptyGroupTooltip&&t.emptyGroupTooltip.destroy(),this.destroy(t),e.removeChild(t)}},_render:function(t,i,o,s,l,d,h,c){var u=i.sortedContributions;if(!u){u=[];var f=!1;for(var p in i)if(Object.prototype.hasOwnProperty.call(i,p)){var g=i[p];g&&"number"==typeof g.position&&(g.id=p,u.push(g),f=!0)}f&&(u.sort(function(e,t){return e.position-t.position}),i.sortedContributions=u)}var v=0,m=this;u.forEach(function(i){function u(e){e&&e.parentNode&&e.parentNode.removeChild(e)}var f,p;if(i.imageClass||(i.imageClass=null),i.children&&Object.getOwnPropertyNames(i.children).length>0){var g,_=i.children;if("tool"===d||"button"===d)if(i.title){var y;if(i.defaultActionId){i.pretendDefaultActionId=i.defaultActionId===!0;var C=m._commandList[i.defaultActionId];C&&(C.visibleWhen?C.visibleWhen(s):!0)?(y=new e.CommandInvocation(l,s,h,C,m),y.domParent=o):i.pretendDefaultActionId=!0}g=m._createDropdownMenu(o,i.title,null,null,i.imageClass,i.tooltip,i.selectionClass,null,y,i.pretendDefaultActionId,i.extraClasses),c&&n.generateNavGrid(c,g.menuButton),g&&(m._render(t,i.children,g.menu,s,l,"menu",h,c),m._checkForTrailingSeparator(g.menu,"menu",!0),0===g.menu.childNodes.length?i.emptyGroupMessage?g.menuButton.emptyGroupTooltip||(g.menuButton.emptyGroupTooltip=new a.Tooltip({node:g.menuButton,text:i.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})):(c&&n.removeNavGrid(c,g.menuButton),u(g.menu),u(g.menuButton),u(g.destroyButton)):g.menuButton.style.visibility="visible")}else{var w;if(o.childNodes.length>0&&!m._checkForTrailingSeparator(o,d)&&(w=m.generateSeparatorImage(o)),m._render(t,_,o,s,l,d,h,c),o.childNodes.length>0){var x=o.childNodes[o.childNodes.length-1];x!==w&&(w=m.generateSeparatorImage(o))}}else if(i.title){var S=m._createDropdownMenu(o,i.title,!0,null,null,i.imageClass);S&&(m._render(t,_,S.menu,s,l,"menu",h,c),m._checkForTrailingSeparator(S.menu,"menu",!0),0===S.menu.childNodes.length&&S.destroyButton&&o.removeChild(S.destroyButton))}else o.childNodes.length>0&&m._generateMenuSeparator(o),m._render(t,_,o,s,l,d,h,c),o.childNodes.length>0&&m._generateMenuSeparator(o)}else{var b=m._commandList[i.id],T=b?!0:!1,E=null,L=null;if(b){p=new e.CommandInvocation(i.handler||l,s,h,b,m),p.domParent=o;var k=!1;try{k=T&&(b.visibleWhen?b.visibleWhen(s,p):!0)}catch(A){throw console.log(A),A}m._activeBindings[b.id]&&m._activeBindings[b.id].keyBinding&&(E=m._activeBindings[b.id],E.invocation=k?p:null,E.bindingOnly&&(T=!1)),m._urlBindings[b.id]&&m._urlBindings[b.id].urlBinding&&(L=m._urlBindings[b.id],L.invocation=k?p:null,L.bindingOnly&&(T=!1)),T=T&&k}if(T)if(b.choiceCallback){var M,D;"tool"===d||"button"===d?(M=o,D=!1,"ul"===o.nodeName.toLowerCase()&&(M=document.createElement("li"),o.appendChild(M))):(M=o,D=!0);var O=function(e){b.populateChoicesMenu(e,s,l,h,m)};m._createDropdownMenu(M,b.name,D,O.bind(b),b.imageClass,b.tooltip||b.title,b.selectionClass,b.positioningNode)}else{p.handler=p.handler||this,p.domParent=o;var N,I=function(){m._invoke(p)};if("menu"===d){var R=null;E&&E.keyBinding&&(R=r.getUserKeyString(E.keyBinding)),N=e.createCommandMenuItem(o,b,p,null,I,R),p.onClick=I,m._registerRenderedCommand(b.id,t,p)}else if("quickfix"===d){f=d+b.id+v;var B=document.createElement("div");o.appendChild(B),N=e.createCommandItem(B,b,p,f,null,"button"===d,I)}else f=d+b.id+v,N=e.createCommandItem(o,b,p,f,null,"tool"===d,I);n.generateNavGrid(c,N),p.domNode=N,v++}}})},_createDropdownMenu:function(t,n,i,r,d,h,c,u,f,p,g){if(t=o.node(t),!t||!o.contains(document.body,t))return null;var v,m,_,y,C=t;if(i){var w=document.createRange();w.selectNode(t);var x=w.createContextualFragment(l);o.processTextNodes(x,{ButtonText:n}),t.appendChild(x),y=t.lastChild,m=y.lastChild,v=m.previousSibling,v.dropdown=new s.Dropdown({dropdown:m,populate:r,parentDropdown:t.dropdown}),m.dropdown=v.dropdown}else{"ul"===t.nodeName.toLowerCase()&&(C=document.createElement("li"),t.appendChild(C),y=C);var S=null;d&&(S="dropdownButtonWithIcon",h=h||n),h=d?h||n:h;var b=e.createDropdownMenu(C,n,r,S,d,!1,c,u,f||p,g);if(_=b.dropdownArrow,v=b.menuButton,_){f&&(f.domNode=b.menuButton);var T=this;v.onclick=function(e){var t=o.bounds(_);(e.clientX>=t.left||p===!0)&&b.dropdown?b.dropdown.toggle(e):T._invoke(f)},b.dropdown&&(v.onkeydown=function(e){o.KEY.DOWN===e.keyCode&&(b.dropdown.toggle(e),o.stop(e))})}m=b.menu;var E,L=f&&f.command&&(f.command.tooltip||f.command.name);E=L?f.command.tooltip||f.command.name:h,E&&(v.commandTooltip=new a.Tooltip({node:v,text:E,position:["above","below","right","left"]}))}return{menuButton:v,menu:m,dropdown:v.dropdown,destroyButton:y,dropdownArrow:_}},_generateMenuSeparator:function(e){if(!this._checkForTrailingSeparator(e,"menu")){var t=document.createElement("li");t.classList.add("dropdownSeparator");var n=document.createElement("span");n.classList.add("dropdownSeparator"),t.appendChild(n),e.appendChild(t)}},generateSeparatorImage:function(e){var t;return"ul"===e.nodeName.toLowerCase()?(t=document.createElement("li"),e.appendChild(t)):(t=document.createElement("span"),e.appendChild(t)),t.classList.add("core-sprite-sep"),t.classList.add("imageSprite"),t.classList.add("commandSeparator"),t}},u.prototype.constructor=u,f.prototype={match:function(e){var t=i.matchResourceParameters(e);return"undefined"!=typeof t[this.token]?(this.parameterValue=t[this.token],this):null}},f.prototype.constructor=f,p.prototype.constructor=p,g.prototype={optionsRequested:function(){return this.optionsRequested}},g.prototype.constructor=g,v.prototype={_storeParameters:function(e){if(this.parameterTable=null,e){var t=this.parameterTable={};e.forEach(function(e){t[e.name]=e})}},updateParameters:function(e){"function"==typeof this.getParameters&&this._storeParameters(this.getParameters(e))},hasParameters:function(){return null!==this.parameterTable},shouldCollectParameters:function(){return!this.clientCollect&&this.hasParameters()},parameterNamed:function(e){return this.parameterTable[e]},valueFor:function(e){var t=this.parameterTable[e];return t?t.value:null},setValue:function(e,t){var n=this.parameterTable[e];n&&(n.value=t)},forEach:function(e){for(var t in this.parameterTable)this.parameterTable[t].type&&this.parameterTable[t].name&&e(this.parameterTable[t])},validate:function(e,t){var n=this.parameterTable[e];return n&&n.validator?n.validator(t):!0},makeCopy:function(){var e=[];this.forEach(function(t){var n=new g(t.name,t.type,t.label,t.value,t.lines,t.eventListeners,t.validator);e.push(n)});var t=new v(e,this._options,this.getParameters);return t.clientCollect=this.clientCollect,t.message=this.message,t},hasOptionalParameters:function(){return this._hasOptionalParameters}},v.prototype.constructor=v,{CommandRegistry:u,URLBinding:f,ParametersDescription:v,CommandParameter:g,CommandEventListener:p}}),define("orion/edit/nls/messages",{root:!0}),define("orion/edit/nls/root/messages",{Editor:"Editor",switchEditor:"Switch Editor",Fetching:"Fetching: ${0}",confirmUnsavedChanges:"There are unsaved changes. Do you still want to navigate away?",searchFilesCommand:"Quick Search...",searchFiles:"Quick Search in ${0}",searchTerm:"Enter search term:",unsavedChanges:"There are unsaved changes.",unsavedAutoSaveChanges:"Please stay on the page until Auto Save is complete.",Save:"Save",Saved:"Saved",Blame:"Blame",BlameTooltip:"Show blame annotations",Diff:"Diff",DiffTooltip:"Show diff annotations",saveOutOfSync:"Resource is out of sync with the server. Do you want to save it anyway?",loadOutOfSync:"Resource is out of sync with the server. Do you want to load it anyway? This will overwrite your local changes.",ReadingMetadata:"Reading metadata of ${0}",ReadingMetadataError:"Cannot get metadata of ${0}",Reading:"Reading ${0}",readonly:"Read Only.",saveFile:"Save this file",toggleZoomRuler:"Toggle Zoom Ruler",gotoLine:"Go to Line...",gotoLineTooltip:"Go to specified line number",gotoLinePrompt:"Go to line:",Undo:"Undo",Redo:"Redo",Cut:"Cut",Copy:"Copy",Paste:"Paste",Find:"Find...",noResponse:"No response from server. Check your internet connection and try again.",savingFile:"Saving file ${0}",running:"Running ${0}","Saving...":"Saving...",View:"View",SplitSinglePage:"Single Page",SplitVertical:"Split Vertical",SplitHorizontal:"Split Horizontal",SplitPipInPip:"Picture in Picture",SplitModeTooltip:"Change split editor mode",SidePanel:"Side Panel",SidePanelTooltip:"Choose what to show in the side panel.",Slideout:"Slideout",Actions:"Actions",Navigator:"Navigator",FolderNavigator:"Folder Navigator",Project:"Project",New:"New",File:"File",Edit:"Edit",Tools:"Tools",Add:"Add",noActions:"There are no actions for the current selection.",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding.",LocalEditorSettings:"Local Editor Settings",NoProject:"${0} is not a project. To convert it to a project use ${1}.",NoProjects:"There are no projects in your workspace. Use the ${0} menu to create projects.",Disconnected:"${0} (disconnected)",ChooseFS:"Choose Filesystem",ChooseFSTooltip:"Choose the filesystem you want to view.",FSTitle:"${0} (${1})",Deploy:"Deploy","Deploy As":"Deploy As",Import:"Import",Export:"Export",OpenWith:"Open With",OpenRelated:"Open Related",Dependency:"Dependency",UnnamedCommand:"Unnamed",searchInFolder:"Folder Search...","Global Search":"Global Search...",ClickEditLabel:"Click to edit",ProjectInfo:"Project Information",Name:"Name",Description:"Description",Site:"Site",projectsSectionTitle:"Projects",listingProjects:"Listing projects...",gettingWorkspaceInfo:"Getting workspace information...",showProblems:"Show Problems...",showTooltip:"Show Tooltip",showTooltipTooltip:"Shows the tooltip immediately based on the caret position",emptyDeploymentInfoMessage:"Use the Launch Configurations dropdown to deploy this project"}),define("orion/explorers/navigatorRenderer",[],function(){return{getClickedItem:function(){return null}}}),define("orion/objects",[],function(){function e(e){for(var t=Object.prototype.hasOwnProperty,n=1,i=arguments.length;i>n;n++){var r=arguments[n];for(var o in r)t.call(r,o)&&(e[o]=r[o])}return e}return{clone:function(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var n=Object.create(Object.getPrototypeOf(t));return e(n,t),n},mixin:e,toArray:function(e){return Array.isArray(e)?e:[e]}}}),define("orion/inputManager",["i18n!orion/edit/nls/messages","orion/explorers/navigatorRenderer","orion/i18nUtil","orion/Deferred","orion/EventTarget","orion/objects","orion/PageUtil","orion/metrics"],function(e,t,n,i,r,o,s,a){function l(e){this._document=e.document||document,this._timeout=e.timeout;for(var t=["mousedown","keypress","keydown","keyup"],n=function(){this._resetTimer()}.bind(this),i=0;i0){var t=e.substring(0,e.lastIndexOf("/",e.length-("/"===e[e.length-1]?2:1))+1);return this._lastMetadata.Parents[0].Location===t}return!1},load:function(){var t=this.getInput();if(t){var r=this.fileClient,s=this._parsedLocation.resource,a=this.progressService,l=function(e,t,i){return a?a.progress(e,n.formatMessage(t,i)):e},d=this.getEditor();if(this._fileMetadata)this._fileMetadata._saving||this._fileMetadata.Directory||this.getReadOnly()||l(r.read(s,!0),e.ReadingMetadata,t).then(function(n){this._fileMetadata&&!this._fileMetadata._saving&&this._fileMetadata.Location===n.Location&&this._fileMetadata.ETag!==n.ETag&&(this._fileMetadata=o.mixin(this._fileMetadata,n),(!d.isDirty()||window.confirm(e.loadOutOfSync))&&l(r.read(s),e.Reading,t).then(function(e){d.setInput(t,null,e),this._clearUnsavedChanges()}.bind(this)))}.bind(this));else{var f=window.setTimeout(function(){f=null,this.reportStatus(n.formatMessage(e.Fetching,t))}.bind(this),800),p=function(){this.reportStatus(""),f&&window.clearTimeout(f)}.bind(this),g=function(e){p();var t=null;this.serviceRegistry?t=this.serviceRegistry.getService("orion.page.message"):this.statusService&&(t=this.statusService),h(t,e),this._setNoInput()}.bind(this);this._acceptPatch=null;var v=s;if(!this._isSameParent(v)){var m=new URL(v);m.query.set("tree",localStorage.useCompressedTree?"compressed":"decorated"),v=m.href}l(this._read(v,!0),e.ReadingMetadata,s).then(function(o){if(o)if(o.Directory)i.when(o.Children||l(r.fetchChildren(o.ChildrenLocation),e.Reading,t),function(e){p(),o.Children=e,this._setInputContents(this._parsedLocation,t,e,o)}.bind(this),g);else{var a=this._charset,d=this._isText(o);u(a)&&d?l(r.read(s,!1,!0),e.Reading,t).then(function(e){p(),"string"!=typeof e&&(this._acceptPatch=e.acceptPatch,e=e.result),this._setInputContents(this._parsedLocation,t,e,o)}.bind(this),g):l(r._getService(s).readBlob(s),e.Reading,t).then(function(e){return p(),d?void c(e,a,function(e){this._setInputContents(this._parsedLocation,t,e,o)}.bind(this),g):void this._setInputContents(this._parsedLocation,t,e,o)}.bind(this),g)}else g({responseText:n.formatMessage(e.ReadingMetadataError,s)})}.bind(this),g)}}},processParameters:function(e){var t=this.getEditor();return t&&t.processParameters?t.processParameters(e):!1},getAutoLoadEnabled:function(){return this._autoLoadEnabled},getAutoSaveEnabled:function(){return this._autoSaveEnabled},getEditor:function(){return this.editor},getEncodingCharset:function(){return this._charset||p},getInput:function(){return this._input},getLocation:function(){return this._location},getTitle:function(){return this._title},getFileMetadata:function(){return this._fileMetadata},isSaveEnabled:function(){return!this.getReadOnly()},getReadOnly:function(){var e=this._fileMetadata;return this._readonly||!e||e.Attributes&&e.Attributes.ReadOnly},getContentType:function(){return this._contentType},onFocus:function(){return this._autoSaveEnabled&&this._errorSaving?void this.save():void(this._autoLoadEnabled&&this._fileMetadata&&this.load())},reportStatus:function(e){this.statusReporter?this.statusReporter(e):this.editor&&this.editor.reportStatus(e)},save:function(t){function r(e){var t=l._savingDeferred;return t.resolve(e),l._savingDeferred=null,l._saving=!1,t}function o(n){return f===d.getInput()&&(l.ETag=n.ETag,c.setInput(f,null,p,!0)),d.reportStatus(""),u&&b&&b.setProgressResult({Message:e.Saved,Severity:"Normal"}),d.postSave&&d.postSave(t),r(n)}function s(e){d.reportStatus("");var t=h(b,e);return a.logEvent("status","exception",(d._autoSaveActive?"Auto-save: ":"Save: ")+t.Message),d._errorSaving=!0,r()}var l=this.getFileMetadata();if(!l)return(new i).reject();if(l._saving)return l._savingDeferred;var d=this;l._savingDeferred=new i,l._saving=!0;var c=this.getEditor();if(!c||!c.isDirty()||this.getReadOnly())return r();var u=this._errorSaving,f=this.getInput();this.reportStatus(e["Saving..."]),this._saveEventLogged||(this._logMetrics("save"),this._saveEventLogged=!0),this.dispatchEvent({type:"Saving",inputManager:this}),c.markClean();var p=c.getText(),g=p;if(this._getSaveDiffsEnabled()&&!this._errorSaving){var v=this._getUnsavedChanges();if(v){for(var m=0,_=0;_m&&(g={diff:v})}}this._clearUnsavedChanges(),this._errorSaving=!1;var y=l.ETag,C={ETag:y},w=this._parsedLocation.resource,x=this.fileClient.write(w,g,C),S=this.progressService,b=null;return this.serviceRegistry&&(b=this.serviceRegistry.getService("orion.page.message")),S&&(x=S.progress(x,n.formatMessage(e.savingFile,f))),x.then(o,function(t){if(412===t.status){var i=window.confirm(e.saveOutOfSync);if(!i)return r();var a=d.fileClient.write(w,p);S&&(a=S.progress(a,n.formatMessage(e.savingFile,f))),a.then(o,s)}else s(t)}),l._savingDeferred},setAutoLoadEnabled:function(e){this._autoLoadEnabled=e},setAutoSaveTimeout:function(e){if(this._autoSaveEnabled=-1!==e,this._autoSaveActive=!1,this._idle)this._idle.setTimeout(e);else{var t={document:document,timeout:e};this._idle=new l(t),this._idle.addEventListener("Idle",function(){this._errorSaving||(this._autoSaveActive=!0,this.save().then(function(){this._autoSaveActive=!1}))}.bind(this))}},setContentType:function(e){this._contentType=e},setEncodingCharset:function(e){this._charset=e},setInput:function(t){function n(){c.session&&c.session.save()}if(!this._ignoreInput&&(t||(t=s.hash()),"string"==typeof t)){var i=this.getEditor();t&&"#"!==t[0]&&(t="#"+t);var r=s.matchResourceParameters(t),o=this._parsedLocation||{};if(i&&i.isDirty()){var a=this._location,l=o.resource,d=r.resource;if(l!==d)if(this._autoSaveEnabled)this.save();else if(!window.confirm(e.confirmUnsavedChanges))return void(window.location.hash=a)
+}var h=i&&o.editor!==r.editor;this._location=t,this._parsedLocation=r,this._ignoreInput=!0,this.selection&&this.selection.setSelections(t),this._ignoreInput=!1;var c={type:"InputChanging",input:r};this.dispatchEvent(c);var u=r.resource;if(c.metadata){n(),this.reportStatus(""),this._input=u;var f=c.metadata;return void this._setInputContents(r,u,null,f)}u?u===this._input?h?(this.reportStatus(""),this._setInputContents(r,u,null,this._fileMetadata,this._isText(this._fileMetadata))):this.processParameters(r)||c.session&&c.session.apply(!0):(n(),this._input=u,this._readonly=!1,this._lastMetadata=this._fileMetadata,this._fileMetadata=null,this.load()):(n(),this._setNoInput(!0))}},setTitle:function(e){var t=e.lastIndexOf("/"),n=e;-1!==t&&(n=n.substring(t+1)),this._title=n},setSaveDiffsEnabled:function(e){this._saveDiffsEnabled=e;var t=this.editor;t&&!t.isDirty()&&this._clearUnsavedChanges()},_getSaveDiffsEnabled:function(){return this._saveDiffsEnabled&&this._acceptPatch&&-1!==this._acceptPatch.indexOf("application/json-patch")},_logMetrics:function(e){var t="(none)",n=this.getContentType(),i=this.getFileMetadata();if(n)t=n.id;else if(i){var r=i.Name,o=r.lastIndexOf(".");if(o>=0)t="unregistered: "+r.substring(o);else switch(r){case"AUTHORS":case"config":case"LICENSE":case"make":case"Makefile":t="unregistered: "+r}}a.logEvent("editor",e,t)},_unknownContentTypeAsText:function(){return!0},_isText:function(e){var t=this.contentTypeRegistry.getFileContentType(e);if(!t)return this._unknownContentTypeAsText();var n=this.contentTypeRegistry.getContentType("text/plain");return this.contentTypeRegistry.isExtensionOf(t,n)},_setNoInput:function(e){return e?void this.fileClient.loadWorkspace("").then(function(e){this._input=e.ChildrenLocation,this._setInputContents(e.ChildrenLocation,null,e,e)}.bind(this)):(this._input=this._title=this._fileMetadata=null,this.setContentType(null),void this.dispatchEvent({type:"InputChanged",input:null}))},_setInputContents:function(e,t,n,i,r){var o,s=!1;i?(this._fileMetadata=i,this.setTitle(i.Location||String(i)),this.setContentType(this.contentTypeRegistry.getFileContentType(i)),o=i.Name,s=i.Directory):(this._fileMetadata=null,this.setTitle(t),this.setContentType(this.contentTypeRegistry.getFilenameContentType(this.getTitle())),o=this.getTitle());var l=this.getEditor();this._focusListener&&(l&&l.getTextView&&l.getTextView()&&l.getTextView().removeEventListener("Focus",this._focusListener),this._focusListener=null);var d={type:"InputChanged",input:e,name:o,title:t,contentType:this.getContentType(),metadata:i,location:window.location,contents:n};if(this._logMetrics("open"),this.dispatchEvent(d),this.editor=l=d.editor,!s){if(r||l.setInput(t,null,n),l&&l.getTextView&&l.getTextView()){var h=l.getTextView();h.addEventListener("Focus",this._focusListener=this.onFocus.bind(this))}this._clearUnsavedChanges(),this.processParameters(e)||d.session&&d.session.apply()}this._saveEventLogged=!1,a.logPageLoadTiming("interactive",window.location.pathname)},_getUnsavedChanges:function(){var e=this.editor;return e&&e.getUndoStack&&e.getUndoStack()?e.getUndoStack()._unsavedChanges:null},_clearUnsavedChanges:function(){var e=this.editor;e&&e.getUndoStack&&e.getUndoStack()&&(e.getUndoStack()._unsavedChanges=this._getSaveDiffsEnabled()?[]:null)}}),{handleError:h,InputManager:f}}),define("orion/navigate/nls/messages",{root:!0}),define("orion/navigate/nls/root/messages",{Navigator:"Navigator","Strings Xtrnalizr":"Strings Xtrnalizr","Externalize strings":"Externalize strings from JavaScript files in this folder.",NotSupportFileSystem:"${0} is not supported in this file system",SrcNotSupportBinRead:"Source file service does not support binary read",TargetNotSupportBinWrite:"Target file service does not support binary write",NoFileSrv:"No matching file service for location: ${0}","Choose a Folder":"Choose a Folder","Copy of ${0}":"Copy of ${0}",EnterName:"Enter a new name for '${0}'",ChooseFolder:"Choose folder...",Rename:"Rename",RenameFilesFolders:"Rename the selected files or folders",CompareEach:"Compare with each other","Compare 2 files":"Compare the selected 2 files with each other","Compare with...":"Compare With...",CompareFolders:"Compare the selected folder with a specified folder",Delete:"Delete","Unknown item":"Unknown item","delete item msg":"Are you sure you want to delete these ${0} items?",DeleteTrg:"Are you sure you want to delete '${0}'?",Zip:"Zip",ZipDL:"Create a zip file of the folder contents and download it","New File":"File","Create a new file":"Create a new file",FailedToCreateProject:"Failed to create project: ${0}",FailedToCreateFile:"Failed to create file: ${0}",CopyFailed:"Copy operation failed",MoveFailed:"Move operation failed","Name:":"Name:","New Folder":"Folder","Folder name:":"Folder name:","Create a new folder":"Create a new folder","Creating folder":"Creating folder",Folder:"Folder","Create an empty folder":"Create an empty folder",CreateEmptyMsg:"Create an empty folder on the Orion server. You can import, upload, or create content in the editor.","Sample HTML5 Site":"Sample HTML5 Site","Generate a sample":"Generate a sample",'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.':'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.',"Creating a folder for ${0}":"Creating a folder for ${0}","SFTP Import":"SFTP Import","Import content from SFTP":"Import content from SFTP","Imported Content":"Imported Content","Upload a Zip":"Upload a Zip","Upload content from a local zip file":"Upload content from a local zip file","Uploaded Content":"Uploaded Content","Clone Git Repository":"Clone Git Repository","Clone a git repository":"Clone a git repository","Link to Server":"Link to Server",LinkContent:"Link to existing content on the server",CreateLinkedFolder:"Create a folder that links to an existing folder on the server.","Server path:":"Server path:",NameLocationNotClear:"The name and server location were not specified.","Go Up":"Go Up",GoUpToParent:"Move up to the parent folder","Go Into":"Go Into",GoSelectedFolder:"Move into the selected folder","File or zip archive":"File or Zip Archive",ImportLcFile:"Import a file or zip archive from your local file system","SFTP from...":"SFTP",CpyFrmSftp:"Copy files and folders from a specified SFTP connection","Importing from ${0}":"Importing from ${0}","SFTP to...":"SFTP",CpyToSftp:"Copy files and folders to a specified SFTP location",Exporting:"Exporting to ${0}","Pasting ${0}":"Pasting ${0}","Copy to":"Copy to","Move to":"Move to","Copying ${0}":"Copying ${0}","Moving ${0}":"Moving ${0}","Renaming ${0}":"Renaming ${0}","Deleting ${0}":"Deleting ${0}","Creating ${0}":"Creating ${0}","Linking to ${0}":"Linking to ${0}",MvToLocation:"Move files and folders to a new location",Cut:"Cut",Copy:"Copy","Fetching children of ":"Fetching children of ",Paste:"Paste","Open With":"Open With","Loading ":"Loading ",New:"New",File:"File",Actions:"Actions","Orion Content":"Orion Content","Create new content":"Create new content","Import from HTTP...":"HTTP","File URL:":"File URL:",ImportURL:"Import a file from a URL and optionally unzip it","Unzip *.zip files:":"Unzip *.zip files:","Extracted from:":"Extracted from:",FolderDropNotSupported:"Did not drop ${0}. Folder drop is not supported in this browser.",CreateFolderErr:"You cannot copy files directly into the workspace. Create a folder first.","Unzip ${0}?":"Unzip ${0}?","Upload progress: ":"Upload progress: ","Uploading ":"Uploading ","Cancel upload":"Cancel upload",UploadingFileErr:"Uploading the following file failed: ","Enter project name:":"Enter project name:","Create new project":"Create new project","Creating project ${0}":"Creating project ${0}",NoFile:"Use the ${0} menu to create new files and folders. Click a file to start coding.",Download:"Download",Download_tooltips:"Download the file contents as the displayed name","Downloading...":"Reading file contents...","Download not supported":"Contents download is not supported in this browser.",gettingContentFrom:"Getting content from ",confirmLaunchDelete:'Delete Launch Configuration "${0}" ?',deletingLaunchConfiguration:"Deleting launch configuration...",deployTo:"Deploy to ",deploy:"Deploy ",connect:"Connect",fetchContent:"Fetch content",fetchContentOf:"Fetch content of ",disconnectFromProject:"Disconnect from project",doNotTreatThisFolder:"Do not treat this folder as a part of the project",checkStatus:"Check status",checkApplicationStatus:"Check application status",checkApplicationState:"Check application state",stop:"Stop",start:"Start",stopApplication:"Stop the App",startApplication:"Start the application",manage:"Manage",manageThisApplicationOnRemote:"Manage this application on remote server",deleteLaunchConfiguration:"Delete this launch configuration",editLaunchConfiguration:"Edit this launch configuration",deployThisApplication:"Deploy the App from the Workspace",associatedFolder:"Associated Folder",associateAFolderFromThe:"Associate a folder from the workspace with this project.",convertToProject:"Convert to project",convertThisFolderIntoA:"Convert this folder into a project",thisFolderIsAProject:"This folder is a project already.",basic:"Basic","createAnEmptyProject.":"Create an empty project.",sFTP:"SFTP",createAProjectFromAn:"Create a project from an SFTP site.",readMeCommandName:"Readme File",readMeCommandTooltip:"Create a README.md file in this project",zipArchiveCommandName:"Zip Archive",zipArchiveCommandTooltip:"Create a project from a local zip archive.","Url:":"Url:",notZip:"The following files are not zip files: ${0}. Would you like to continue the import?",notZipMultiple:"There are multiple non-zip files being uploaded. Would you like to continue the import?",Cancel:"Cancel",Ok:"Ok",missingCredentials:"Enter the ${0} authentication credentials associated with ${1} to check its status.",deploying:"deploying",starting:"restarting",stopping:"stopping",checkingStateShortMessage:"checking status"}),define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(e,t,n){function i(t,i,r){if(!t[i])throw new Error(n.formatMessage(e.NotSupportFileSystem,i));return t[i].apply(t,r)}function r(n,o,s,a){if(!n.readBlob)throw new Error(e.SrcNotSupportBinRead);if(!s.writeBlob)throw new Error(e.TargetNotSupportBinWrite);if("/"!==o[o.length-1])return i(n,"readBlob",[o]).then(function(e){return i(s,"writeBlob",[a,e])});var l=a.substring(0,a.length-1),d=decodeURIComponent(l.substring(l.lastIndexOf("/")+1)),h=l.substring(0,l.lastIndexOf("/")+1);return i(s,"createFolder",[h,d]).then(function(){},function(){}).then(function(){return i(n,"fetchChildren",[o]).then(function(e){for(var i=[],o=0;o=0){r=i;break}t(i.extension,s)&&(r=i)}if(!r)for(o=s.indexOf(".");!r&&o>=0;){for(o++,s=s.substring(o),a=0;ai){var c=r(i);t=s+c*l,o(t)}else o(a),h.stop()}var t,n="number"==typeof this.options.duration?this.options.duration:350,i="number"==typeof this.options.rate?this.options.rate:20,r=this.options.easing||this.defaultEasing,o=this.options.onAnimate||function(){},s=this.options.curve[0],a=this.options.curve[1],l=a-s,d=-1,h=this;this.interval=this.options.window.setInterval(e,i)},e.prototype.stop=function(){this.options.window.clearInterval(this.interval);var e=this.options.onEnd||function(){};e()},e.prototype.defaultEasing=function(e){return Math.sin(e*(Math.PI/2))},e}();return{contains:n,getNodeStyle:i,addEventListener:e,removeEventListener:t,Animation:r}}),define("orion/editor/textView",["i18n!orion/editor/nls/messages","orion/editor/textModel","orion/editor/keyModes","orion/editor/eventTarget","orion/editor/textTheme","orion/editor/util","orion/util","orion/metrics"],function(e,t,n,i,r,o,s,a){function l(e){return e.defaultView||e.parentWindow}function d(e){return new Array(e)}function h(e,t,n){if(n){t.className="";for(var i=t.attributes,r=i.length;r-->0;)(!s.isIE||s.isIE>=9||s.isIE<9&&i[r].specified)&&t.removeAttribute(i[r].name)}if(e){e.styleClass&&(t.className=e.styleClass);var o=e.style;if(o)for(var a in o)o.hasOwnProperty(a)&&(t.style[a]=o[a]);var l=e.attributes;if(l)for(var d in l)l.hasOwnProperty(d)&&t.setAttribute(d,l[d])}}function c(e){return e instanceof Array?e.slice(0):e}function u(e,t){if(!e)return t;if(!t)return e;for(var n in t)t.hasOwnProperty(n)&&(e.hasOwnProperty(n)||(e[n]=t[n]));return e}function f(e,t){if(e===t)return!0;if(e&&!t||!e&&t)return!1;if(e&&e.constructor===String||t&&t.constructor===String)return!1;if(e instanceof Array||t instanceof Array){if(!(e instanceof Array&&t instanceof Array))return!1;if(e.length!==t.length)return!1;for(var n=0;no;){-1!==i&&o>=i&&(i=e.indexOf("\r",o)),-1!==r&&o>=r&&(r=e.indexOf("\n",o));var a,l=o;if(-1===r&&-1===i){t(e.substring(o));break}-1!==i&&-1!==r?i+1===r?(a=i,o=r+1):(a=r>i?i:r,o=(r>i?i:r)+1):-1!==i?(a=i,o=i+1):(a=r,o=r+1),t(e.substring(l,a)),n?n():o===s&&t("")}}function g(e){var t,n,i,r,o=l(e.ownerDocument);if(o.getComputedStyle){var s=o.getComputedStyle(e,null);t=s.getPropertyValue("border-left-width"),n=s.getPropertyValue("border-top-width"),i=s.getPropertyValue("border-right-width"),r=s.getPropertyValue("border-bottom-width")}else e.currentStyle&&(t=e.currentStyle.borderLeftWidth,n=e.currentStyle.borderTopWidth,i=e.currentStyle.borderRightWidth,r=e.currentStyle.borderBottomWidth);return{left:parseInt(t,10)||0,top:parseInt(n,10)||0,right:parseInt(i,10)||0,bottom:parseInt(r,10)||0}}function v(e){var t,n,i,r,o=l(e.ownerDocument);if(o.getComputedStyle){var s=o.getComputedStyle(e,null);t=s.getPropertyValue("padding-left"),n=s.getPropertyValue("padding-top"),i=s.getPropertyValue("padding-right"),r=s.getPropertyValue("padding-bottom")}else e.currentStyle&&(t=e.currentStyle.paddingLeft,n=e.currentStyle.paddingTop,i=e.currentStyle.paddingRight,r=e.currentStyle.paddingBottom);return{left:parseInt(t,10)||0,top:parseInt(n,10)||0,right:parseInt(i,10)||0,bottom:parseInt(r,10)||0}}function m(e){var t=e._trim;if(!t){t=v(e);var n=g(e);t.left+=n.left,t.top+=n.top,t.right+=n.right,t.bottom+=n.bottom,e._trim=t}return t}function _(e,t,n,i){function r(t){if(t.animationName===a){var n=t.target;"function"==typeof n.__DOMReady&&l(e).setTimeout(function(){n.__DOMReady()},0)}}function o(e,t){for(var n=["","-webkit-","-moz-","-ms-","-o-"],i="",r="body ."+e+" {\n",o=0;on;n++){var i=e._createSelectionDiv();t.appendChild(i),this._divs.push(i)}}function w(e){this.left=e.left,this.top=e.top,this.right=e.right,this.bottom=e.bottom}function x(e,t,n){this.view=e,this.lineIndex=t,this._lineDiv=n}function S(e){this._init(e||{})}var b=o.addEventListener,T=o.removeEventListener,E=o.Animation;return y.compare=function(e,t){if(e.length!==t.length)return!1;for(var n=0;n=0;n--)if(e[n]._editing)return e[n];return e[e.length-1]}for(n=0;n=n.end||n._editing||e[i]._editing?(t.push(n),n=e[i]):n.end=Math.max(n.end,e[i].end);return t.push(n),t},y.prototype={clone:function(){var e=new y(this.start,this.end,this.caret);return e._columnX=this._columnX,e._editing=this._editing,e._docX=this._docX,e},contains:function(e){return this.start<=e&ðis.end){var t=this.start;this.start=this.end,this.end=t,this.caret=!this.caret}},setCaret:function(e){this.start=e,this.end=e,this.caret=!1},getCaret:function(){return this.caret?this.start:this.end},getAnchor:function(){return this.caret?this.end:this.start},getOrientedSelection:function(){return{start:this.getAnchor(),end:this.getCaret()}},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(e){return this.caret===e.caret&&this.start===e.start&&this.end===e.end&&this._editing===e._editing}},C.prototype={destroy:function(){this._divs&&(this._divs.forEach(function(e){e.parentNode.removeChild(e)}),this._divs=null)},setPrimary:function(e){this.primary=e},update:function(){var e,t=this._view,n=this.primary,i=t._hasFocus,r=t._cursorVisible,o=!this.primary&&this._selection&&this._selection.isEmpty();e=o?"textviewSelectionCaret":i?"textviewSelection":"textviewSelectionUnfocused",this._divs[0].style.visibility=o&&r&&i||!o?"visible":"hidden",this._divs[0].style.zIndex=r&&o?"2":"0",this._divs.forEach(function(t){t.className=e,s.isWebkit&&n&&(t.style.background=i?"transparent":"")})},setSelection:function(e){this._selection=e,this.update();var t=this._view,n=t._model,i=n.getLineAtOffset(e.start),r=n.getLineAtOffset(e.end),o=t._getLineNext();if(o){var s,a,l,d,h=t._getLinePrevious();ih.lineIndex?(s=h,l=n.getLineStart(h.lineIndex)):(s=t._getLineNode(i),l=e.start),rh.lineIndex?(a=h,d=n.getLineStart(h.lineIndex)):(a=t._getLineNode(r),d=e.end),this._setDOMSelection(s,l,a,d,e.caret)}},_setDOMSelection:function(e,t,n,i,r){if(this._setDOMFullSelection(e,t,n,i),this.primary){var o=this._view,a=e._line.getNodeOffset(t),l=n._line.getNodeOffset(i);if(a.node&&l.node){var d,h=o._getWindow(),c=o._parent.ownerDocument;if(h.getSelection){var u=h.getSelection();if(d=c.createRange(),d.setStart(a.node,a.offset),d.setEnd(l.node,l.offset),!o._hasFocus||u.anchorNode===a.node&&u.anchorOffset===a.offset&&u.focusNode===l.node&&u.focusOffset===l.offset&&u.anchorNode===l.node&&u.anchorOffset===l.offset&&u.focusNode===a.node&&u.focusOffset===a.offset||(o._anchorNode=a.node,o._anchorOffset=a.offset,o._focusNode=l.node,o._focusOffset=l.offset,o._ignoreSelect=!1,u.rangeCount>0&&u.removeAllRanges(),u.addRange(d),o._ignoreSelect=!0),o._cursorDiv){d=c.createRange(),r?(d.setStart(a.node,a.offset),d.setEnd(a.node,a.offset)):(d.setStart(l.node,l.offset),d.setEnd(l.node,l.offset));var f=d.getClientRects()[0],p=o._cursorDiv.parentNode,g=p.getBoundingClientRect();f&&g&&(o._cursorDiv.style.top=f.top-g.top+p.scrollTop+"px",o._cursorDiv.style.left=f.left-g.left+p.scrollLeft+"px")}}else if(c.selection){if(!o._hasFocus)return;var v=c.body,m=s.createElement(c,"div");v.appendChild(m),v.removeChild(m),d=v.createTextRange(),d.moveToElementText(a.node.parentNode),d.moveStart("character",a.offset);var _=v.createTextRange();_.moveToElementText(l.node.parentNode),_.moveStart("character",l.offset),d.setEndPoint("EndToStart",_),o._ignoreSelect=!1,d.select(),o._ignoreSelect=!0}}}},_setDOMFullSelection:function(e,t,n,i){this._divs.forEach(function(e){e.style.width=e.style.height="0px"});var r=this._view;if(r._fullSelection&&!(s.isIOS||e===n&&t===i&&this.primary)){var o=r._getViewPadding(),a=r._clientDiv.getBoundingClientRect(),l=r._viewDiv.getBoundingClientRect(),d=l.left+o.left,h=a.right,c=l.top+o.top,u=a.bottom,f=0,p=0;if(r._clipDiv){var g=r._clipDiv.getBoundingClientRect();f=g.left-r._clipDiv.scrollLeft,p=g.top}else{var v=r._rootDiv.getBoundingClientRect();f=v.left,p=v.top}r._ignoreDOMSelection=!0;var m,_,y=new x(r,e.lineIndex,e),C=y.getBoundingClientRect(t,!1),w=C.left;e===n&&t===i?(m=y,_=C):(m=new x(r,n.lineIndex,n),_=m.getBoundingClientRect(i,!1));var S=_.left;r._ignoreDOMSelection=!1;var b=this._divs[0],T=Math.min(h,Math.max(d,w)),E=Math.min(u,Math.max(c,C.top)),L=h,k=Math.min(u,Math.max(c,C.bottom));if(b.style.left=T-f+"px",b.style.top=E-p+"px",b.style.width=Math.max(0,L-T)+"px",b.style.height=Math.max(0,k-E)+"px",e.lineIndex===n.lineIndex)L=Math.min(S,h),b.style.width=Math.max(this.primary?0:1,L-T)+"px";else{var A=d,M=Math.min(u,Math.max(c,_.top)),D=Math.min(h,Math.max(d,S)),O=Math.min(u,Math.max(c,_.bottom)),N=this._divs[2];if(N.style.left=A-f+"px",N.style.top=M-p+"px",N.style.width=Math.max(0,D-A)+"px",N.style.height=Math.max(0,O-M)+"px",Math.abs(e.lineIndex-n.lineIndex)>1){var I=this._divs[1];I.style.left=d-f+"px",I.style.top=k-p+"px",I.style.width=Math.max(0,h-d)+"px",I.style.height=Math.max(0,M-k)+"px"}}}}},w.prototype={toString:function(){return"{l="+this.left+", t="+this.top+", r="+this.right+", b="+this.bottom+"}"}},x.prototype={create:function(e,t){if(!this._lineDiv){var n=this._lineDiv=this._createLine(e,t,this.lineIndex);return n._line=this,n}},_createLine:function(e,t,n){var i=this.view,r=i._model,o=r.getLine(n),a=r.getLineStart(n),l={type:"LineStyle",textView:i,lineIndex:n,lineText:o,lineStart:a};i.onLineStyle(l);var d=e.ownerDocument,c=t||s.createElement(d,"div");if(t&&f(t.viewStyle,l.style)||(h(l.style,c,t),t&&(t._trim=null),c.viewStyle=l.style,c.setAttribute("role","presentation")),c.lineIndex=n,t&&c.viewLineText===o&&f(l.ranges,c.viewRanges))return c;c.viewRanges=l.ranges,c.viewLineText=o;var u=[],p={tabOffset:0,ranges:u};this._createRanges(l.ranges,o,0,o.length,a,p);var g=" ";!i._fullSelection&&s.isIE<9&&(g="");var v={text:g,style:i._metrics.largestFontStyle,ignoreChars:1};0!==u.length&&u[u.length-1].style&&"div"===u[u.length-1].style.tagName?u.splice(u.length-1,0,v):u.push(v);var m,_,y,C,w,x,S,b,T=0,E=0;if(s.isFirefox&&o.length>2e3){t&&(c.innerHTML="",t.lineWidth=void 0);var L=d.createDocumentFragment();for(b=0;b=A&&(D-=k);var O=y.firstChild.data,N=O?O.length:0;if(E+N>D)break;E+=N}S=y.nextSibling,c.removeChild(y),y=S}}m=this._createSpan(c,w,_,v.ignoreChars),y?c.insertBefore(m,y):c.appendChild(m),t&&(t.lineWidth=void 0)}if(t)for(var I=m?m.nextSibling:null;I;)S=I.nextSibling,t.removeChild(I),I=S}return c.parentNode||e.appendChild(c),c},_createRanges:function(e,t,n,i,r,o){if(!(n>i)){if(e)for(var s=0;si)break;var d=Math.min(r+i,a.end)-r;if(d>=l){if(l=Math.max(n,l),d=Math.min(i,d),l>n&&this._createRange(t,n,l,null,o),!a.style||!a.style.unmergeable)for(;s+1n&&this._createRange(t,n,i,null,o)}},_createRange:function(e,t,n,i,r){if(!(t>n)){var o,s=this.view._customTabSize;if(s&&8!==s)for(var a=e.indexOf(" ",t);-1!==a&&n>a;){a>t&&(o={text:e.substring(t,a),style:i},r.ranges.push(o),r.tabOffset+=o.text.length);var l=s-r.tabOffset%s;if(l>0){for(var d=" ",h=1;l>h;h++)d+=" ";o={text:d,style:i,ignoreChars:l-1},r.ranges.push(o),r.tabOffset+=o.text.length}if(t=a+1,t===n)return;a=e.indexOf(" ",t)}n>=t&&(o={text:e.substring(t,n),style:i},r.ranges.push(o),r.tabOffset+=o.text.length)}},_createSpan:function(e,t,n,i){var r=this.view,o="span";n&&n.tagName&&(o=n.tagName.toLowerCase());var a="a"===o;a&&(this.hasLink=!0),a&&!r._linksVisible&&(o="span");var l=e.ownerDocument,d=s.createElement(e.ownerDocument,o);if(d.appendChild(l.createTextNode(n&&n.text?n.text:t)),n&&n.html?(d.innerHTML=n.html,d.ignore=!0):n&&n.node&&(d.appendChild(n.node),d.ignore=!0),h(n,d),"a"===o){var c=r._getWindow();b(d,"click",function(e){return r._handleLinkClick(e?e:c.event)},!1)}return d.viewStyle=n,i&&(d.ignoreChars=i),d},_ensureCreated:function(){return this._lineDiv?this._lineDiv:this._createdDiv=this.create(this.view._clientDiv,null)},getBoundingClientRect:function(e,t){var n=this._ensureCreated(),i=this.view;if(void 0===e)return this._getLineBoundingClientRect(n,!0);var r=i._model,o=n.ownerDocument,a=this.lineIndex,d=null;if(ee){var c,u=e-h;if(1===r.length)d=new w(t.getBoundingClientRect());else if(i._isRangeRects)c=o.createRange(),c.setStart(r,u),c.setEnd(r,u+1),d=new w(c.getBoundingClientRect());else if(s.isIE){c=o.body.createTextRange(),c.moveToElementText(t),c.collapse();var f=0===u&&8===s.isIE;f&&(u=1),c.moveEnd("character",u+1),c.moveStart("character",u),d=new w(c.getBoundingClientRect()),f&&(d.left=t.getClientRects()[0].left)}else{var p=r.data;t.removeChild(r),t.appendChild(o.createTextNode(p.substring(0,u)));var g=s.createElement(o,"span");if(g.appendChild(o.createTextNode(p.substring(u,u+1))),t.appendChild(g),t.appendChild(o.createTextNode(p.substring(u+1))),d=new w(g.getBoundingClientRect()),t.innerHTML="",t.appendChild(r),!this._createdDiv){var v=i._getSelections()[0];(h<=v.start&&v.starts.right&&(s.right=a.right),a.bottom>s.bottom&&(s.bottom=a.bottom))}}return!0}),void 0!==e?n[e]:n},_getLineBoundingClientRect:function(e,t){var n=new w(e.getBoundingClientRect());if(this.view._wrapMode);else{n.right=n.left;for(var i=e.lastChild;i&&i.ignoreChars===i.firstChild.length;)i=i.previousSibling;if(i){var r=i.getBoundingClientRect();n.right=r.right+m(e).right}}if(t){var o=m(e);n.left=n.left+o.left,n.right=n.right-o.right}return n},getLineCount:function(){return this.view._wrapMode?this.getClientRects().length:1},getLineIndex:function(e){if(!this.view._wrapMode)return 0;for(var t=this.getClientRects(),n=this.getBoundingClientRect(e),i=n.top+(n.bottom-n.top)/2,r=0;rs||i+o>=a?(t=r,n=s-i,e.ignoreChars&&o>0&&n===o&&(n+=e.ignoreChars),!1):(i+=o,!0)}),{node:t,offset:n}},getText:function(e){var t="",n=0;return this.forEach(function(i){var r;if(i.ignoreChars){r=i.lastChild;for(var o=0,s=[],a=-1;r;){var l=r.data;if(l)for(var d=l.length-1;d>=0;d--){var h=l.substring(d,d+1);o1;){var O=Math.floor((M+D)/2);y=D+1,C=O===b-1&&n.ignoreChars?S.length:O+1,w=0===y&&8===s.isIE,r._isRangeRects?(_.setStart(S,y),_.setEnd(S,C)):(w&&(y=1),_.moveToElementText(n),_.move("character",y),_.moveEnd("character",C-y)),x=_.getClientRects();for(var N=!1,I=0;I=c&&v>e&&(!r._wrapMode||t>=u&&m>=t)){N=!0;break}N?M=O:D=O}i+=M,y=M,C=M===b-1&&n.ignoreChars?S.length:Math.min(M+1,S.length),r._isRangeRects?(_.setStart(S,y),_.setEnd(S,C)):(_.moveToElementText(n),_.move("character",y),_.moveEnd("character",C-y)),x=_.getClientRects();var R=!1;x.length>0&&(h=x[0],c=(w?A:h.left)*L-p.left,v=h.right*L-p.left,R=e>c+(v-c)/2);var B=i-d,P=o.getLine(a),F=P.charCodeAt(B);F>=55296&&56319>=F&&R?B=56320&&57343>=F&&(i+=1)):F>=56320&&57343>=F&&!R&&B>0&&(F=P.charCodeAt(B-1),F>=55296&&56319>=F&&(i-=1)),R&&i++}else{for(var V=[],U=0;b>U;U++)V.push(""),V.push(U===b-1?S.data.substring(U):S.data.substring(U,U+1)),V.push(" ");n.innerHTML=V.join("");for(var K=n.firstChild;K;){if(h=K.getBoundingClientRect(),c=h.left-p.left,v=h.right-p.left,e>=c&&v>e){e>c+(v-c)/2&&i++;break}i++,K=K.nextSibling}if(!g._createdDiv){n.innerHTML="",n.appendChild(S);var W=r._getSelections()[0];(i<=W.start&&W.startu.right&&(e=u.right-1)}else 0>e&&(e=0),e>p.right-p.left&&(e=p.right-p.left);var m,_;if(this._lastHitChild&&this._lastHitChild.parentNode){if(m=this._lastHitOffset,_=this._lastHitChild,u=i(_),!u)for(var y=m,C=m+this._nodeLength(_),w=_.previousSibling,x=_.nextSibling;w||x;){if(w){if(y-=this._nodeLength(w),u=i(w)){_=w,m=y;break}w=w.previousSibling}if(x){if(u=i(x)){_=x,m=C;break}C+=this._nodeLength(x),x=x.nextSibling}}}else m=d,this.forEach(function(e){return _=e,(u=i(_))?!1:(m+=this._nodeLength(_),!0)});return _&&u&&(this._lastHitChild=_,this._lastHitOffset=m,m=n(_,m,u)),Math.min(h,Math.max(d,m))},getNextOffset:function(e,t){if("line"===t.unit){var n=this.view,i=n._model,r=i.getLineAtOffset(e);return t.count>0?(t.count--,i.getLineEnd(r)):(t.count++,i.getLineStart(r))}return"wordend"===t.unit||"wordWS"===t.unit||"wordendWS"===t.unit?this._getNextOffset_W3C(e,t):s.isIE?this._getNextOffset_IE(e,t):this._getNextOffset_W3C(e,t)},_getNextOffset_W3C:function(e,t){function n(e){return e>=33&&47>=e||e>=58&&64>=e||e>=91&&94>=e||96===e||e>=123&&126>=e}function i(e){return 32===e||9===e}var r,o=this.view,s=o._model,a=s.getLineAtOffset(e),l=s.getLine(a),d=s.getLineStart(a),h=s.getLineEnd(a),c=l.length,u=e-d,f=t.count<0?-1:1;if("word"===t.unit||"wordend"===t.unit||"wordWS"===t.unit||"wordendWS"===t.unit)for(var p,g,v,m;0!==t.count;){if(t.count>0){if(u===c)return h;for(r=l.charCodeAt(u),p=n(r),g=!p&&!i(r),u++;c>u;){if(r=l.charCodeAt(u),"wordWS"!==t.unit&&"wordendWS"!==t.unit){if(v=n(r),"wordend"===t.unit){if(!v&&p)break}else if(v&&!p)break;m=!v&&!i(r)}else m=!i(r);if("wordend"===t.unit||"wordendWS"===t.unit){if(!m&&g)break}else if(m&&!g)break;g=m,p=v,u++}}else{if(0===u)return d;for(u--,r=l.charCodeAt(u),p=n(r),g=!p&&!i(r);u>0;){if(r=l.charCodeAt(u-1),"wordWS"!==t.unit&&"wordendWS"!==t.unit){if(v=n(r),"wordend"===t.unit){if(v&&!p)break}else if(!v&&p)break;m=!v&&!i(r)}else m=!i(r);if("wordend"===t.unit||"wordendWS"===t.unit){if(m&&!g)break}else if(!m&&g)break;g=m,p=v,u--}}t.count-=f}else for(;0!==t.count&&u+f>=0&&c>=u+f;)u+=f,r=l.charCodeAt(u),r>=56320&&57343>=r&&u>0&&(r=l.charCodeAt(u-1),r>=55296&&56319>=r&&(u+=f)),t.count-=f;return d+u},_getNextOffset_IE:function(e,t){var n,i,r,o=this._ensureCreated(),s=this.view,a=s._model,l=this.lineIndex,d=0,h=a.getLineStart(l),c=a.getLine(l),u=a.getLineStart(l),f=o.ownerDocument,p=t.count<0?-1:1;if(e===a.getLineEnd(l)){for(r=o.lastChild;r&&r.ignoreChars===r.firstChild.length;)r=r.previousSibling;if(!r)return h;n=f.body.createTextRange(),n.moveToElementText(r),i=n.text.length,n.moveEnd(t.unit,p),d=e+n.text.length-i}else if(e===h&&t.count<0)d=h;else for(r=o.firstChild;r;){var g=this._nodeLength(r);if(h+g>e){if(n=f.body.createTextRange(),e===h&&t.count<0){for(var v=r.previousSibling;v&&(!v.firstChild||!v.firstChild.length);)v=v.previousSibling;n.moveToElementText(v?v:r.previousSibling)}else n.moveToElementText(r),n.collapse(),n.moveEnd("character",e-h);i=n.text.length,n.moveEnd(t.unit,p),d=e+n.text.length-i;break}h=g+h,r=r.nextSibling}var m=d-u,_=c.charCodeAt(m);return _>=56320&&57343>=_&&m>0&&(_=c.charCodeAt(m-1),_>=55296&&56319>=_&&(m+=p)),d=m+u,t.count-=p,d},updateLinks:function(){var e=this._ensureCreated();if(this.hasLink){var t=this;this.forEach(function(n){var i=n.viewStyle;return i&&i.tagName&&"a"===i.tagName.toLowerCase()&&e.replaceChild(t._createSpan(e,n.firstChild.data,i),n),!0})}},destroy:function(){var e=this._createdDiv;e&&(e.parentNode.removeChild(e),this._createdDiv=null)}},S.prototype={addKeyMode:function(e,t){var n=this._keyModes;void 0!==t?n.splice(t,0,e):n.push(e),e._modeAdded&&e._modeAdded()},addRuler:function(e,t){var n=this._rulers;if(void 0!==t){var i,r;for(i=0,r=0;ir;i++)e.getLocation()===n[i].getLocation()&&r++;n.splice(r,0,e),t=r}else n.push(e);this._createRuler(e,t),e.setView(this),this._update()},computeSize:function(){var e=0,t=0,n=this._model,i=this._clientDiv;if(!i)return{width:e,height:t};var r=i.style.width;s.isWebkit&&(i.style.width="0x7fffffffpx");for(var o=n.getLineCount(),a=0;o>a;a++){var l=this._getLine(a),d=l.getBoundingClientRect();e=Math.max(e,d.right-d.left),t+=d.bottom-d.top,l.destroy()}s.isWebkit&&(i.style.width=r);var h=this._getViewPadding();return e+=h.right+h.left+this._metrics.scrollWidth,t+=h.bottom+h.top+this._metrics.scrollWidth,{width:e,height:t}},convert:function(e,t,n){if(!this._clientDiv)return e;var i=this._getScroll(),r=this._getViewPadding(),o=this._viewDiv.getBoundingClientRect();return"document"===t&&(void 0!==e.x&&(e.x+=-i.x+o.left+r.left),void 0!==e.y&&(e.y+=-i.y+o.top+r.top)),"document"===n&&(void 0!==e.x&&(e.x+=i.x-o.left-r.left),void 0!==e.y&&(e.y+=i.y-o.top-r.top)),e},copy:function(){return this._clientDiv?this._doCopy():!1},cut:function(){return this._clientDiv?this._doCut():!1},destroy:function(){for(var e=0;en)return!1;
+var i=this._getLine(n),r=this.getOffsetAtLocation(e,t),o=i.getBoundingClientRect(r);return i.destroy(),e>o.right?!1:!0},getLinePixel:function(e){return this._clientDiv?this._getLinePixel(e):0},getLocationAtOffset:function(e){if(!this._clientDiv)return{x:0,y:0};var t=this._model;e=Math.min(Math.max(0,e),t.getCharCount());var n=t.getLineAtOffset(e),i=this._getLine(n),r=i.getBoundingClientRect(e);i.destroy();var o=r.left,s=this._getLinePixel(n)+r.top;return{x:o,y:s}},getNextOffset:function(e,t){var n=new y(e,e,!1);return this._doMove(t,n),n.getCaret()},getOptions:function(){var e;if(0===arguments.length)e=this._defaultOptions();else if(1===arguments.length){var t=arguments[0];if("string"==typeof t)return c(this["_"+t]);e=t}else{e={};for(var n in arguments)arguments.hasOwnProperty(n)&&(e[arguments[n]]=void 0)}for(var i in e)e.hasOwnProperty(i)&&(e[i]=c(this["_"+i]));return e},getModel:function(){return this._model},getOffsetAtLocation:function(e,t){if(!this._clientDiv)return 0;var n=this._getLineIndex(t),i=this._getLine(n),r=i.getOffset(e,t-this._getLinePixel(n));return i.destroy(),r},getLineAtOffset:function(e){return this.getModel().getLineAtOffset(e)},getLineStart:function(e){return this.getModel().getLineStart(e)},getRulers:function(){return this._rulers.slice(0)},getSelection:function(){return this._getSelection()},getSelections:function(){return this._getSelections()},getSelectionText:function(e){var t=[],n=this,i=this._getSelections();return i.forEach(function(e){e.isEmpty()||t.push(n._getBaseText(e.start,e.end))}),t.join(void 0!==e?e:this._model.getLineDelimiter())},getText:function(e,t){var n=this._model;return n.getText(e,t)},getTopIndex:function(e){return this._clientDiv?this._getTopIndex(e):0},getTopPixel:function(){return this._clientDiv?this._getScroll().y:0},invokeAction:function(e,t,n){if(this._clientDiv){var i=this._actions[e];if(i){if(i.actionDescription&&i.actionDescription.id&&a.logEvent("editor","action",i.actionDescription.id),!t&&i.handler&&i.handler(n))return!0;if(i.defaultHandler)return"boolean"==typeof i.defaultHandler(n)}return!1}},isDestroyed:function(){return!this._clientDiv},onContextMenu:function(e){return this.dispatchEvent(e)},onDragStart:function(e){return this.dispatchEvent(e)},onDrag:function(e){return this.dispatchEvent(e)},onDragEnd:function(e){return this.dispatchEvent(e)},onDragEnter:function(e){return this.dispatchEvent(e)},onDragOver:function(e){return this.dispatchEvent(e)},onDragLeave:function(e){return this.dispatchEvent(e)},onDrop:function(e){return this.dispatchEvent(e)},onDestroy:function(e){return this.dispatchEvent(e)},onSaving:function(e){return this.dispatchEvent(e)},onInputChanged:function(e){return this.dispatchEvent(e)},onLineStyle:function(e){return this.dispatchEvent(e)},onKeyDown:function(e){return this.dispatchEvent(e)},onKeyPress:function(e){return this.dispatchEvent(e)},onKeyUp:function(e){return this.dispatchEvent(e)},onModelChanged:function(e){return this.dispatchEvent(e)},onModelChanging:function(e){return this.dispatchEvent(e)},onModify:function(e){return this.dispatchEvent(e)},onMouseDown:function(e){return this.dispatchEvent(e)},onMouseUp:function(e){return this.dispatchEvent(e)},onMouseMove:function(e){return this.dispatchEvent(e)},onMouseOver:function(e){return this.dispatchEvent(e)},onMouseOut:function(e){return this.dispatchEvent(e)},onTouchStart:function(e){return this.dispatchEvent(e)},onTouchMove:function(e){return this.dispatchEvent(e)},onTouchEnd:function(e){return this.dispatchEvent(e)},onOptions:function(e){return this.dispatchEvent(e)},onSelection:function(e){return this.dispatchEvent(e)},onScroll:function(e){return this.dispatchEvent(e)},onVerify:function(e){return this.dispatchEvent(e)},onFocus:function(e){return this.dispatchEvent(e)},onBlur:function(e){return this.dispatchEvent(e)},paste:function(){return this._clientDiv?this._doPaste():!1},redraw:function(){if(!(this._redrawCount>0)){var e=this._model.getLineCount();this.redrawRulers(0,e),this.redrawLines(0,e)}},redrawRulers:function(e,t){if(!(this._redrawCount>0))for(var n=this.getRulers(),i=0;i0)&&(void 0===e&&(e=0),void 0===t&&(t=this._model.getLineCount()),e!==t)){var i=this._clientDiv;if(i){if(n){var r=this._getRulerParent(n);for(i=r.firstChild;i&&i._ruler!==n;)i=i.nextSibling}n?i.rulerChanged=!0:this._lineHeight&&this._resetLineHeight(e,t);var o=-1;if(n||-1===this._imeOffset||(o=this._model.getLineAtOffset(this._imeOffset)),!n||"page"===n.getOverview())for(var s=i.firstChild;s;){var a=s.lineIndex;a>=e&&t>a&&a!==o&&(s.lineChanged=!0),s=s.nextSibling}n||this._wrapMode||e<=this._maxLineIndex&&this._maxLineIndex0)){var n=this._model;void 0===e&&(e=0),void 0===t&&(t=n.getCharCount());var i=n.getLineAtOffset(e),r=n.getLineAtOffset(Math.max(e,t-1))+1;this.redrawLines(i,r)}},removeKeyMode:function(e){for(var t=this._keyModes,n=0;nt;if(r){var o=e;e=t,t=o}var s=this._model.getCharCount();e=Math.max(0,Math.min(e,s)),t=Math.max(0,Math.min(t,s));var a=new y(e,t,r);this._setSelection(a,void 0===n||n,!0,i)},setSelections:function(e,t,n){var i=this._rangesToSelections(e);this._setSelection(i,void 0===t||t,!0,n)},setText:function(e,t,n,i,r){var o,a="string"==typeof e,l=void 0===t&&void 0===n&&a;a?(void 0===t&&(t=0),void 0===n&&(n=this._model.getCharCount()),o={text:e,selection:[new y(t,n,!1)]}):(o=e,o.selection=this._rangesToSelections(o.selection)),o._code=!0,l&&(this._variableLineHeight=!1),this._modifyContent(o,!l,void 0===i||i,r),l&&s.isFirefox<13&&this._fixCaret()},setTopIndex:function(e,t){this._clientDiv&&this._scrollViewAnimated(0,this._getLinePixel(Math.max(0,e))-this._getScroll().y,t)},setTopPixel:function(e,t){this._clientDiv&&this._scrollViewAnimated(0,Math.max(0,e)-this._getScroll().y,t)},showSelection:function(e,t){return this._showCaret(e?!1:!0,t,e)},update:function(e,t){this._clientDiv&&((e||this._metrics.invalid)&&this._updateStyle(),void 0===t||t?this._update():this._queueUpdate())},_handleRootMouseDown:function(e){if(this._cancelCheckSelection(),!this._ignoreEvent(e)){s.isFirefox<13&&1===e.which&&(this._clientDiv.contentEditable=!1,(this._overlayDiv||this._clientDiv).draggable=!0,this._ignoreBlur=!0);var t=this._overlayDiv||this._clientDiv;s.isIE<9&&(t=this._viewDiv);for(var n=e.target?e.target:e.srcElement;n;){if(t===n)return;if(n.className&&-1!==n.className.indexOf("textViewFind"))return;n=n.parentNode}if(e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),!this._isW3CEvents){var i=this,r=this._getWindow();r.setTimeout(function(){i._clientDiv.focus()},0)}}},_handleRootMouseUp:function(e){this._ignoreEvent(e)||(s.isFirefox<13&&1===e.which&&(this._clientDiv.contentEditable=!0,(this._overlayDiv||this._clientDiv).draggable=!1),s.isFirefox&&1===e.which&&(this._fixCaret(),this._ignoreBlur=!1))},_handleBlur:function(){if(this._cancelCheckSelection(),!this._ignoreBlur){if(this._commitIME(),this._hasFocus=!1,s.isIE<9&&!this._getSelections()[0].isEmpty()){var e=this._rootDiv,t=s.createElement(e.ownerDocument,"div");e.appendChild(t),e.removeChild(t)}if(this._cursorDiv&&(this._cursorDiv.style.display="none"),this._domSelection){this._domSelection.forEach(function(e){e.update()});var n,i=this._getWindow(),r=this._parent.ownerDocument;if(i.getSelection){var o=i.getSelection();for(n=o.anchorNode;n;){if(n===this._clientDiv){o.rangeCount>0&&o.removeAllRanges();break}n=n.parentNode}}else if(r.selection){for(this._ignoreSelect=!1,n=r.selection.createRange().parentElement();n;){if(n===this._clientDiv){r.selection.empty();break}n=n.parentNode}this._ignoreSelect=!0}}this._ignoreFocus||this.onBlur({type:"Blur"})}},_handleCompositionStart:function(e){if(!this._ignoreEvent(e)){if(this._imeTimeout){var t=this._getWindow();t.clearTimeout(this._imeTimeout),this._imeTimeout=null}this._imeText&&(this._commitIME(this._imeText),this._imeText=null),this._startIME(),this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null)}},_handleCompositionUpdate:function(e){this._ignoreEvent(e)||(this._imeText=e.data)},_handleCompositionEnd:function(e){if(!this._ignoreEvent(e)){this._imeText=e.data;var t=this._getWindow();this._imeTimeout=t.setTimeout(function(){this._commitIME(this._imeText),this._imeText=this._imeTimeout=null}.bind(this),0)}},_handleContextMenu:function(e){if(!this._ignoreEvent(e)){s.isIE&&3===this._lastMouseButton&&this._updateDOMSelection();var t=!1;if(this.isListening("ContextMenu")){var n=this._createMouseEvent("ContextMenu",e);n.screenX=e.screenX,n.screenY=e.screenY,this.onContextMenu(n),t=n.defaultPrevented}else s.isMac&&s.isFirefox&&0===e.button&&(t=!0);return t?(e.preventDefault&&e.preventDefault(),!1):(this._contextMenuOpen=!0,void(s.isFirefox&&(this._checkSelectionChange=!0,this._pollSelectionChange(!0))))}},_handleCopy:function(e){return this._cancelCheckSelection(),this._ignoreEvent(e)||this._ignoreCopy?void 0:this._doCopy(e)?(e.preventDefault&&e.preventDefault(),!1):void 0},_handleCut:function(e){return this._cancelCheckSelection(),this._ignoreEvent(e)?void 0:this._doCut(e)?(e.preventDefault&&e.preventDefault(),!1):void 0},_handleDataModified:function(e){this._ignoreEvent(e)||this._startIME()},_handleDblclick:function(e){if(!this._ignoreEvent(e)){var t=e.timeStamp?e.timeStamp:(new Date).getTime();this._lastMouseTime=t,2!==this._clickCount&&(this._clickCount=2,this._handleMouse(e))}},_handleDragStart:function(e){if(!this._ignoreEvent(e)){if(s.isFirefox<13){var t=this,n=this._getWindow();n.setTimeout(function(){t._clientDiv.contentEditable=!0,t._clientDiv.draggable=!1,t._ignoreBlur=!1},0)}return this.isListening("DragStart")&&-1!==this._dragOffset?(this._isMouseDown=!1,this.onDragStart(this._createMouseEvent("DragStart",e)),this._dragOffset=-1,void 0):(e.preventDefault&&e.preventDefault(),!1)}},_handleDrag:function(e){this._ignoreEvent(e)||this.isListening("Drag")&&this.onDrag(this._createMouseEvent("Drag",e))},_handleDragEnd:function(e){this._ignoreEvent(e)||(this._dropTarget=!1,this._dragOffset=-1,this.isListening("DragEnd")&&this.onDragEnd(this._createMouseEvent("DragEnd",e)),s.isFirefox<13&&(this._fixCaret(),"none"!==e.dataTransfer.dropEffect||e.dataTransfer.mozUserCancelled||this._fixCaret()))},_handleDragEnter:function(e){if(!this._ignoreEvent(e)){var t=!0;return this._dropTarget=!0,this.isListening("DragEnter")&&(t=!1,this.onDragEnter(this._createMouseEvent("DragEnter",e))),s.isWebkit||t?(e.preventDefault&&e.preventDefault(),!1):void 0}},_handleDragOver:function(e){if(!this._ignoreEvent(e)){var t=!0;return this.isListening("DragOver")&&(t=!1,this.onDragOver(this._createMouseEvent("DragOver",e))),s.isWebkit||t?(t&&(e.dataTransfer.dropEffect="none"),e.preventDefault&&e.preventDefault(),!1):void 0}},_handleDragLeave:function(e){this._ignoreEvent(e)||(this._dropTarget=!1,this.isListening("DragLeave")&&this.onDragLeave(this._createMouseEvent("DragLeave",e)))},_handleDrop:function(e){return this._ignoreEvent(e)?void 0:(this._dropTarget=!1,this.isListening("Drop")&&this.onDrop(this._createMouseEvent("Drop",e)),e.preventDefault&&e.preventDefault(),!1)},_handleFocus:function(){this._hasFocus=!0,s.isIOS&&void 0!==this._lastTouchOffset?(this.setCaretOffset(this._lastTouchOffset,!0),this._lastTouchOffset=void 0):this._updateDOMSelection(),this._cursorDiv&&(this._cursorDiv.style.display="block"),this._domSelection&&this._domSelection.forEach(function(e){e.update()}),this._ignoreFocus||this.onFocus({type:"Focus"})},_handleKeyDown:function(e){if(this._cancelCheckSelection(),!this._ignoreEvent(e)){if(this.isListening("KeyDown")){var t=this._createKeyEvent("KeyDown",e);if(this.onKeyDown(t),t.defaultPrevented)return s.isFirefox&&(this._keyDownPrevented=!0),void e.preventDefault()}var n=!1;switch(e.keyCode){case 16:case 17:case 18:case 91:n=!0;break;default:this._setLinksVisible(!1)}if(229===e.keyCode){if(this._readonly)return e.preventDefault&&e.preventDefault(),!1;var i=!0;s.isSafari&&s.isMac&&e.ctrlKey&&(i=!1,e.keyCode=129),i&&this._startIME()}else n||this._commitIME();return(s.isMac||s.isLinux)&&s.isFirefox<4||s.isOpera<12.16?(this._keyDownEvent=e,!0):this._doAction(e)?(e.preventDefault?(e.preventDefault(),e.stopPropagation()):(e.cancelBubble=!0,e.returnValue=!1,e.keyCode=0),!1):void 0}},_handleKeyPress:function(e){if(!this._ignoreEvent(e)){if(this._keyDownPrevented)return e.preventDefault&&(e.preventDefault(),e.stopPropagation()),void(this._keyDownPrevented=void 0);if(s.isMac&&s.isWebkit&&(63232<=e.keyCode&&e.keyCode<=63487||13===e.keyCode||8===e.keyCode))return e.preventDefault&&e.preventDefault(),!1;if(((s.isMac||s.isLinux)&&s.isFirefox<4||s.isOpera<12.16)&&this._doAction(this._keyDownEvent))return e.preventDefault&&e.preventDefault(),!1;var t=s.isMac?e.metaKey:e.ctrlKey;if(void 0!==e.charCode&&t)switch(e.charCode){case 99:case 118:case 120:return!0}if(this.isListening("KeyPress")){var n=this._createKeyEvent("KeyPress",e);if(this.onKeyPress(n),n.defaultPrevented)return void e.preventDefault()}if(this._doAction(e))return e.preventDefault?(e.preventDefault(),e.stopPropagation()):(e.cancelBubble=!0,e.returnValue=!1,e.keyCode=0),!1;var i=!1;if(s.isMac?(e.ctrlKey||e.metaKey)&&(i=!0):s.isFirefox?(e.ctrlKey||e.altKey)&&(i=!0):e.ctrlKey^e.altKey&&(i=!0),!i){var r=s.isOpera?e.which:void 0!==e.charCode?e.charCode:e.keyCode;if(r>31)return this._doContent(String.fromCharCode(r)),e.preventDefault&&e.preventDefault(),!1}}},_handleDocKeyUp:function(e){var t=s.isMac?e.metaKey:e.ctrlKey;t||this._setLinksVisible(!1)},_handleKeyUp:function(e){if(!this._ignoreEvent(e)){if(this.isListening("KeyUp")){var t=this._createKeyEvent("KeyUp",e);if(this.onKeyUp(t),t.defaultPrevented)return void e.preventDefault()}this._handleDocKeyUp(e),13===e.keyCode&&this._commitIME()}},_handleLinkClick:function(e){var t=s.isMac?e.metaKey:e.ctrlKey;return t?void 0:(e.preventDefault&&e.preventDefault(),!1)},_handleMouse:function(e){var t=this._getWindow(),n=!0,i=t;if((s.isIE||s.isFirefox&&!this._overlayDiv)&&(i=this._clientDiv),this._overlayDiv){this._hasFocus&&(this._ignoreFocus=!0);var r=this;t.setTimeout(function(){r.focus(),r._ignoreFocus=!1},0)}var o=e.shiftKey,a=e.altKey,l=s.isMac?e.metaKey:e.ctrlKey;if(this._blockSelection=this._doubleClickSelection=null,1===this._clickCount){var d=(!s.isOpera||s.isOpera>=12.16)&&this._hasFocus&&this.isListening("DragStart");n=this._setSelectionTo(e.clientX,e.clientY,!0,o,l,d),n&&this._setGrab(i)}else this._isW3CEvents&&this._setGrab(i),this._setSelectionTo(e.clientX,e.clientY,!0,o,l,!1),this._doubleClickSelection=y.editing(this._getSelections());return a&&(this._blockSelection=y.editing(this._getSelections())),n},_handleMouseDown:function(e){if(!this._ignoreEvent(e)){if(this._linksVisible){var t=e.target||e.srcElement;if("A"===t.tagName)return;this._setLinksVisible(!1)}this._commitIME();var n=e.which;n||(4===e.button&&(n=2),2===e.button&&(n=3),1===e.button&&(n=1));var i=2!==n&&e.timeStamp?e.timeStamp:(new Date).getTime(),r=i-this._lastMouseTime,o=Math.abs(this._lastMouseX-e.clientX),a=Math.abs(this._lastMouseY-e.clientY),l=this._lastMouseButton===n;if(this._lastMouseX=e.clientX,this._lastMouseY=e.clientY,this._lastMouseTime=i,this._lastMouseButton=n,1===n&&(this._isMouseDown=!0,l&&r<=this._clickTime&&o<=this._clickDist&&a<=this._clickDist?this._clickCount++:this._clickCount=1),this.isListening("MouseDown")){var d=this._createMouseEvent("MouseDown",e);if(this.onMouseDown(d),d.defaultPrevented)return void e.preventDefault()}1===n&&this._handleMouse(e)&&(s.isIE>=9||s.isOpera||s.isChrome||s.isSafari||s.isFirefox&&!this._overlayDiv)&&(this._hasFocus||this.focus(),e.preventDefault()),s.isFirefox&&3===this._lastMouseButton&&this._updateDOMSelection()}},_handleMouseOver:function(e){this._ignoreEvent(e)||this._animation||this.isListening("MouseOver")&&this.onMouseOver(this._createMouseEvent("MouseOver",e))},_handleMouseOut:function(e){this._ignoreEvent(e)||this._animation||this.isListening("MouseOut")&&this.onMouseOut(this._createMouseEvent("MouseOut",e))},_handleMouseMove:function(e){if(!this._animation){var t=this._isClientDiv(e);if(this.isListening("MouseMove")&&(t||this._isMouseDown)){var n=this._createMouseEvent("MouseMove",e);if(this.onMouseMove(n),n.defaultPrevented)return void e.preventDefault()}if(!this._dropTarget){var i=this._linksVisible||this._lastMouseMoveX!==e.clientX||this._lastMouseMoveY!==e.clientY;if(this._lastMouseMoveX=e.clientX,this._lastMouseMoveY=e.clientY,this._setLinksVisible(i&&!this._isMouseDown&&e.altKey&&(s.isMac?e.metaKey:e.ctrlKey)),this._checkOverlayScroll(),!this._isW3CEvents){if(0===e.button)return this._setGrab(null),!0;if(!this._isMouseDown&&1===e.button&&0!==(1&this._clickCount)&&t)return this._clickCount=2,this._handleMouse(e,this._clickCount)}if(this._isMouseDown&&-1===this._dragOffset){var r=e.clientX,o=e.clientY,a=this._getViewPadding(),l=this._viewDiv.getBoundingClientRect(),d=this._getClientWidth(),h=this._getClientHeight(),c=l.left+a.left,u=l.top+a.top,f=l.left+a.left+d,p=l.top+a.top+h;u>o?this._doAutoScroll("up",r,o-u):o>p?this._doAutoScroll("down",r,o-p):c>r&&!this._wrapMode?this._doAutoScroll("left",r-c,o):r>f&&!this._wrapMode?this._doAutoScroll("right",r-f,o):(this._endAutoScroll(),this._setSelectionTo(r,o,!1,!0))}}}},_isClientDiv:function(e){for(var t=this._overlayDiv||this._clientDiv,n=e.target?e.target:e.srcElement;n;){if(t===n)return!0;n=n.parentNode}return!1},_createKeyEvent:function(e,t){return{type:e,event:t,preventDefault:function(){this.defaultPrevented=!0}}},_createMouseEvent:function(e,t){var n=this.convert({x:t.clientX,y:t.clientY},"page","document");return{type:e,event:t,clickCount:this._clickCount,x:n.x,y:n.y,preventDefault:function(){this.defaultPrevented=!0}}},_createTouchEvent:function(e,t){var n=t.touches.length?this.convert({x:t.touches[0].clientX,y:t.touches[0].clientY},"page","document"):{};return{type:e,event:t,touchCount:t.touches.length,x:n.x,y:n.y,preventDefault:function(){this.defaultPrevented=!0}}},_handleMouseUp:function(e){var t=e.which?0===e.button:1===e.button;if(this.isListening("MouseUp")&&(this._isClientDiv(e)||t&&this._isMouseDown)){var n=this._createMouseEvent("MouseUp",e);if(this.onMouseUp(n),n.defaultPrevented)return e.preventDefault(),void(this._isMouseDown=!1)}if(!this._linksVisible){if(t&&this._isMouseDown){var i=this._getSelections(),r=y.editing(i);i.forEach(function(e){e._editing=!1}),-1!==this._dragOffset&&(r.extend(this._dragOffset),r.collapse(),i=r,this._dragOffset=-1),this._setSelection(i,!1),this._isMouseDown=!1,this._endAutoScroll(),this._isW3CEvents&&this._setGrab(null)}t&&this._isMouseDown&&s.isFirefox&&(this._updateDOMSelection(),e.preventDefault())}},_handleMouseWheel:function(e){if(!this._noScroll){var t=this._getLineHeight(),n=0,i=0;if(s.isIE||s.isOpera)i=-e.wheelDelta/40*t;else if(s.isFirefox){var r=256;if("wheel"===e.type)e.deltaMode?(n=Math.max(-r,Math.min(r,e.deltaX))*t,i=Math.max(-r,Math.min(r,e.deltaY))*t):(n=e.deltaX,i=e.deltaY);else{var o;o=s.isMac?3*e.detail:Math.max(-r,Math.min(r,e.detail))*t,e.axis===e.HORIZONTAL_AXIS?n=o:i=o}}else if(s.isMac){var a,l,d=e.timeStamp-this._wheelTimeStamp;this._wheelTimeStamp=e.timeStamp,a=e.wheelDeltaX%120!==0?1:40>d?40/(40-d):40,l=e.wheelDeltaY%120!==0?1:40>d?40/(40-d):40,n=Math.ceil(-e.wheelDeltaX/a),n>-1&&0>n&&(n=-1),n>0&&1>n&&(n=1),i=Math.ceil(-e.wheelDeltaY/l),i>-1&&0>i&&(i=-1),i>0&&1>i&&(i=1)}else{n=-e.wheelDeltaX;var h=8;i=-e.wheelDeltaY/120*h*t}if(s.isSafari||s.isChrome&&s.isMac){for(var c=e.target;c&&void 0===c.lineIndex;)c=c.parentNode;this._mouseWheelLine=c}var u=this._getScroll();this._scrollView(n,i);var f=this._getScroll();return u.x!==f.x||u.y!==f.y?(e.preventDefault&&e.preventDefault(),!1):void 0}},_handlePaste:function(e){if(this._cancelCheckSelection(),!this._ignoreEvent(e)&&!this._ignorePaste&&this._doPaste(e)){if(s.isIE){var t=this;this._ignoreFocus=!0;var n=this._getWindow();n.setTimeout(function(){t._updateDOMSelection(),t._ignoreFocus=!1},0)}return e.preventDefault&&e.preventDefault(),!1}},_handleResize:function(){var e=this._rootDiv.clientWidth,t=this._rootDiv.clientHeight;if(this._rootWidth!==e||this._rootHeight!==t){this._rootWidth!==e&&this._wrapMode&&this._resetLineHeight(),this._rootWidth=e,this._rootHeight=t;var n=s.isIE<9,i=this._calculateMetrics();f(i,this._metrics)||(this._metrics.invalid&&!i.invalid?this._updateStyle(!1,i):(this._variableLineHeight&&(this._variableLineHeight=!1,this._resetLineHeight()),this._metrics=i),n=!0),n?this._queueUpdate():this._update(),this.dispatchEvent({type:"Resize"})}},_handleRulerEvent:function(e){for(var t=e.target?e.target:e.srcElement,n=t.lineIndex,i=t;i&&!i._ruler;)void 0===n&&void 0!==i.lineIndex&&(n=i.lineIndex),i=i.parentNode;var r=i?i._ruler:null;if(void 0===n&&r&&"document"===r.getOverview()){var o,s,a=this._getClientHeight(),l=this._model.getLineCount(),d=this._getViewPadding(),h=this._viewDiv.getBoundingClientRect(),c=this._getLineHeight(),u=c*l,f=a+d.top+d.bottom-2*this._metrics.scrollWidth;f>u?(o=c,s=d.top):(o=f/l,s=this._metrics.scrollWidth),n=Math.floor((e.clientY-h.top-s)/o),n>=0&&l>n||(n=void 0)}if(r)switch(e.type){case"click":r.onClick&&r.onClick(n,e);break;case"dblclick":r.onDblClick&&r.onDblClick(n,e);break;case"mousemove":r.onMouseMove&&r.onMouseMove(n,e);break;case"mouseover":r.onMouseOver&&r.onMouseOver(n,e);break;case"mouseout":if(r.onMouseOut){for(var p=e.relatedTarget;p&&p!==this._rootDiv;){if(p===i)return;p=p.parentNode}r.onMouseOut(n,e)}}},_handleScroll:function(){this._lastScrollTime=(new Date).getTime();var e=this._getScroll(!1),t=this._hScroll,n=this._vScroll;if(t!==e.x||n!==e.y){this._hScroll=e.x,this._vScroll=e.y,this._commitIME(),this._update(n===e.y);var i={type:"Scroll",oldValue:{x:t,y:n},newValue:e};this.onScroll(i)}},_handleSelectStart:function(e){var t=this._contextMenuOpen;return this._contextMenuOpen=!1,t?void(this._checkSelectionChange=!0):this._ignoreSelect?(e&&e.preventDefault&&e.preventDefault(),!1):void 0},_getModelOffset:function(e,t){if(e){var n;return n="DIV"===e.tagName?e:e.parentNode.parentNode,n._line?n._line.getModelOffset(e,t):0}},_updateSelectionFromDOM:function(){if(!(s.isIOS||s.isAndroid||this._checkSelectionChange))return!1;var e=this._getWindow(),t=e.getSelection(),n=this._getModelOffset(t.anchorNode,t.anchorOffset),i=this._getModelOffset(t.focusNode,t.focusOffset),r=this._getSelections()[0];if(void 0===n||void 0===i||r.start===n&&r.end===i)return!1;if(this._checkSelectionChange){var o=this._getLineNext(),a=this._getLinePrevious();if(t.anchorNode===o.firstChild.firstChild&&0===t.anchorOffset&&t.focusNode===a.firstChild.firstChild&&0===t.focusOffset)return!1;(t.anchorNode===o.firstChild.firstChild&&0===t.anchorOffset&&t.focusNode===a.lastChild.firstChild||t.anchorNode===this._clientDiv&&t.focusNode===this._clientDiv)&&(n=0,i=this.getModel().getCharCount())}return this._setSelection(new y(n,i),!1,!1),this._checkSelectionChange=!1,!0},_cancelCheckSelection:function(){this._checkSelectionChange&&(this._checkSelectionChange=!1,this._cancelPollSelectionChange())},_cancelPollSelectionChange:function(){if(this._selPollTimer){var e=this._getWindow();e.clearTimeout(this._selPollTimer),this._selPollTimer=null}},_pollSelectionChange:function(e){var t=this,n=this._getWindow();this._cancelPollSelectionChange(),this._selPollTimer=n.setTimeout(function(){if(t._selPollTimer=null,t._clientDiv){var n=t._updateSelectionFromDOM();!n&&e&&t._pollSelectionChange(e)}},100)},_handleSelectionChange:function(){-1===this._imeOffset&&(s.isAndroid?this._pollSelectionChange():this._updateSelectionFromDOM())},_handleTextInput:function(e){if(!this._ignoreEvent(e)&&-1===this._imeOffset){var t=this._getWindow().getSelection();if(t.anchorNode!==this._anchorNode||t.focusNode!==this._focusNode||t.anchorOffset!==this._anchorOffset||t.focusOffset!==this._focusOffset){for(var n=t.anchorNode;n&&void 0===n.lineIndex;)n=n.parentNode;if(n){var i=this._model,r=n.lineIndex,o=i.getLine(r),s=o,a=0,l=i.getLineStart(r);if(t.rangeCount>0){t.getRangeAt(0).deleteContents();var d=n.ownerDocument.createTextNode(e.data);t.getRangeAt(0).insertNode(d);var h=this._getDOMText(n,d);s=h.text,a=h.offset,d.parentNode.removeChild(d)}n.lineRemoved=!0;for(var c=0;o.charCodeAt(c)===s.charCodeAt(c)&&a>c;)c++;for(var u=o.length-1,f=s.length-o.length;o.charCodeAt(u)===s.charCodeAt(u+f)&&u+f>=a+e.data.length;)u--;u++;var p=s.substring(c,u+f);c+=l,u+=l;var g=this._getSelections(),v=g[0].start-c,m=g[0].end-u;g[0].start=c,g[0].end=u;for(var _=1;_=0;n--)if(t=i[n],"function"==typeof t.match){var r=t.match(e);if(void 0!==r)return this.invokeAction(r)}return!1},_doMove:function(e,t){var n=this._model,i=t.getCaret(),r=n.getLineAtOffset(i);for(e.count||(e.count=1);0!==e.count;){var o=n.getLineStart(r);if(e.count<0&&i===o){if(!(r>0))break;"character"===e.unit&&e.count++,r--,t.extend(n.getLineEnd(r))}else if(e.count>0&&i===n.getLineEnd(r)){if(!(r+10&&(o=Math.min(o+e.count-1,t.getLineCount()-1)),r=t.getLineEnd(o);
+i.extend(r)}e.select||i.collapse()}),this._setSelection(i,!0,!0,e.ctrl?function(){}:null),!0},_doEnter:function(e){if(this._singleMode)return!0;var t=this._model,n=this._getSelections();return this._doContent(t.getLineDelimiter()),e&&e.noCursor&&(n.forEach(function(e){e.end=e.start}),this._setSelection(n,!0)),!0},_doEscape:function(){var e=this._getSelections();return e.length>1&&this._setSelection(e[0],!0),!0},_doHome:function(e){var t=this._model,n=this,i=this._getSelections();return i.forEach(function(i){if(e.ctrl)i.extend(0);else{var r=i.getCaret(),o=t.getLineAtOffset(r);if(n._wrapMode){var s=n._getLine(o),a=s.getLineIndex(r);r=s.getLineStart(a),s.destroy()}else r=t.getLineStart(o);i.extend(r)}e.select||i.collapse()}),this._setSelection(i,!0,!0,e.ctrl?function(){}:null),!0},_doLineDown:function(e){var t=this._model,n=this,i=this._getSelections();return i.forEach(function(i){var r,o=i.getCaret(),a=t.getLineAtOffset(o),l=n._getLine(a),d=i._columnX,h=1,c=!1;if(-1===d||e.wholeLine||e.select&&s.isIE){var u=e.wholeLine?t.getLineEnd(a+1):o;d=i._columnX=l.getBoundingClientRect(u).left}if((r=l.getLineIndex(o))0?a=Math.min(a+e.count,f):a++}var p=!1;c?(e.select||s.isMac||s.isLinux)&&(i.extend(t.getCharCount()),p=!0):(l.lineIndex!==a&&(l.destroy(),l=n._getLine(a)),i.extend(l.getOffset(d,h)),p=!0),p&&(e.select||i.collapse()),l.destroy()}),n._setSelection(i,!0,!0,null,0,!1,!0),!0},_doLineUp:function(e){var t=this._model,n=this,i=this._getSelections();return i.forEach(function(i){var r,o,a=i.getCaret(),l=t.getLineAtOffset(a),d=n._getLine(l),h=i._columnX,c=!1;if(-1===h||e.wholeLine||e.select&&s.isIE){var u=e.wholeLine?t.getLineStart(l-1):a;h=i._columnX=d.getBoundingClientRect(u).left}(r=d.getLineIndex(a))>0?o=d.getClientRects(r-1).top+1:(c=0===l,c||(e.count&&e.count>0?l=Math.max(l-e.count,0):l--,o=n._getLineHeight(l)-1));var f=!1;c?(e.select||s.isMac||s.isLinux)&&(i.extend(0),f=!0):(d.lineIndex!==l&&(d.destroy(),d=n._getLine(l)),i.extend(d.getOffset(h,o)),f=!0),f&&(e.select||i.collapse()),d.destroy()}),n._setSelection(i,!0,!0,null,0,!1,!0),!0},_doNoop:function(){return!0},_doPageDown:function(e){var t,n,i,r=this,o=this._model,a=this._getSelections(),l=o.getLineCount(),d=this._getScroll(),h=this._getClientHeight(),c=this._getLineHeight(),u=Math.floor(h/c);return a.forEach(function(a){var f=a.getCaret(),p=o.getLineAtOffset(f);if(r._lineHeight){t=a._columnX;var g=r._getBoundsAtOffset(f);(-1===t||e.select&&s.isIE)&&(t=a._columnX=g.left);var v=r._getLineIndex(g.top+h);n=r._getLine(v);var m=r._getLinePixel(v),_=g.top+h-m;f=n.getOffset(t,_);var y=n.getBoundingClientRect(f);n.destroy(),a.extend(f),e.select||a.collapse(),i=void 0!==i?Math.min(i,y.top+m-g.top):y.top+m-g.top}else if(l-1>p){var C=Math.min(l-p-1,u);C=Math.max(1,C),t=a._columnX,(-1===t||e.select&&s.isIE)&&(n=r._getLine(p),t=a._columnX=n.getBoundingClientRect(f).left,n.destroy()),n=r._getLine(p+C),a.extend(n.getOffset(t,0)),n.destroy(),e.select||a.collapse();var w=l*c,x=d.y+C*c;x+h>w&&(x=w-h),i=void 0!==i?Math.min(i,x-d.y):x-d.y}}),this._setSelection(a,!0,!0,function(){},i,!1,!0),!0},_doPageUp:function(e){var t,n,i,r=this,o=this._model,a=this._getSelections(),l=this._getScroll(),d=this._getClientHeight(),h=this._getLineHeight(),c=Math.floor(d/h);return a.forEach(function(a){var u=a.getCaret(),f=o.getLineAtOffset(u);if(r._lineHeight){t=a._columnX;var p=r._getBoundsAtOffset(u);(-1===t||e.select&&s.isIE)&&(t=a._columnX=p.left);var g=r._getLineIndex(p.bottom-d);n=r._getLine(g);var v=r._getLinePixel(g),m=p.bottom-d-v;u=n.getOffset(t,m);var _=n.getBoundingClientRect(u);n.destroy(),a.extend(u),e.select||a.collapse(),i=void 0!==i?Math.max(i,_.top+v-p.top):_.top+v-p.top}else if(f>0){var y=Math.max(1,Math.min(f,c));t=a._columnX,(-1===t||e.select&&s.isIE)&&(n=r._getLine(f),t=a._columnX=n.getBoundingClientRect(u).left,n.destroy()),n=r._getLine(f-y),a.extend(n.getOffset(t,r._getLineHeight(f-y)-1)),n.destroy(),e.select||a.collapse();var C=Math.max(0,l.y-y*h);i=void 0!==i?Math.max(i,C-l.y):C-l.y}}),this._setSelection(a,!0,!0,function(){},i,!1,!0),!0},_doPaste:function(e){var t=this,n=this._getClipboardText(e,function(e){if(e.length){if(s.isLinux&&2===t._lastMouseButton){var n=(new Date).getTime()-t._lastMouseTime;n<=t._clickTime&&t._setSelectionTo(t._lastMouseX,t._lastMouseY,!0)}var i=t._getSelections(),r=t._singleMode?"":t._model.getLineDelimiter();t._doContent(i.length>1&&i.length===e.length?e:e.join(r))}});return null!==n},_doScroll:function(e){var t,n=e.type,i=this._model,r=i.getLineCount(),o=this._getClientHeight(),s=this._getLineHeight(),a=this._lineHeight?this._scrollHeight:r*s,l=this._getScroll().y;switch(n){case"textStart":t=0;break;case"textEnd":t=a-o;break;case"pageDown":t=l+o;break;case"pageUp":t=l-o;break;case"lineDown":t=l+s;break;case"lineUp":t=l-s;break;case"centerLine":var d=this._getSelections()[0],h=i.getLineAtOffset(d.start),c=i.getLineAtOffset(d.end),u=(c-h+1)*s;t=h*s-o/2+u/2}return void 0!==t&&(t=Math.min(Math.max(0,t),a-o),this._scrollViewAnimated(0,t-l,function(){})),!0},_doSelectAll:function(){var e=this._model;return this._setSelection(new y(0,e.getCharCount()),!1),!0},_doTab:function(){if(this._tabMode&&!this._readonly){var e=" ",t=this._getSelections();if(this._expandTab){e=[];var n=this._model,i=this._tabSize;t.forEach(function(t){var r=t.getCaret(),o=n.getLineAtOffset(r),s=n.getLineStart(o),a=i-(r-s)%i;e.push(d(a+1).join(" "))})}return this._modifyContent({text:e,selection:t,_ignoreDOMSelection:!0},!0)}},_doShiftTab:function(){return this._tabMode&&!this._readonly?!0:void 0},_doOverwriteMode:function(){return this._readonly?void 0:(this.setOptions({overwriteMode:!this.getOptions("overwriteMode")}),!0)},_doTabMode:function(){return this._tabMode=!this._tabMode,!0},_doWrapMode:function(){return this.setOptions({wrapMode:!this.getOptions("wrapMode")}),!0},_autoScroll:function(){var e,t,n=this._model,i=this._getSelections(),r=y.editing(i,"down"===this._autoScrollDir),o=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),a=r.getCaret(),l=n.getLineCount(),d=n.getLineAtOffset(a);if("up"===this._autoScrollDir||"down"===this._autoScrollDir){var h=this._autoScrollY/this._getLineHeight();h=0>h?Math.floor(h):Math.ceil(h),e=d,e=Math.max(0,Math.min(l-1,e+h))}else("left"===this._autoScrollDir||"right"===this._autoScrollDir)&&(e=this._getLineIndex(o.y),t=this._getLine(d),o.x+=t.getBoundingClientRect(a,!1).left,t.destroy());this._blockSelection?i=this._getBlockSelections(i,e,o):0===e&&(s.isMac||s.isLinux)?r.extend(0):e===l-1&&(s.isMac||s.isLinux)?r.extend(n.getCharCount()):(t=this._getLine(e),r.extend(t.getOffset(o.x,o.y-this._getLinePixel(e))),t.destroy()),this._setSelection(i,!0)},_autoScrollTimer:function(){this._autoScroll();var e=this,t=this._getWindow();this._autoScrollTimerID=t.setTimeout(function(){e._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateLineHeightTimer:function(e){if(this._lineHeight&&!this._calculateLHTimer){var t=this._model.getLineCount(),n=0;if(e){for(var i=0,r=100,o=(new Date).getTime(),s=0;t>n&&(this._lineHeight[n]||(i++,s||(s=n),this._lineHeight[n]=this._calculateLineHeight(n)),n++,!((new Date).getTime()-o>r)););this.redrawRulers(0,t),this._queueUpdate()}var a=this._getWindow();if(n!==t){var l=this;return void(this._calculateLHTimer=a.setTimeout(function(){l._calculateLHTimer=null,l._calculateLineHeightTimer(!0)},0))}this._calculateLHTimer&&(a.clearTimeout(this._calculateLHTimer),this._calculateLHTimer=void 0)}},_calculateLineHeight:function(e){var t=this._getLine(e),n=t.getBoundingClientRect();return t.destroy(),Math.max(1,n.bottom-n.top)},_calculateMetrics:function(){var e=this._clientDiv,t=e.ownerDocument,n=" ",i=s.createElement(t,"div");i.style.lineHeight="normal";var r=this._model,o=r.getLine(0),a={type:"LineStyle",textView:this,0:0,lineText:o,lineStart:0};this.onLineStyle(a),h(a.style,i),i.style.position="fixed",i.style.left="-1000px";var l=s.createElement(t,"span");l.appendChild(t.createTextNode(n)),i.appendChild(l);var c=s.createElement(t,"span");c.style.fontStyle="italic",c.appendChild(t.createTextNode(n)),i.appendChild(c);var u=s.createElement(t,"span");u.style.fontWeight="bold",u.appendChild(t.createTextNode(n)),i.appendChild(u);var f=s.createElement(t,"span");f.style.fontWeight="bold",f.style.fontStyle="italic",f.appendChild(t.createTextNode(n)),i.appendChild(f),e.appendChild(i);var p=i.getBoundingClientRect(),g=l.getBoundingClientRect(),_=c.getBoundingClientRect(),y=u.getBoundingClientRect(),C=f.getBoundingClientRect(),w=g.bottom-g.top,x=_.bottom-_.top,S=y.bottom-y.top,b=C.bottom-C.top,T=0,E=p.bottom-p.top<=0,L=Math.max(1,p.bottom-p.top);x>w&&(T=1),S>x&&(T=2),b>S&&(T=3);var k;0!==T&&(k={style:{}},0!==(1&T)&&(k.style.fontStyle="italic"),0!==(2&T)&&(k.style.fontWeight="bold"));var A=m(i);e.removeChild(i);var M=v(this._viewDiv),D=s.createElement(t,"div");D.style.position="fixed",D.style.left="-1000px",D.style.paddingLeft=M.left+"px",D.style.paddingTop=M.top+"px",D.style.paddingRight=M.right+"px",D.style.paddingBottom=M.bottom+"px",D.style.width="100px",D.style.height="100px";var O=s.createElement(t,"div");O.style.width="100%",O.style.height="100%",D.appendChild(O),e.appendChild(D);var N=D.getBoundingClientRect(),I=O.getBoundingClientRect(),R=0;if(!this._singleMode&&!this._noScroll){D.style.overflow="hidden",O.style.height="200px";var B=D.clientWidth;D.style.overflow="scroll";var P=D.clientWidth;R=B-P}e.removeChild(D),M={left:I.left-N.left,top:I.top-N.top,right:N.right-I.right,bottom:N.bottom-I.bottom};var F=0,V=0,U=0;return E||(D=s.createElement(t,"div"),D.style.position="fixed",D.style.left="-1000px",e.appendChild(D),D.innerHTML=d(2).join("a"),N=D.getBoundingClientRect(),U=Math.ceil(N.right-N.left),(this._wrapOffset||this._marginOffset)&&(D.innerHTML=d(this._wrapOffset+1+(s.isWebkit?0:1)).join(" "),N=D.getBoundingClientRect(),F=Math.ceil(N.right-N.left),D.innerHTML=d(this._marginOffset+1).join(" "),I=D.getBoundingClientRect(),V=Math.ceil(I.right-I.left)),e.removeChild(D)),{lineHeight:L,largestFontStyle:k,lineTrim:A,viewPadding:M,scrollWidth:R,wrapWidth:F,marginWidth:V,charWidth:U,invalid:E}},_cancelAnimation:function(){this._animation&&(this._animation.stop(),this._animation=null)},_clearSelection:function(e){var t=this._getSelections();return t.forEach(function(t){"next"===e?t.start=t.end:t.end=t.start}),this._setSelection(t,!0),!0},_commitIME:function(e){if(-1!==this._imeOffset){var t=this._model,n=t.getLineAtOffset(this._imeOffset),i=t.getLineStart(n),r=this._getLineNode(n);if(!e){this._scrollDiv.focus(),this._clientDiv.focus();var o=this._getDOMText(r).text,a=t.getLine(n),l=this._imeOffset-i,d=l+o.length-a.length;l!==d&&(e=o.substring(l,d))}this._imeOffset=-1,e&&(this._doContent(e)||s.isWebkit||(r.lineRemoved=!0,this._queueUpdate()))}},_createActions:function(){this.addKeyMode(new n.DefaultKeyMode(this));var t=this;this._actions={noop:{defaultHandler:function(){return t._doNoop()}},lineUp:{defaultHandler:function(e){return t._doLineUp(u(e,{select:!1}))},actionDescription:{name:e.lineUp}},lineDown:{defaultHandler:function(e){return t._doLineDown(u(e,{select:!1}))},actionDescription:{name:e.lineDown}},lineStart:{defaultHandler:function(e){return t._doHome(u(e,{select:!1,ctrl:!1}))},actionDescription:{name:e.lineStart}},lineEnd:{defaultHandler:function(e){return t._doEnd(u(e,{select:!1,ctrl:!1}))},actionDescription:{name:e.lineEnd}},charPrevious:{defaultHandler:function(e){return t._doCursorPrevious(u(e,{select:!1,unit:"character"}))},actionDescription:{name:e.charPrevious}},charNext:{defaultHandler:function(e){return t._doCursorNext(u(e,{select:!1,unit:"character"}))},actionDescription:{name:e.charNext}},pageUp:{defaultHandler:function(e){return t._doPageUp(u(e,{select:!1}))},actionDescription:{name:e.pageUp}},pageDown:{defaultHandler:function(e){return t._doPageDown(u(e,{select:!1}))},actionDescription:{name:e.pageDown}},scrollPageUp:{defaultHandler:function(e){return t._doScroll(u(e,{type:"pageUp"}))},actionDescription:{name:e.scrollPageUp}},scrollPageDown:{defaultHandler:function(e){return t._doScroll(u(e,{type:"pageDown"}))},actionDescription:{name:e.scrollPageDown}},scrollLineUp:{defaultHandler:function(e){return t._doScroll(u(e,{type:"lineUp"}))},actionDescription:{name:e.scrollLineUp}},scrollLineDown:{defaultHandler:function(e){return t._doScroll(u(e,{type:"lineDown"}))},actionDescription:{name:e.scrollLineDown}},wordPrevious:{defaultHandler:function(e){return t._doCursorPrevious(u(e,{select:!1,unit:"word"}))},actionDescription:{name:e.wordPrevious}},wordNext:{defaultHandler:function(e){return t._doCursorNext(u(e,{select:!1,unit:"word"}))},actionDescription:{name:e.wordNext}},textStart:{defaultHandler:function(e){return t._doHome(u(e,{select:!1,ctrl:!0}))},actionDescription:{name:e.textStart}},textEnd:{defaultHandler:function(e){return t._doEnd(u(e,{select:!1,ctrl:!0}))},actionDescription:{name:e.textEnd}},scrollTextStart:{defaultHandler:function(e){return t._doScroll(u(e,{type:"textStart"}))},actionDescription:{name:e.scrollTextStart}},scrollTextEnd:{defaultHandler:function(e){return t._doScroll(u(e,{type:"textEnd"}))},actionDescription:{name:e.scrollTextEnd}},centerLine:{defaultHandler:function(e){return t._doScroll(u(e,{type:"centerLine"}))},actionDescription:{name:e.centerLine}},selectLineUp:{defaultHandler:function(e){return t._doLineUp(u(e,{select:!0}))},actionDescription:{name:e.selectLineUp}},selectLineDown:{defaultHandler:function(e){return t._doLineDown(u(e,{select:!0}))},actionDescription:{name:e.selectLineDown}},selectWholeLineUp:{defaultHandler:function(e){return t._doLineUp(u(e,{select:!0,wholeLine:!0}))},actionDescription:{name:e.selectWholeLineUp}},selectWholeLineDown:{defaultHandler:function(e){return t._doLineDown(u(e,{select:!0,wholeLine:!0}))},actionDescription:{name:e.selectWholeLineDown}},selectLineStart:{defaultHandler:function(e){return t._doHome(u(e,{select:!0,ctrl:!1}))},actionDescription:{name:e.selectLineStart}},selectLineEnd:{defaultHandler:function(e){return t._doEnd(u(e,{select:!0,ctrl:!1}))},actionDescription:{name:e.selectLineEnd}},selectCharPrevious:{defaultHandler:function(e){return t._doCursorPrevious(u(e,{select:!0,unit:"character"}))},actionDescription:{name:e.selectCharPrevious}},selectCharNext:{defaultHandler:function(e){return t._doCursorNext(u(e,{select:!0,unit:"character"}))},actionDescription:{name:e.selectCharNext}},selectPageUp:{defaultHandler:function(e){return t._doPageUp(u(e,{select:!0}))},actionDescription:{name:e.selectPageUp}},selectPageDown:{defaultHandler:function(e){return t._doPageDown(u(e,{select:!0}))},actionDescription:{name:e.selectPageDown}},selectWordPrevious:{defaultHandler:function(e){return t._doCursorPrevious(u(e,{select:!0,unit:"word"}))},actionDescription:{name:e.selectWordPrevious}},selectWordNext:{defaultHandler:function(e){return t._doCursorNext(u(e,{select:!0,unit:"word"}))},actionDescription:{name:e.selectWordNext}},selectTextStart:{defaultHandler:function(e){return t._doHome(u(e,{select:!0,ctrl:!0}))},actionDescription:{name:e.selectTextStart}},selectTextEnd:{defaultHandler:function(e){return t._doEnd(u(e,{select:!0,ctrl:!0}))},actionDescription:{name:e.selectTextEnd}},deletePrevious:{defaultHandler:function(e){return t._doBackspace(u(e,{unit:"character"}))},actionDescription:{name:e.deletePrevious}},deleteNext:{defaultHandler:function(e){return t._doDelete(u(e,{unit:"character"}))},actionDescription:{name:e.deleteNext}},deleteWordPrevious:{defaultHandler:function(e){return t._doBackspace(u(e,{unit:"word"}))},actionDescription:{name:e.deleteWordPrevious}},deleteWordNext:{defaultHandler:function(e){return t._doDelete(u(e,{unit:"word"}))},actionDescription:{name:e.deleteWordNext}},deleteLineStart:{defaultHandler:function(e){return t._doBackspace(u(e,{unit:"line"}))},actionDescription:{name:e.deleteLineStart}},deleteLineEnd:{defaultHandler:function(e){return t._doDelete(u(e,{unit:"line"}))},actionDescription:{name:e.deleteLineEnd}},tab:{defaultHandler:function(e){return t._doTab(u(e,{}))},actionDescription:{name:e.tab}},shiftTab:{defaultHandler:function(e){return t._doShiftTab(u(e,{}))},actionDescription:{name:e.shiftTab}},enter:{defaultHandler:function(e){return t._doEnter(u(e,{}))},actionDescription:{name:e.enter}},enterNoCursor:{defaultHandler:function(e){return t._doEnter(u(e,{noCursor:!0}))},actionDescription:{name:e.enterNoCursor}},escape:{defaultHandler:function(e){return t._doEscape(u(e,{}))},actionDescription:{name:e.escape}},selectAll:{defaultHandler:function(e){return t._doSelectAll(u(e,{}))},actionDescription:{name:e.selectAll}},copy:{defaultHandler:function(e){return t._doCopy(u(e,{}))},actionDescription:{name:e.copy}},cut:{defaultHandler:function(e){return t._doCut(u(e,{}))},actionDescription:{name:e.cut}},paste:{defaultHandler:function(e){return t._doPaste(u(e,{}))},actionDescription:{name:e.paste}},uppercase:{defaultHandler:function(e){return t._doCase(u(e,{type:"upper"}))},actionDescription:{name:e.uppercase}},lowercase:{defaultHandler:function(e){return t._doCase(u(e,{type:"lower"}))},actionDescription:{name:e.lowercase}},capitalize:{defaultHandler:function(e){return t._doCase(u(e,{unit:"word",type:"capitalize"}))},actionDescription:{name:e.capitalize}},reversecase:{defaultHandler:function(e){return t._doCase(u(e,{type:"reverse"}))},actionDescription:{name:e.reversecase}},toggleOverwriteMode:{defaultHandler:function(e){return t._doOverwriteMode(u(e,{}))},actionDescription:{name:e.toggleOverwriteMode}},toggleTabMode:{defaultHandler:function(e){return t._doTabMode(u(e,{}))},actionDescription:{name:e.toggleTabMode}},toggleWrapMode:{defaultHandler:function(e){return t._doWrapMode(u(e,{}))},actionDescription:{name:e.toggleWrapMode}}}},_createRulerParent:function(e,t){var n=s.createElement(e,"div");return n.className=t,n.tabIndex=-1,n.style.overflow="hidden",n.style.MozUserSelect="none",n.style.WebkitUserSelect="none",n.style.position="absolute",n.style.top="0px",n.style.bottom="0px",n.style.cursor="default",n.style.display="none",n.setAttribute("aria-hidden","true"),this._rootDiv.appendChild(n),n},_createRuler:function(e,t){if(this._clientDiv){var n=this._getRulerParent(e);if(n){(n!==this._marginDiv||this._marginOffset)&&(n.style.display="block"),n.rulerWidth=void 0;var i=s.createElement(n.ownerDocument,"div");if(i._ruler=e,e.node=i,i.rulerChanged=!0,i.style.position="relative",i.style.cssFloat="left",i.style.styleFloat="left",i.style.outline="none",void 0===t||0>t||t>=n.children.length)n.appendChild(i);else{for(var r=n.firstChild;r&&t-->0;)r=r.nextSibling;n.insertBefore(i,r)}}}},_createSelectionDiv:function(){var e=s.createElement(this._parent.ownerDocument,"div");return e.className="textviewSelection",e.style.position="absolute",e.style.borderWidth="0px",e.style.margin="0px",e.style.padding="0px",e.style.outline="none",e.style.width="0px",e.style.height="0px",e.style.zIndex="0",e},_createView:function(){function e(){C._rootDiv&&(C.update(!0),C._metrics.invalid&&C._getWindow().setTimeout(function(){e()},100))}if(!this._clientDiv){for(var t=this._parent;t.hasChildNodes();)t.removeChild(t.lastChild);var n=t.ownerDocument,i=s.createElement(n,"div");this._rootDiv=i,i.tabIndex=-1,i.style.position="relative",i.style.overflow="hidden",i.style.width="100%",i.style.height="100%",i.style.overflow="hidden",i.style.WebkitTextSizeAdjust="100%",i.setAttribute("role","application"),t.appendChild(i);var r=this._createRulerParent(n,"textviewLeftRuler");this._leftDiv=r;var o=s.createElement(n,"div");o.className="textviewScroll",this._viewDiv=o,o.tabIndex=-1,o.style.position="absolute",o.style.top="0px",o.style.bottom="0px",o.style.borderWidth="0px",o.style.margin="0px",o.style.outline="none",o.style.background="transparent",i.appendChild(o);var a=this._createRulerParent(n,"textviewRightRuler");this._rightDiv=a,"rtl"==document.dir?a.style.left="0px":a.style.right="0px";var l=this._createRulerParent(n,"textviewInnerRightRuler");this._innerRightDiv=l,l.style.zIndex="1";var d=s.createElement(n,"div");this._scrollDiv=d,d.style.margin="0px",d.style.borderWidth="0px",d.style.padding="0px",o.appendChild(d);var h=this._marginDiv=this._createRulerParent(n,"textviewMarginRuler");if(h.style.zIndex="4",!s.isIE&&!s.isIOS){var c=s.createElement(n,"div");this._clipDiv=c,c.style.position="absolute",c.style.overflow="hidden",c.style.margin="0px",c.style.borderWidth="0px",c.style.padding="0px",c.style.background="transparent",i.appendChild(c);var u=s.createElement(n,"div");this._clipScrollDiv=u,u.style.position="absolute",u.style.height="1px",u.style.top="-1000px",u.style.background="transparent",c.appendChild(u)}var f=s.createElement(n,"div");if(f.className="textviewContent",this._clientDiv=f,f.tabIndex=0,f.style.position="absolute",f.style.borderWidth="0px",f.style.margin="0px",f.style.padding="0px",f.style.outline="none",f.style.zIndex="1",f.style.WebkitUserSelect="text",f.setAttribute("spellcheck","false"),(s.isIOS||s.isAndroid)&&(f.style.WebkitTapHighlightColor="transparent"),(this._clipDiv||i).appendChild(f),this._setFullSelection(this._fullSelection,!0),s.isIOS||s.isAndroid){var p=s.createElement(n,"div");this._vScrollDiv=p,p.style.position="absolute",p.style.borderWidth="1px",p.style.borderColor="white",p.style.borderStyle="solid",p.style.borderRadius="4px",p.style.backgroundColor="black",p.style.opacity="0.5",p.style.margin="0px",p.style.padding="0px",p.style.outline="none",p.style.zIndex="3",p.style.width="8px",p.style.display="none",i.appendChild(p);var g=s.createElement(n,"div");this._hScrollDiv=g,g.style.position="absolute",g.style.borderWidth="1px",g.style.borderColor="white",g.style.borderStyle="solid",g.style.borderRadius="4px",g.style.backgroundColor="black",g.style.opacity="0.5",g.style.margin="0px",g.style.padding="0px",g.style.outline="none",g.style.zIndex="3",g.style.height="8px",g.style.display="none",i.appendChild(g)}if(s.isFirefox&&!f.setCapture){var v=s.createElement(n,"div");this._overlayDiv=v,v.style.position=f.style.position,v.style.borderWidth=f.style.borderWidth,v.style.margin=f.style.margin,v.style.padding=f.style.padding,v.style.cursor="text",v.style.zIndex="2",(this._clipDiv||i).appendChild(v)}f.contentEditable="true",f.setAttribute("role","textbox"),f.setAttribute("aria-multiline","true"),this._setWrapMode(this._wrapMode,!0),this._setReadOnly(this._readonly),this._setThemeClass(this._themeClass,!0),this._setTabSize(this._tabSize,!0),this._setMarginOffset(this._marginOffset,!0),this._hookEvents();for(var m=this._rulers,y=0;ythis._getLineHeight()){var n=t.getBoundingClientRect(),i=this._clientDiv.getBoundingClientRect();n.bottom>i.bottom&&(t=this._getLinePrevious(t)||t)}return t.lineIndex},_getBlockSelections:function(e,t,n){var i=this._model;e=e.filter(function(e){return!e._editing});var r,o=i.getLineAtOffset(this._blockSelection.getAnchor());t>o?r=t:(r=o,o=t);for(var s=o;r>=s;s++){var a=this._getLine(s),l=a.getOffset(n.x,1),d=a.getOffset(this._blockSelection._docX,1);if(a.destroy(),l!==d||l!==i.getLineEnd(s)){var h=d>l,c=new y(h?l:d,h?d:l,h);c._editing=!0,e.push(c)}}return e},_getBoundsAtOffset:function(e){var t=this._model,n=this._getLine(t.getLineAtOffset(e)),i=n.getBoundingClientRect(e),r=this._getLinePixel(n.lineIndex);return i.top+=r,i.bottom+=r,n.destroy(),i},_getClientHeight:function(){var e=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-e.top-e.bottom)},_getInnerRightWidth:function(){var e=this._innerRightDiv.rulerWidth;if(void 0===e){var t=this._innerRightDiv.getBoundingClientRect();this._innerRightDiv.rulerWidth=e=t.right-t.left}return e},_getClientWidth:function(){var e=this._getViewPadding(),t=this._getInnerRightWidth();return Math.max(0,this._viewDiv.clientWidth-e.left-e.right-t)},_getClipboardText:function(e,t){function n(e){var n=[];return p(e,function(e){n.push(e)},null),t&&t(n),n}var i=this._getWindow(),r=i.clipboardData;if(!r&&e&&(r=e.clipboardData),r)return n(r.getData(s.isIE?"Text":"text/plain"));if(s.isFirefox){this._ignoreFocus=!0;var o=this._clipboardDiv,a=this._rootDiv.ownerDocument;o||(o=s.createElement(a,"div"),this._clipboardDiv=o,o.style.position="fixed",o.style.whiteSpace="pre",o.style.left="-1000px",this._rootDiv.appendChild(o)),o.innerHTML=" ",o.firstChild.focus();var l=this,d=function(){var e=l._getTextFromElement(o);return o.innerHTML="",n(e)},h=!1;if(this._ignorePaste=!0,!s.isLinux||2!==this._lastMouseButton)try{h=a.execCommand("paste",!1,null)}catch(c){h=o.childNodes.length>1||o.firstChild&&o.firstChild.childNodes.length>0}return this._ignorePaste=!1,h?(this.focus(),this._ignoreFocus=!1,d()):e?(i.setTimeout(function(){l.focus(),d(),l._ignoreFocus=!1},0),null):(this.focus(),this._ignoreFocus=!1,"")}return""},_getDOMText:function(e,t){return e._line.getText(t)},_getTextFromElement:function(e){var t=e.ownerDocument,n=t.defaultView;if(!n.getSelection)return e.innerText||e.textContent;var i=t.createRange();i.selectNode(e);var r,o=n.getSelection(),s=[];for(r=0;rn)for(t=n;e>t;t++)i+=this._getLineHeight(t);else for(t=n-1;t>=e;t--)i-=this._getLineHeight(t);return i}var r=this._getLineHeight();return r*e},_getLineIndex:function(e,t){var n,i=0,r=this._model.getLineCount();if(this._lineHeight){i=this._getTopIndex();var o=-this._topIndexY+this._getScroll().y;if(e!==o)if(o>e)for(;o>e&&i>0;)e+=this._getLineHeight(--i);else for(n=this._getLineHeight(i);e-n>=o&&r-1>i;)e-=n,n=this._getLineHeight(++i)}else n=this._getLineHeight(),i=Math.floor(e/n);return t&&(0===r||0>i||i>r-1)?-1:Math.max(0,Math.min(r-1,i))},_getRulerParent:function(e){switch(e.getLocation()){case"left":return this._leftDiv;case"right":return this._rightDiv;case"innerRight":return this._innerRightDiv;case"margin":return this._marginDiv}return null},_getScroll:function(e){(void 0===e||e)&&this._cancelAnimation();var t=this._viewDiv;return{x:t.scrollLeft,y:t.scrollTop}},_getSelection:function(){return(Array.isArray(this._selection)?this._selection[0]:this._selection).clone()},_getSelections:function(){return(Array.isArray(this._selection)?this._selection:[this._selection]).map(function(e){return e.clone()})},_getTopIndex:function(e){var t=this._topChild;if(e&&this._getClientHeight()>this._getLineHeight()){var n=t.getBoundingClientRect(),i=this._getViewPadding(),r=this._viewDiv.getBoundingClientRect();n.top26?"wheel":s.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(t){return e._handleMouseWheel(t?t:l.event)}}),this._clipDiv&&t.push({target:this._clipDiv,type:s.isFirefox>26?"wheel":s.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(t){return e._handleMouseWheel(t?t:l.event)}}),s.isFirefox&&(!s.isWindows||s.isFirefox>=15)){var h=l.MutationObserver||l.MozMutationObserver;h?(this._mutationObserver=new h(function(t){e._handleDataModified(t)}),this._mutationObserver.observe(n,{subtree:!0,characterData:!0})):t.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(t){return e._handleDataModified(t?t:l.event)}})}(s.isFirefox&&(!s.isWindows||s.isFirefox>=15)||s.isIE||s.isWebkit)&&(t.push({target:this._clientDiv,type:"compositionstart",handler:function(t){return e._handleCompositionStart(t?t:l.event)}}),t.push({target:this._clientDiv,type:"compositionend",handler:function(t){return e._handleCompositionEnd(t?t:l.event)}}),t.push({target:this._clientDiv,type:"compositionupdate",handler:function(t){return e._handleCompositionUpdate(t?t:l.event)}})),this._overlayDiv&&(t.push({target:this._overlayDiv,type:"mousedown",handler:function(t){return e._handleMouseDown(t?t:l.event)}}),t.push({target:this._overlayDiv,type:"mouseover",handler:function(t){return e._handleMouseOver(t?t:l.event)}}),t.push({target:this._overlayDiv,type:"mouseout",handler:function(t){return e._handleMouseOut(t?t:l.event)}}),t.push({target:this._overlayDiv,type:"contextmenu",handler:function(t){return e._handleContextMenu(t?t:l.event)}})),this._isW3CEvents||t.push({target:this._clientDiv,type:"dblclick",handler:function(t){return e._handleDblclick(t?t:l.event)}})}this._hookRulerEvents(this._leftDiv,t),this._hookRulerEvents(this._rightDiv,t),this._hookRulerEvents(this._innerRightDiv,t),this._hookRulerEvents(this._marginDiv,t);for(var c=0;c26?"wheel":s.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(e){return n._handleMouseWheel(e?e:i.event)}}),t.push({target:e,type:"click",handler:function(e){n._handleRulerEvent(e?e:i.event)}}),t.push({target:e,type:"dblclick",handler:function(e){n._handleRulerEvent(e?e:i.event)}}),t.push({target:e,type:"mousemove",handler:function(e){n._handleRulerEvent(e?e:i.event)}}),t.push({target:e,type:"mouseover",handler:function(e){n._handleRulerEvent(e?e:i.event)}}),t.push({target:e,type:"mouseout",handler:function(e){n._handleRulerEvent(e?e:i.event)}})}},_getWindow:function(){return l(this._parent.ownerDocument)},_ignoreEvent:function(e){for(var t=e.target;t&&t!==this._clientDiv;){if(t.ignore)return!0;t=t.parentNode}return!1},_init:function(e){var n=e.parent;if("string"==typeof n&&(n=(e.document||document).getElementById(n)),!n)throw new Error("no parent");e.parent=n,e.model=e.model||new t.TextModel;var i=this._defaultOptions();for(var r in i)if(i.hasOwnProperty(r)){var o;o=void 0!==e[r]?e[r]:i[r].value,this["_"+r]=o}this._keyModes=[],this._rulers=[],this._selection=[new y(0,0,!1)],this._linksVisible=!1,this._redrawCount=0,this._maxLineWidth=0,this._maxLineIndex=-1,this._ignoreSelect=!0,this._ignoreFocus=!1,this._hasFocus=!1,this._dragOffset=-1,this._isRangeRects=(!s.isIE||s.isIE>=9)&&"function"==typeof n.ownerDocument.createRange().getBoundingClientRect,this._isW3CEvents=n.addEventListener,this._autoScrollX=null,this._autoScrollY=null,this._autoScrollTimerID=null,this._AUTO_SCROLL_RATE=50,this._grabControl=null,this._moseMoveClosure=null,this._mouseUpClosure=null,this._lastMouseX=0,this._lastMouseY=0,this._lastMouseTime=0,this._clickCount=0,this._clickTime=250,this._clickDist=5,this._isMouseDown=!1,this._doubleClickSelection=null,this._hScroll=0,this._vScroll=0,this._imeOffset=-1,this._createActions(),this._createView()},_checkOverlayScroll:function(){if(s.isMac&&s.isWebkit&&!this._metrics.invalid&&0===this._metrics.scrollWidth){var e=this._viewDiv,t=this._isOverOverlayScroll();e.style.pointerEvents=t.vertical||t.horizontal?"":"none"}},_isOverOverlayScroll:function(){var e=(new Date).getTime()-this._lastScrollTime<200;if(!e)return{};var t=this._viewDiv.getBoundingClientRect(),n=this._lastMouseMoveX,i=this._lastMouseMoveY,r=15;return{vertical:t.top<=i&&i1&&this.setRedraw(!1);var s=this._compoundChange;s?y.compare(this._getSelections(),s.owner.selection)||(this._endUndo(),e.selection.length>1&&this._startUndo()):e.selection.length>1&&this._startUndo();var a=this._model;try{e._ignoreDOMSelection&&(this._ignoreDOMSelection=!0);var l=0,d=0;e.selection.forEach(function(n){n.start+=l,n.end+=l;var i=Array.isArray(e.text)?e.text[d]:e.text;a.setText(i,n.start,n.end),l+=n.start-n.end+i.length,n.setCaret(t?n.start+i.length:n.start),d++})}finally{e._ignoreDOMSelection&&(this._ignoreDOMSelection=!1)}return this._setSelection(e.selection,n,!0,i),s=this._compoundChange,s&&(s.owner.selection=e.selection),e.selection.length>1&&this.setRedraw(!0),this.onModify({type:"Modify"}),!0},_onModelChanged:function(e){e.type="ModelChanged",this.onModelChanged(e),e.type="Changed";var t=e.start,n=e.addedCharCount,i=e.removedCharCount,r=e.addedLineCount,o=e.removedLineCount,s=this._getSelections();s.forEach(function(e){e.end>t&&(e.end>t&&e.start=l&&l+o>=c&&(l!==c||h.modelChangedEvent||h.lineRemoved?(h.lineRemoved=!0,h.lineChanged=!1,h.modelChangedEvent=null):(h.modelChangedEvent=e,h.lineChanged=!0)),c>l+o&&(h.lineIndex=c+r-o,h._line.lineIndex=h.lineIndex),h=this._getLineNext(h)}if(this._lineHeight){var u=[l,o].concat(d(r));Array.prototype.splice.apply(this._lineHeight,u)}this._wrapMode||l<=this._maxLineIndex&&this._maxLineIndex<=l+o&&(this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0),this._update()},_onModelChanging:function(e){e.type="ModelChanging",this.onModelChanging(e),e.type="Changing"},_queueUpdate:function(){if(!this._updateTimer&&!this._ignoreQueueUpdate){var e=this,t=this._getWindow();this._updateTimer=t.setTimeout(function(){e._updateTimer=null,e._update()},0)}},_rangesToSelections:function(e){var t=[],n=this._model.getCharCount();return e.forEach(function(e){var i;if(e instanceof y)i=e.clone();else{var r=e.start,o=e.end,s=r>o;if(s){var a=r;r=o,o=a}r=Math.max(0,Math.min(r,n)),o=Math.max(0,Math.min(o,n)),i=new y(r,o,s)}t.push(i)}),t},_resetLineHeight:function(e,t){if(this._wrapMode||this._variableLineHeight){if(void 0!==e&&void 0!==t)for(var n=e;t>n;n++)this._lineHeight[n]=void 0;else this._lineHeight=d(this._model.getLineCount());this._calculateLineHeightTimer()}else this._lineHeight=null},_resetLineWidth:function(){var e=this._clientDiv;if(e)for(var t=e.firstChild;t;)t.lineWidth=void 0,t=t.nextSibling},_reset:function(){this._maxLineIndex=-1,this._maxLineWidth=0,this._topChild=null,this._bottomChild=null,this._topIndexY=0,this._variableLineHeight=!1,this._resetLineHeight(),this._setSelection(new y(0,0,!1),!1,!1),this._viewDiv&&(this._viewDiv.scrollLeft=0,this._viewDiv.scrollTop=0);var e=this._clientDiv;if(e){for(var t=e.firstChild;t;)t.lineRemoved=!0,t=t.nextSibling;s.isFirefox<13&&this._fixCaret()}},_scrollViewAnimated:function(e,t,n){var i=this._getWindow();if(n&&this._scrollAnimation){var r=this;this._animation=new E({window:i,duration:this._scrollAnimation,curve:[t,0],onAnimate:function(e){var n=t-Math.floor(e);r._scrollView(0,n),t-=n},onEnd:function(){r._animation=null,r._scrollView(e,t),n&&i.setTimeout(n,0)}}),this._animation.play()}else this._scrollView(e,t),n&&i.setTimeout(n,0)},_scrollView:function(e,t){this._ensureCaretVisible=!1;var n=this._viewDiv;e&&(n.scrollLeft+=e),t&&(n.scrollTop+=t)},_setClipboardText:function(e,t){var n,i=this._getWindow(),r=i.clipboardData;if(!r&&t&&(r=t.clipboardData),r){n=[],p(e,function(e){n.push(e)},function(){n.push(s.platformDelimiter)});var o=r.setData(s.isIE?"Text":"text/plain",n.join(""));if(o||t&&(s.isFirefox>21||s.isWebkit))return!0;if(!t)return!1}var a=this._parent.ownerDocument,l=s.createElement(a,"pre");l.style.position="fixed",l.style.left="-1000px",p(e,function(e){l.appendChild(a.createTextNode(e))},function(){l.appendChild(s.createElement(a,"br"))}),l.appendChild(a.createTextNode(" ")),this._clientDiv.appendChild(l);var d=a.createRange();d.setStart(l.firstChild,0),d.setEndBefore(l.lastChild);var h=i.getSelection();h.rangeCount>0&&h.removeAllRanges(),h.addRange(d);var c=this,u=function(){l&&l.parentNode===c._clientDiv&&c._clientDiv.removeChild(l),c._updateDOMSelection()},f=!1;this._ignoreCopy=!0;try{f=a.execCommand("copy",!1,null)}catch(g){}return this._ignoreCopy=!1,!f&&t?(i.setTimeout(u,0),!1):(u(),!0)},_setGrab:function(e){e!==this._grabControl&&(e?(e.setCapture&&e.setCapture(),this._grabControl=e):(this._grabControl.releaseCapture&&this._grabControl.releaseCapture(),this._grabControl=null))},_setLinksVisible:function(e){if(this._linksVisible!==e){this._linksVisible=e,s.isIE&&e&&(this._hadFocus=this._hasFocus);var t=this._clientDiv;t.contentEditable=!e,this._hadFocus&&!e&&t.focus(),this._overlayDiv&&(this._overlayDiv.style.zIndex=e?"-1":"1");for(var n=this._getLineNext();n;)n._line.updateLinks(),n=this._getLineNext(n);this._updateDOMSelection()}},_setSelection:function(e,t,n,i,r,o,s){if(e){void 0===n&&(n=!0);var a,l=this._getSelections();if(a=Array.isArray(e)?e:o?l.concat([e]):[e],this._selection=y.merge(a),s||a.forEach(function(e){e._columnX=-1}),t!==!1&&this._showCaret(!1,i,t,r),n&&this._updateDOMSelection(),!y.compare(l,a)){var d={type:"Selection",oldValue:y.convert(l),newValue:y.convert(a)};this.onSelection(d)}}},_setSelectionTo:function(e,t,n,i,r,o){var s=this._model,a=this._getSelections(),l=this.convert({x:e,y:t},"page","document"),d=this._getLineIndex(l.y),h=this._getLine(d),c=h.getOffset(l.x,l.y-this._getLinePixel(d));if(o&&!i&&y.contains(a,c))return this._dragOffset=c,h.destroy(),!1;if(this._blockSelection)a=this._getBlockSelections(a,d,l);else{var u;if(n?i?(u=a[a.length-1],u._editing=!0):(u=new y(0,0),u._editing=!0,r?a.push(u):a=[u],u._docX=l.x):u=y.editing(a),1===this._clickCount)u.extend(c),i||u.collapse();else{var f,p,g=0===(1&this._clickCount);if(g)this._doubleClickSelection?c>=this._doubleClickSelection.start?(f=this._doubleClickSelection.start,p=h.getNextOffset(c,{unit:"wordend",count:1})):(f=h.getNextOffset(c,{unit:"word",count:-1}),p=this._doubleClickSelection.end):(f=h.getNextOffset(c,{unit:"word",count:-1}),p=h.getNextOffset(f,{unit:"wordend",count:1}));else if(this._doubleClickSelection){var v=s.getLineAtOffset(this._doubleClickSelection.start);d>=v?(f=s.getLineStart(v),p=s.getLineEnd(d)):(f=s.getLineStart(d),p=s.getLineEnd(v))}else f=s.getLineStart(d),p=s.getLineEnd(d);u.setCaret(f),u.extend(p)}}return this._setSelection(a,!0,!0,null,!1),h.destroy(),!0},_setFullSelection:function(e,t){this._fullSelection=e,s.isWebkit&&(this._fullSelection=e=!0),this._domSelection||(this._domSelection=[],this._cursorVisible=!0),t||this._updateDOMSelection()},_setBlockCursor:function(e){this._blockCursorVisible=e,this._updateBlockCursorVisible()},_setOverwriteMode:function(e){this._overwriteMode=e,this._updateBlockCursorVisible()},_updateBlockCursorVisible:function(){if(this._blockCursorVisible||this._overwriteMode){if(!this._cursorDiv){var e=this._viewDiv,t=s.createElement(e.ownerDocument,"div");t.className="textviewBlockCursor",this._cursorDiv=t,t.tabIndex=-1,t.style.zIndex="2",t.style.color="transparent",t.style.position="absolute",t.style.pointerEvents="none",t.innerHTML=" ",e.appendChild(t),this._updateDOMSelection()}}else this._cursorDiv&&(this._cursorDiv.parentNode.removeChild(this._cursorDiv),this._cursorDiv=null)},_setMarginOffset:function(e,t){this._marginOffset=e,this._marginDiv.style.display=e?"block":"none",t||(this._metrics=this._calculateMetrics(),this._queueUpdate())},_setWrapOffset:function(e,t){this._wrapOffset=e,t||(this._metrics=this._calculateMetrics(),this._queueUpdate())},_setReadOnly:function(e){this._readonly=e,this._clientDiv.setAttribute("aria-readonly",e?"true":"false")},_setSingleMode:function(e,t){this._singleMode=e,this._updateOverflow(),this._updateStyle(t)},_setNoScroll:function(e,t){this._noScroll=e,this._updateOverflow(),this._updateStyle(t)},_setTabSize:function(e,t){this._tabSize=e,this._customTabSize=void 0;var n=this._clientDiv;s.isOpera?n&&(n.style.OTabSize=this._tabSize+""):s.isWebkit>=537.1?n&&(n.style.tabSize=this._tabSize+""):s.isFirefox>=4?n&&(n.style.MozTabSize=this._tabSize+""):8!==this._tabSize&&(this._customTabSize=this._tabSize),t||(this.redrawLines(),this._resetLineWidth())},_setTheme:function(e){this._theme&&this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged),this._theme=e,this._theme&&this._theme.addEventListener("ThemeChanged",this._themeListener.onChanged),this._setThemeClass(this._themeClass)},_setThemeClass:function(e,t){this._themeClass=e;var n="textview",i=this._theme.getThemeClass();i&&(n+=" "+i),this._themeClass&&i!==this._themeClass&&(n+=" "+this._themeClass),this._rootDiv.className=n,this._updateStyle(t)},_setUndoStack:function(e){this._undoStack=e},_setWrapMode:function(e,t){this._wrapMode=e&&this._wrappable;var n=this._clientDiv;this._wrapMode?(n.style.whiteSpace="pre-wrap",n.style.wordWrap="break-word"):(n.style.whiteSpace="pre",n.style.wordWrap="normal"),this._updateOverflow(),t||(this.redraw(),this._resetLineWidth()),this._resetLineHeight()},_showCaret:function(e,t,n,i){if(this._clientDiv&&!(this._redrawCount>0||this._ignoreDOMSelection||-1!==this._imeOffset)){var r=this._model,o=this._getSelections(),s=y.editing(o,"down"===this._autoScrollDir),a=this._getScroll(),l=s.getCaret(),d=s.start,h=s.end,c=r.getLineAtOffset(d),u=r.getLineAtOffset(h),f=Math.max(Math.max(d,r.getLineStart(u)),h-1),p=this._getClientWidth(),g=this._getClientHeight(),v=p/4,m=this._getBoundsAtOffset(l===d?d:f),_=m.left,C=m.right,w=m.top,x=m.bottom,S=0,b="object"==typeof n;!e&&!b||s.isEmpty()||(m=this._getBoundsAtOffset(l===h?d:f),S=(m.bottom>x?m.bottom:x)-(m.topa.x+p&&(T=Math.max(C-a.x-p,v));var E=0;wa.y+g&&(E=x-a.y-g),i&&(i>0?E>0&&(E=Math.max(E,i)):0>E&&(E=Math.min(E,i)));var L=b&&"always"===n.scrollPolicy;if(0!==T||0!==E||L){if(b){var k=E>0;0===E&&(E=w-a.y);var A=n.viewAnchor,M=n.selectionAnchor,D=Math.min(Math.max(0,n.viewAnchorOffset||0));E+=Math.floor("top"===A?k?(1-D)*g:-D*g:"bottom"===A?k?D*g:-(1-D)*g:"center"===A?k?g/2+D*g:g/2-(1-D)*g:k?D*g:-D*g),c!==u&&("top"===M&&l!==d?E+=Math.floor(-S):"bottom"===M&&l!==h?E+=Math.floor(S):"center"===M&&(E+=Math.floor(S/2)))}else 0!==E&&"number"==typeof n&&(0>n&&(n=0),n>1&&(n=1),E+=Math.floor(E>0?n*g:-n*g));return this._scrollViewAnimated(T,E,t),g!==this._getClientHeight()||p!==this._getClientWidth()?this._showCaret():this._ensureCaretVisible=!0,!0}return t&&t(),!1}},_startIME:function(){if(-1===this._imeOffset){for(var e=!1,t=this._getSelections(),n=0;n0)&&!this._ignoreDOMSelection&&-1===this._imeOffset&&this._clientDiv){var e,t=this._getSelections(),n=this._domSelection;if(n.lengtht.length&&n.splice(t.length).forEach(function(e){e.destroy()});for(e=0;e1?this._cursorTimer||(this._cursorTimer=i.setInterval(function(){r._cursorVisible=!r._cursorVisible,r._domSelection.forEach(function(e){e.update()})},500)):this._cursorTimer&&(i.clearInterval(this._cursorTimer),this._cursorTimer=null)}},_update:function(e){if(!(this._redrawCount>0)){if(this._updateTimer){var t=this._getWindow();t.clearTimeout(this._updateTimer),this._updateTimer=null,e=!1}var n=this._clientDiv,i=this._viewDiv;if(n){this._metrics.invalid&&(this._ignoreQueueUpdate=!0,this._updateStyle(),this._ignoreQueueUpdate=!1);var r=this._model,o=this._getScroll(!1),a=this._getViewPadding(),l=r.getLineCount(),d=this._getLineHeight(),h=!1,c=!1,u=!1,f=this._metrics.scrollWidth;this._wrapMode&&(n.style.width=(this._metrics.wrapWidth||this._getClientWidth())+"px");var p,g,v,m,_,y,C,w,S,b,T,E=0,L=0;if(this._lineHeight){for(;l>L&&(T=this._getLineHeight(L),!(E+T>o.y));)E+=T,L++;p=L,g=Math.max(0,p-1),m=v=o.y-E,p>0&&(v+=this._getLineHeight(p-1))}else{var k=Math.max(0,o.y)/d;p=Math.floor(k),g=Math.max(0,p-1),v=Math.round((k-g)*d),m=Math.round((k-p)*d),b=l*d}this._topIndexY=m;var A=this._rootDiv,M=A.clientWidth,D=A.clientHeight;if(e){for(_=0,this._leftDiv&&(y=this._leftDiv.getBoundingClientRect(),_=y.right-y.left),C=this._getClientWidth(),w=this._getClientHeight(),S=C,this._wrapMode?this._metrics.wrapWidth&&(S=this._metrics.wrapWidth):S=Math.max(this._maxLineWidth,S);l>L;)T=this._getLineHeight(L,!1),E+=T,L++;b=E}else{w=this._getClientHeight();for(var O,N,I=Math.floor((w+m)/d),R=Math.min(p+I,l-1),B=Math.min(R+1,l-1),P=n.firstChild;P;){O=P.lineIndex;var F=P.nextSibling;O>=g&&B>=O&&!P.lineRemoved&&-1!==P.lineIndex||(this._mouseWheelLine===P?(P.style.display="none",P.lineIndex=-1):n.removeChild(P)),P=F}P=this._getLineNext();var V=i.ownerDocument,U=V.createDocumentFragment();for(O=g;B>=O;O++)!P||P.lineIndex>O?new x(this,O).create(U,null):(U.firstChild&&(n.insertBefore(U,P),U=V.createDocumentFragment()),P&&P.lineChanged&&(P=new x(this,O).create(U,P),P.lineChanged=!1),P=this._getLineNext(P));U.firstChild&&n.insertBefore(U,P),s.isWebkit&&!this._wrapMode&&(n.style.width="0x7fffffffpx");var K;P=this._getLineNext();for(var W=w+v,H=!1;P;){if(N=P.lineWidth,void 0===N){K=P._line.getBoundingClientRect(),N=P.lineWidth=Math.ceil(K.right-K.left);var j=K.bottom-K.top;this._lineHeight?this._lineHeight[P.lineIndex]=j:0!==d&&0!==j&&Math.ceil(d)!==Math.ceil(j)&&(this._variableLineHeight=!0,this._lineHeight=[],this._lineHeight[P.lineIndex]=j)}this._lineHeight&&!H&&(W-=this._lineHeight[P.lineIndex],0>W&&(R=P.lineIndex,H=!0)),this._wrapMode||(N>=this._maxLineWidth&&(this._maxLineWidth=N,this._maxLineIndex=P.lineIndex),this._checkMaxLineIndex===P.lineIndex&&(this._checkMaxLineIndex=-1)),P.lineIndex===p&&(this._topChild=P),P.lineIndex===R&&(this._bottomChild=P),P=this._getLineNext(P)}if(-1!==this._checkMaxLineIndex&&(O=this._checkMaxLineIndex,this._checkMaxLineIndex=-1,O>=0&&l>O)){var G=new x(this,O);K=G.getBoundingClientRect(),N=K.right-K.left,N>=this._maxLineWidth&&(this._maxLineWidth=N,this._maxLineIndex=O),G.destroy()}for(;l>L;)T=this._getLineHeight(L,R>=L),E+=T,L++;b=E,this._updateRuler(this._leftDiv,p,B,D),this._updateRuler(this._rightDiv,p,B,D),this._updateRuler(this._innerRightDiv,p,B,D),this._updateRuler(this._marginDiv,p,B,D),_=0,this._leftDiv&&(y=this._leftDiv.getBoundingClientRect(),_=y.right-y.left);var $=0;if(this._rightDiv){var z=this._rightDiv.getBoundingClientRect();$=z.right-z.left}i.style.left=_+"px",i.style.right=$+"px";var Y=this._scrollDiv;if(Y.style.height=b+(s.isWebkit?0:a.bottom)+"px",C=this._getClientWidth(),!this._singleMode&&!this._wrapMode&&!this._noScroll){var X=w,q=w,J="scroll"===i.style.overflowX;J?X+=f:q-=f;var Z=C,Q=C,et="scroll"===i.style.overflowY;et?Z+=f:Q-=f,w=X,C=Z,b>w&&(u=!0,C=Q),this._maxLineWidth>C&&(c=!0,w=q,b>w&&(u=!0,C=Q)),J!==c&&(i.style.overflowX=c?"scroll":"hidden"),et!==u&&(i.style.overflowY=u?"scroll":"hidden"),h=J!==c||et!==u}var tt=C;this._wrapMode?this._metrics.wrapWidth&&(tt=this._metrics.wrapWidth):tt=Math.max(this._maxLineWidth+this._getInnerRightWidth(),tt),S=tt,(!s.isIE||s.isIE>=9)&&this._maxLineWidth>C&&(tt+=a.right+a.left),Y.style.width=tt+"px",this._clipScrollDiv&&(this._clipScrollDiv.style.width=tt+"px"),o=this._getScroll(!1);var nt=this._innerRightDiv;nt&&(nt.style.right=$+("scroll"===i.style.overflowY?this._metrics.scrollWidth:0)+"px",nt.style.bottom=("scroll"===i.style.overflowX?f:0)+"px")}if(this._scrollHeight=b,this._vScrollDiv){var it=w-8,rt=Math.max(15,Math.ceil(Math.min(1,it/(b+a.top+a.bottom))*it));this._vScrollDiv.style.left=_+C-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,o.y*it/b))+"px",this._vScrollDiv.style.height=rt+"px"}if(!this._wrapMode&&this._hScrollDiv){var ot=C-8,st=Math.max(15,Math.ceil(Math.min(1,ot/(this._maxLineWidth+a.left+a.right))*ot));this._hScrollDiv.style.left=_+Math.floor(Math.max(0,Math.floor(o.x*ot/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=w-9+"px",this._hScrollDiv.style.width=st+"px"}var at,lt,dt=o.x,ht=this._clipDiv,ct=this._overlayDiv,ut=this._marginDiv;if(ut&&(ut.style.left=-dt+_+this._metrics.marginWidth+a.left+"px",ut.style.bottom=("scroll"===i.style.overflowX?f:0)+"px"),ht){ht.scrollLeft=dt,ht.scrollTop=0,at=_+a.left,lt=a.top;var ft=C,pt=w,gt=0,vt=-v;0===o.x&&(at-=a.left,ft+=a.left,gt=a.left),o.x+C===S&&(ft+=a.right),0===o.y&&(lt-=a.top,pt+=a.top,vt+=a.top),o.y+w===b&&(pt+=a.bottom),ht.style.left=at+"px",ht.style.top=lt+"px",ht.style.right=M-ft-at+"px",ht.style.bottom=D-pt-lt+"px",n.style.left=gt+"px",n.style.top=vt+"px",n.style.width=S+"px",n.style.height=w+v+"px",ct&&(ct.style.left=n.style.left,ct.style.top=n.style.top,ct.style.width=n.style.width,ct.style.height=n.style.height)}else{at=dt,lt=v;var mt=dt+C,_t=v+w;0===at&&(at-=a.left),0===lt&&(lt-=a.top),mt===S&&(mt+=a.right),o.y+w===b&&(_t+=a.bottom),n.style.clip="rect("+lt+"px,"+mt+"px,"+_t+"px,"+at+"px)","rtl"==document.dir?n.style.right=-dt+_+a.left+"px":n.style.left=-dt+_+a.left+"px",n.style.width=(this._wrapMode||s.isWebkit?S:C+dt)+"px",e||(n.style.top=-v+a.top+"px",n.style.height=w+v+"px"),ct&&(ct.style.clip=n.style.clip,ct.style.left=n.style.left,ct.style.width=n.style.width,e||(ct.style.top=n.style.top,ct.style.height=n.style.height))}if(this._updateDOMSelection(),h){var yt=this._ensureCaretVisible;this._ensureCaretVisible=!1,yt&&this._showCaret(),this._queueUpdate()}}}},_updateOverflow:function(){var e=this._viewDiv;this._noScroll?e.style.overflow="hidden":this._wrapMode?(e.style.overflowX="hidden",e.style.overflowY="scroll"):e.style.overflow="hidden"},_updateRuler:function(e,t,n,i){if(e)for(var r=this._parent.ownerDocument,o=this._getLineHeight(),a=this._getViewPadding(),l=e.firstChild;l;){var d=l._ruler,c=d.getOverview();if(l.rulerChanged&&(h(d.getRulerStyle(),l),e.rulerWidth=void 0),"fixed"!==c){var u=o;"page"===c&&(u+=this._topIndexY),l.style.top=-u+"px",l.style.height=i+u+"px";var f,p=l.firstChild;p?(f=p,p=p.nextSibling):(f=s.createElement(r,"div"),f.style.visibility="hidden",l.appendChild(f));var g,v;l.rulerChanged&&f&&(g=-1,v=d.getWidestAnnotation(),v&&(h(v.style,f),v.html&&(f.innerHTML=v.html)),f.lineIndex=g,f.style.height=o+a.top+"px");var m,_,y;if("page"===c){for(y=d.getAnnotations(t,n+1);p;){g=p.lineIndex;var C=p.nextSibling;g>=t&&n>=g&&!p.lineChanged||l.removeChild(p),p=C}for(p=l.firstChild.nextSibling,_=r.createDocumentFragment(),g=t;n>=g;g++)!p||p.lineIndex>g?(m=s.createElement(r,"div"),v=y[g],v&&(h(v.style,m),v.html&&(m.innerHTML=v.html),m.annotation=v),m.lineIndex=g,m.style.height=this._getLineHeight(g)+"px",_.appendChild(m)):(_.firstChild&&(l.insertBefore(_,p),_=r.createDocumentFragment()),p&&(p=p.nextSibling));_.firstChild&&l.insertBefore(_,p)}else{var w,x,S=this._getClientHeight(),b=this._model.getLineCount(),T=o*b,E=S+a.top+a.bottom-2*this._metrics.scrollWidth;if(E>T?(w=o,x=a.top):(w=E/b,x=this._metrics.scrollWidth),l.rulerChanged){for(var L=l.childNodes.length;L>1;)l.removeChild(l.lastChild),L--;y=d.getAnnotations(0,b),_=r.createDocumentFragment();for(var k in y)g=k>>>0,0>g||(m=s.createElement(r,"div"),v=y[k],h(v.style,m),m.style.position="absolute",m.style.top=x+o+Math.floor(g*w)+"px",v.html&&(m.innerHTML=v.html),m.annotation=v,m.lineIndex=g,_.appendChild(m));l.appendChild(_)}else if(l._oldTrackHeight!==E)for(m=l.firstChild?l.firstChild.nextSibling:null;m;)m.style.top=this._metrics.scrollWidth+o+Math.floor(m.lineIndex*w)+"px",m=m.nextSibling;l._oldTrackHeight=E}l.rulerChanged=!1,l=l.nextSibling}else l.rulerChanged=!1,l=l.nextSibling}},_updateStyleSheet:function(){var e="";if(s.isWebkit&&this._metrics.scrollWidth>0&&(e+="\n.textview ::-webkit-scrollbar-corner {background: #eeeeee;}"),e){var t=this._clientDiv.ownerDocument,n=t.getElementById("_textviewStyle");if(n)n.removeChild(n.firstChild),n.appendChild(t.createTextNode(e));else{n=s.createElement(t,"style"),n.id="_textviewStyle";var i=t.getElementsByTagName("head")[0]||t.documentElement;n.appendChild(t.createTextNode(e)),i.insertBefore(n,i.firstChild)}}},_updateStyle:function(e,t){if(!e&&s.isIE&&(this._rootDiv.style.lineHeight="normal"),t=this._metrics=t||this._calculateMetrics(),this._variableLineHeight&&(this._variableLineHeight=!1,this._resetLineHeight()),this._rootDiv.style.lineHeight=s.isIE?t.lineHeight-(t.lineTrim.top+t.lineTrim.bottom)+"px":"normal",this._updateStyleSheet(),s.isMac&&s.isWebkit){var n=this._viewDiv;t.invalid||0!==t.scrollWidth?(n.style.pointerEvents="",n.style.zIndex=""):(n.style.pointerEvents="none",n.style.zIndex="2")}e||(this.redraw(),this._resetLineWidth())}},i.EventTarget.addMixin(S.prototype),{TextView:S}}),define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(e,t){function n(e){this._model=e,this._projections=[];var t=this;this._listener={onChanged:function(e){t._onChanged(e)},onChanging:function(e){t._onChanging(e)}},e.addEventListener("postChanged",this._listener.onChanged),e.addEventListener("preChanging",this._listener.onChanging)}return n.prototype={destroy:function(){this._model&&(this._model.removeEventListener("postChanged",this._listener.onChanged),this._model.removeEventListener("preChanging",this._listener.onChanging),this._model=null)},addProjection:function(t){if(t){var n=this._model,i=this._projections;t._lineIndex=n.getLineAtOffset(t.start),t._lineCount=n.getLineAtOffset(t.end)-t._lineIndex;var r=t.text;r||(r=""),t._model="string"==typeof r?new e.TextModel(r,n.getLineDelimiter()):r;var o=this.mapOffset(t.start,!0),s=t.end-t.start,a=t._lineCount,l=t._model.getCharCount(),d=t._model.getLineCount()-1,h={type:"Changing",text:t._model.getText(),start:o,removedCharCount:s,addedCharCount:l,removedLineCount:a,addedLineCount:d};this.onChanging(h);var c=this._binarySearch(i,t.start);i.splice(c,0,t);var u={type:"Changed",start:o,removedCharCount:s,addedCharCount:l,removedLineCount:a,addedLineCount:d};this.onChanged(u)}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(e,t){var n,i,r=this._projections,o=0;if(t){for(n=0;ne));n++){if(i.end>e)return-1;o+=i._model.getCharCount()-(i.end-i.start)}return e+o}for(n=0;ne-o));n++){var s=i._model.getCharCount();if(i.start+s>e-o)return-1;o+=s-(i.end-i.start)}return e-o},removeProjection:function(e){this._removeProjection(e)},_removeProjection:function(e,t){var n,i=0;for(n=0;n1;)n=Math.floor((i+r)/2),t<=e[n].start?i=n:r=n;return i},getCharCount:function(){for(var e=this._model.getCharCount(),t=this._projections,n=0;ne)return null;var n,i,r,o=this._model,s=this._projections,a=0,l=[],d=0;for(n=0;n=e-a));n++){if(i=r._model.getLineCount()-1,r._lineIndex+i>=e-a){var h=e-(r._lineIndex+a);if(i>h)return r._model.getLine(h,t);l.push(r._model.getLine(i))}d=r.end,a+=i-r._lineCount}for(d=Math.max(d,o.getLineStart(e-a));ne-a));n++){if(l.push(o.getText(d,r.start)),i=r._model.getLineCount()-1,r._lineIndex+i>e-a)return l.push(r._model.getLine(0,t)),l.join("");l.push(r._model.getText()),d=r.end,a+=i-r._lineCount}var c=o.getLineEnd(e-a,t);return c>d&&l.push(o.getText(d,c)),l.join("")},getLineAtOffset:function(e){for(var t=this._model,n=this._projections,i=0,r=0,o=0;oe-i)break;var a=s._model.getCharCount();if(s.start+a>e-i){var l=e-(s.start+i);r+=s._model.getLineAtOffset(l),i+=l;break}r+=s._model.getLineCount()-1-s._lineCount,i+=a-(s.end-s.start)}return t.getLineAtOffset(e-i)+r},getLineCount:function(){for(var e=this._model,t=this._projections,n=e.getLineCount(),i=0;ie)return-1;for(var n=this._model,i=this._projections,r=0,o=0,s=0;se-r)break;var l=a._model.getLineCount()-1;if(a._lineIndex+l>e-r){var d=e-(a._lineIndex+r);return a._model.getLineEnd(d,t)+a.start+o}o+=a._model.getCharCount()-(a.end-a.start),r+=l-a._lineCount}return n.getLineEnd(e-r,t)+o},getLineStart:function(e){if(0>e)return-1;for(var t=this._model,n=this._projections,i=0,r=0,o=0;o=e-i)break;var a=s._model.getLineCount()-1;if(s._lineIndex+a>=e-i){var l=e-(s._lineIndex+i);return s._model.getLineStart(l)+s.start+r}r+=s._model.getCharCount()-(s.end-s.start),i+=a-s._lineCount}return t.getLineStart(e-i)+r},getText:function(e,t){void 0===e&&(e=0);var n,i,r,o=this._model,s=this._projections,a=0,l=[];for(n=0;ne-a));n++){if(r=i._model.getCharCount(),i.start+r>e-a){if(void 0!==t&&i.start+r>t-a)return i._model.getText(e-(i.start+a),t-(i.start+a));l.push(i._model.getText(e-(i.start+a))),e=i.end+a+r-(i.end-i.start)}a+=r-(i.end-i.start)}var d=e-a;if(void 0!==t){for(;nt-a));n++){if(l.push(o.getText(d,i.start)),r=i._model.getCharCount(),i.start+r>t-a)return l.push(i._model.getText(0,t-(i.start+a))),l.join("");l.push(i._model.getText()),d=i.end,a+=r-(i.end-i.start)}l.push(o.getText(d,t-a))}else{for(;ni));e++);var s=e;for(e=0;e=r));e++);var a=e,l=this._model,d=n.baseText.length-(r-i);for(e=a;ee));a++){if(l.end>e)return-1;s+=l._model.getCharCount()-(l.end-l.start)}return e+s}var n=!!this._change,i=this._change||{},r=e.start,o=r+e.removedCharCount;if(i.baseStart=r,i.baseEnd=o,i.baseText=e.text,i.addedLineCount=e.addedLineCount,!n){this._change=i,i.text=e.text;var s,a,l,d=this._projections;i.start=t(r),-1===i.start&&(i.text=this._model.getText(l.start,r)+i.text,i.addedLineCount+=this._model.getLineAtOffset(r)-this._model.getLineAtOffset(l.start),i.start=l.start+s),i.end=t(o),-1===i.end&&(i.text+=this._model.getText(o,l.end),i.addedLineCount+=this._model.getLineAtOffset(l.end)-this._model.getLineAtOffset(o),i.end=l.start+s)}i.addedCharCount=i.text.length,i.removedCharCount=i.end-i.start,i.removedLineCount=this.getLineAtOffset(i.end)-this.getLineAtOffset(i.start);var h={type:"Changing",text:i.text,start:i.start,removedCharCount:i.removedCharCount,addedCharCount:i.addedCharCount,removedLineCount:i.removedLineCount,addedLineCount:i.addedLineCount};this.onChanging(h)},onChanging:function(e){return this.dispatchEvent(e)},onChanged:function(e){return this.dispatchEvent(e)},setLineDelimiter:function(e){this._model.setLineDelimiter(e)},setText:function(e,t,n){function i(e){for(o=0,r=0;oe-r));o++){var t=s._model.getCharCount();if(s.start+t>e-r)return-1;r+=t-(s.end-s.start)}return e-r}this._change={text:e||"",start:t||0,end:void 0===n?this.getCharCount():n};var r,o,s,a,l,d=this._projections,h=i(this._change.start);-1===h&&(a={projection:s,start:this._change.start-(s.start+r)},h=s.end);var c=i(this._change.end);-1===c&&(l={projection:s,end:this._change.end-(s.start+r)},c=s.start),a&&l&&a.projection===l.projection?s._model.setText(this._change.text,a.start,l.end):(this._model.setText(this._change.text,h,c),a&&(s=a.projection,s._model.setText("",a.start)),l&&(s=l.projection,s._model.setText("",0,l.end),s.start=s.end,s._lineCount=0)),this._change=void 0}},t.EventTarget.addMixin(n.prototype),{ProjectionTextModel:n}}),define("orion/editor/tooltip",["i18n!orion/editor/nls/messages","orion/editor/textView","orion/editor/projectionTextModel","orion/Deferred","orion/editor/util","orion/webui/littlelib","orion/util"],function(e,t,n,i,r,o,s){function a(e){this._view=e;var t=e.getOptions("parent");this._create(t?t.ownerDocument:document)}return a.getTooltip=function(e){return e._tooltip||(e._tooltip=new a(e)),e._tooltip},a.prototype={_create:function(e){if(!this._tooltipDiv){var t=this._tooltipDiv=s.createElement(e,"div");t.tabIndex=0,t.className="textviewTooltip",t.setAttribute("aria-live","assertive"),t.setAttribute("aria-atomic","true"),this._tooltipDiv.style.visibility="hidden",this._tipShowing=!1,e.body.appendChild(t);var n=this;r.addEventListener(e,"mousedown",this._mouseDownHandler=function(e){n.isVisible()&&(r.contains(t,e.target||e.srcElement)||n._locked||n.hide())},!0),r.addEventListener(e,"scroll",this._scrollHandler=function(){n.isVisible()&&(n._topPixel!==n._view.getTopPixel()||n._leftPixel!==n._view.getHorizontalPixel())&&n.hide()},!0),r.addEventListener(e,"mousemove",this._mouseMoveHandler=function(e){n._prevX&&n._prevX===e.clientX&&n._prevY&&n._prevY===e.clientY||(n._prevX=e.clientX,n._prevY=e.clientY,!n.isVisible()||n._locked||n._hasFocus()||n._isInRect(n._outerArea,e.clientX,e.clientY)||n.hide())},!0),r.addEventListener(t,"focus",function(){n._locked||n._tooltipDiv.classList.add("textViewTooltipOnFocus")},!1),r.addEventListener(t,"blur",function(){n._tooltipDiv.classList.remove("textViewTooltipOnFocus")},!1),r.addEventListener(t,"mouseenter",function(){n._locked||n._tooltipDiv.classList.add("textViewTooltipOnHover")},!1),r.addEventListener(t,"mouseleave",function(){n._hasFocus()||n._tooltipDiv.classList.remove("textViewTooltipOnHover")},!1),r.addEventListener(t,"keydown",function(e){27===e.keyCode&&(n._locked||n.hide())},!1),this._view.addEventListener("Destroy",function(){n.destroy()})}},destroy:function(){if(this._tooltipDiv){this.hide();var e=this._tooltipDiv.parentNode;e&&e.removeChild(this._tooltipDiv);var t=this._tooltipDiv.ownerDocument;r.removeEventListener(t,"mousedown",this._mouseDownHandler,!0),r.removeEventListener(t,"scroll",this._scrollHandler,!0),r.removeEventListener(t,"mousemove",this._mouseMoveHandler,!0),this._tooltipDiv=null}},show:function(e,t,n){this._locked=t,this._giveFocus=n,this._topPixel=this._view.getTopPixel(),this._leftPixel=this._view.getHorizontalPixel(),this._processInfo(e.getTooltipInfo())},update:function(e,t){e&&(t?this._showContents(null,e.getTooltipInfo(),!0):this._processInfo(e.getTooltipInfo(),!0))},onHover:function(e,t,n){e&&(this._isInRect(this._anchorArea,t,n)||this._isInRect(this._tooltipArea,t,n)||this._locked||this._hasFocus()||this._processInfo(e.getTooltipInfo()))},hide:function(e){e&&(this._locked=void 0),!this._locked&&this.isVisible()&&(this.hover&&this.hover.clearQuickFixes(),this._hasFocus()&&this._view.focus(),this._tooltipContents&&(this._tooltipDiv.removeChild(this._tooltipContents),this._tooltipContents=null),this._tooltipDiv.classList.remove("textviewTooltipCodeProjection"),this._tooltipDiv.classList.remove("textviewTooltipOnHover"),this._tooltipDiv.classList.remove("textviewTooltipOnFocus"),this._tooltipDiv.style.visibility="hidden",this._tipShowing=!1,this._tooltipDiv.style.left="",this._tooltipDiv.style.right="",this._tooltipDiv.style.top="",this._tooltipDiv.style.bottom="",this._tooltipDiv.style.width="auto",this._tooltipDiv.style.maxWidth="",this._tooltipDiv.style.height="auto",this._tooltipDiv.style.maxHeight="",this._tooltipDiv.style.overflowX="",this._tooltipDiv.style.overflowY="",this._giveFocus=void 0,this._anchorArea=void 0,this._tooltipArea=void 0,this._outerArea=void 0,this._hoverPromises&&this._hoverPromises.forEach(function(e){e.resolved||e.cancel()}),this._hoverPromises=void 0,this._tipRect=void 0)},isVisible:function(){return this._tipShowing},_processInfo:function(e,t){if(this._tooltipDiv){var n;if(t&&this._tooltipContents?(this._tooltipContents.innerHTML="",n=this._tooltipContents):n=s.createElement(this._tooltipDiv.ownerDocument,"div"),e){if(e.contents&&this._renderImmediateInfo(n,e.contents,e.context))return this._showContents(n,e,t),!0;if(this.hover&&e.context&&(this._hoverPromises=this.hover.computeHoverInfo(e.context),this._hoverPromises)){var r=this,o=this._hoverPromises.slice(0);return o.forEach(function(o){i.when(o,function(i){if(r._hoverPromises){var s=r._hoverPromises.indexOf(o);s>=0&&r._hoverPromises.splice(s,1)}i&&r._renderPluginContent(n,i)&&(i.offsetStart&&(e.context.offsetStart=i.offsetStart),i.offsetEnd&&(e.context.offsetEnd=i.offsetEnd),i.allowFullWidth&&(e.allowFullWidth=i.allowFullWidth),r._showContents(n,e,t))},function(e){console&&e&&"Cancel"!==e.name&&(console.log("Error computing hover tooltip"),console.log(e&&e.stack))})}),!0}}}},_showContents:function(e,t,n){n?this._tooltipArea&&t.tooltipArea&&(this._tooltipArea.left!==t.tooltipArea.left||this._tooltipArea.top!==t.tooltipArea.top||this._tooltipArea.width!==t.tooltipArea.width||this._tooltipArea.height!==t.tooltipArea.height)&&(this._anchorArea=null,this._tooltipArea=null,this._outerArea=null):this.hide(),e&&(this._tooltipContents&&this._tooltipDiv.removeChild(this._tooltipContents),this._tooltipContents=e,this._tooltipDiv.appendChild(e)),this._anchorArea||(this._anchorArea=this._computeAnchorArea(t)),this._tooltipArea||(this._tooltipArea=this._computeTooltipArea(t,this._anchorArea,this._tooltipDiv)),this._outerArea||(this._outerArea=this._computeOuterArea(this._anchorArea,this._tooltipArea)),this._tooltipDiv.style.visibility="visible",this._tipShowing=!0,this._giveFocus&&(this._setInitialFocus(this._tooltipDiv),this._giveFocus=void 0)},_computeAnchorArea:function(e){if(e.anchorArea&&e.anchorArea.top&&e.anchorArea.left&&e.anchorArea.height&&e.anchorArea.width)return e.anchorArea;if(e.context){if(e.context.offsetStart&&e.context.offsetEnd){var t=this.mapOffset(e.context.offsetStart,!1),n=this.mapOffset(e.context.offsetEnd,!1);return this._computeRectangleFromOffset(t,n)}if(e.context.offset>=0){var i=this.mapOffset(e.context.offset,!1),r=this._view.getNextOffset(i,{unit:"wordend",count:0}),o=this._view.getNextOffset(r,{unit:"word",count:-1});return this._computeRectangleFromOffset(o,r)}}return{top:0,left:0,height:0,width:0}},_computeTooltipArea:function(e,t,n){var i=n.ownerDocument.documentElement,r=16;if(e.tooltipArea&&e.tooltipArea.top&&e.tooltipArea.left&&e.tooltipArea.height&&e.tooltipArea.width)return n.style.overflowY="auto",n.style.resize="none",n.style.top=e.tooltipArea.top+"px",n.style.left=e.tooltipArea.left+"px",n.style.height=e.tooltipArea.height-r+"px",n.style.width=e.tooltipArea.width-r+"px",e.tooltipArea;var o=n.getBoundingClientRect(),s={width:o.width,height:o.height},a=n.getElementsByTagName("img")[0];a&&!a.complete&&0===a.width&&(s.width+=30);var l=e.position?e.position:"below",d=(this._view._rootDiv?this._view._rootDiv:i).getBoundingClientRect(),h=d.left,c=d.top,u=d.width,f=d.height,p=u,g=f;e.allowFullWidth||(p=Math.min(u/2,600),g=Math.min(f/2,400),s.width=Math.min(s.width,p),s.height=Math.min(s.height,g)),n.style.width=s.width-r+"px",s.height=Math.min(n.getBoundingClientRect().height,g),25+r>s.height&&s.width>p-r&&(s.height=40+r);var v=f-(t.top+t.height-c),m=t.top-c,_=u-(t.left+t.width-h);"above"===l&&s.height>m&&s.height<=v?l="below":"below"===l&&s.height>v&&s.height<=m&&(l="above");var y=e.tooltipOffsetX?e.tooltipOffsetX:0,C=e.tooltipOffsetY?e.tooltipOffsetY:0;switch(l){case"left":s.top=s.height+C>v+t.height?f+c-s.height:t.top+C,s.top=Math.max(s.top,c),s.left=Math.max(t.left-s.width+y,h);break;case"right":s.top=s.height+C>v+t.height?f+c-s.height:t.top+C,s.top=Math.max(s.top,c),s.left=Math.max(t.left+t.width+y,h);break;case"above":s.left=s.width+y>_+t.width?u+h-s.width:t.left+y,s.left=Math.max(s.left,h),s.top=Math.max(t.top-s.height+C,c);break;case"below":s.left=s.width+y>_+t.width?u+h-s.width:t.left+y,s.left=Math.max(s.left,h),s.top=Math.max(t.top+t.height+C,c)}return s.maxWidth=Math.min(u+h-s.left,u),s.maxHeight=Math.min(f+c-s.top,f),n.style.maxWidth=s.maxWidth-r+"px",n.style.maxHeight=s.maxHeight-r+"px",n.style.width=s.width-r+"px",n.style.height=s.height-r+"px",n.style.left=s.left+"px",n.style.top=s.top+"px",s},_computeOuterArea:function(e,t){var n=Math.min(e.left,t.left),i=Math.min(e.top,t.top),r=e.left+e.width,o=t.left+t.width,s=Math.max(r,o),a=e.top+e.height,l=t.top+t.height,d=Math.max(a,l);return{left:n,top:i,width:s-n,height:d-i}},_hasFocus:function(){var e=this._tooltipDiv;return e?r.contains(e,e.ownerDocument.activeElement):!1},_isNode:function(e){return"object"==typeof Node?e instanceof Node:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},_setInitialFocus:function(e){var t=o.$("button",e);if(t)return void t.focus();var n=o.$("a",e);if(n){n.focus();var i=this;return void n.addEventListener("click",function(){i.hide()})}var r=o.firstTabbable(e);r&&r.focus()},_isInRect:function(e,t,n){if(!e)return!1;var i=t>=e.left&&t<=e.left+e.width,r=n>=e.top&&n<=e.top+e.height;return i&&r},mapOffset:function(e){var t=this._view,n=t.getModel();return n.getBaseModel&&(e=n.mapOffset(e,!0)),e},_computeRectangleFromOffset:function(e,t){var n=this._view,i=n.getLineAtOffset(e),r=n.getLineAtOffset(t);i!==r&&(t=n.getModel().getLineEnd(i));var o=n.getLineHeight(i),s=n.getLocationAtOffset(e),a=n.getLocationAtOffset(t),l={x:s.x,y:s.y,width:a.x-s.x,height:o};return l=this._view.convert(l,"document","page"),{left:l.x,top:l.y,width:l.width,height:l.height}},_renderPluginContent:function(e,t){var n=this._tooltipDiv.ownerDocument;if("string"!=typeof t&&"undefined"==typeof t.content)return!1;var i=s.createElement(n,"div");if(t.title){var r=s.createElement(n,"div");r.innerHTML=this.hover.renderMarkDown?this.hover.renderMarkDown(t.title):t.title,r.classList.add("hoverTooltipTitle"),i.appendChild(r)}var o=s.createElement(n,"div");if("string"==typeof t)o.appendChild(n.createTextNode(t));else switch(t.type){case"delegatedUI":case"html":if(t.content){var a=n.createElement("iframe");a.id="HtmlHover",a.name="HTML Hover",a.type="text/html",a.sandbox="allow-scripts allow-same-origin allow-forms",a.style.border="none",a.style.width="100%",a.style.height="100%",this._tooltipDiv.style.paddingBottom="5px",a.srcdoc=t.content,t.width&&(a.style.width=t.width),t.height&&(a.style.height=t.height),i.style.height="100%",e.style.height="100%",i.appendChild(a)}break;case"markdown":this.hover.renderMarkDown&&(o.innerHTML=this.hover.renderMarkDown(t.content));break;default:o.appendChild(n.createTextNode(t.content))}return i.appendChild(o),e.appendChild(i),!0},_renderImmediateInfo:function(e,i,r){if(i instanceof Array&&(i=this._getAnnotationContents(i,r),!i))return!1;if("string"==typeof i)return e.innerHTML=i,!0;if(this._isNode(i))return e.appendChild(i),!0;if(i instanceof n.ProjectionTextModel){var o=this._view,s=o.getOptions();s.wrapMode=!1,s.parent=e;var a="tooltipTheme",l=s.themeClass;l?(l=l.replace(a,""),l&&(l=" "+l),l=a+l):l=a,s.themeClass=l;var d=this._contentsView=new t.TextView(s),h={onLineStyle:function(e){o.onLineStyle(e)}};d.addEventListener("LineStyle",h.onLineStyle),d.setModel(i),this._tooltipDiv.appendChild(e),this._tooltipDiv.classList.add("textviewTooltipCodeProjection");var c=d.computeSize();return e.style.width=c.width+8+"px",e.style.height=c.height+8+"px",d.resize(),this._tooltipDiv.removeChild(e),!0}return!1},_getAnnotationContents:function(t,i){function o(e,t){var n=e.title,o=s.createElement(f,"div");if(o.className="tooltipRow",e.html){var l=s.createElement(f,"div");l.className="tooltipImage",l.innerHTML=e.html,l.lastChild&&r.addEventListener(l.lastChild,"click",function(){var t=e.start,n=e.end;g.getBaseModel&&(t=g.mapOffset(t,!0),n=g.mapOffset(n,!0)),p.setSelection(t,n,1/3,function(){a.hide()})},!1),o.appendChild(l)}if(!n){var d=v.getLineStart(v.getLineAtOffset(e.start)),h=v.getLineEnd(v.getLineAtOffset(e.end),!0);n=v.getText(d,h)}if("function"==typeof n&&(n=e.title()),"string"==typeof n){var c=s.createElement(f,"span");c.className="tooltipTitle",c.appendChild(f.createTextNode(n)),n=c}return o.appendChild(n),t&&a.hover.renderQuickFixes(e,o),i&&(i.offsetStart=e.start,i.offsetEnd=e.end),o}var a=this,l=a.hover?!0:!1;l&&i&&i.source&&i.source.indexOf("ruler")>=0&&t.length>1&&(l=!1);for(var d,h=[],c=0;c0&&m.addProjection({start:0,end:_}),m}if(1===t.length){if(u=o(t[0],l),u&&u.firstChild){var C=u.firstChild.className;C&&(C+=" "),C+="single",u.firstChild.className=C}return u}var w=s.createElement(f,"div"),x=s.createElement(f,"multi_anno");x.appendChild(f.createTextNode(e.multipleAnnotations)),w.appendChild(x);for(var S=0;S",overviewStyle:{styleClass:"annotationOverview "+o}};i?s.lineStyle={styleClass:"annotationLine "+o}:s.rangeStyle={styleClass:"annotationRange "+o},n.registerType(t,s)}function o(){}function s(e,t,n,i,r){var o;for(void 0===i&&(i=-1),void 0===r&&(r=e.length);r-i>1;)if(o=Math.floor((r+i)/2),t<=e[o].start)r=o;else{if(n&&t",_expandedStyle:{styleClass:"annotation expanded"},_collapsedHTML:"
",_collapsedStyle:{styleClass:"annotation collapsed"},_collapse:function(){return this.expanded?(this.expanded=!1,this.html=this._collapsedHTML,this.style=this._collapsedStyle,this._annotationModel&&this._annotationModel.modifyAnnotation(this),!0):!1},_expand:function(){return this.expanded?!1:(this.expanded=!0,this.html=this._expandedHTML,this.style=this._expandedStyle,this._annotationModel&&this._annotationModel.modifyAnnotation(this),!0)},_collapseImpl:function(e){if(this._collapse()){e&&this._forEachOverlaping(function(e){e.expanded||(e._expandImpl(!1),e._recollapse=!0)});var t=this._projectionModel,n=t.getBaseModel();this._projection={annotation:this,start:n.getLineStart(n.getLineAtOffset(this.start)+1),end:n.getLineEnd(n.getLineAtOffset(this.end),!0)},t.addProjection(this._projection)}},_expandImpl:function(e){this._expand()&&(this._projectionModel._removeProjection(this._projection,!this._annotationModel),e&&this._forEachOverlaping(function(e){e._recollapse&&(e._collapseImpl(!1),e._recollapse=!1)}))},_forEachOverlaping:function(e){if(this._annotationModel)for(var t=this._annotationModel.getAnnotations(this.start,this.end);t.hasNext();){var i=t.next();i!==this&&i.type===n.ANNOTATION_FOLDING&&e.call(this,i)}},collapse:function(){this._recollapse=!1,this._collapseImpl(!0)},expand:function(){this._recollapse=!1,this._expandImpl(!0)}},n.ANNOTATION_ERROR="orion.annotation.error",n.ANNOTATION_WARNING="orion.annotation.warning",n.ANNOTATION_TASK="orion.annotation.task",n.ANNOTATION_BREAKPOINT="orion.annotation.breakpoint",n.ANNOTATION_BOOKMARK="orion.annotation.bookmark",n.ANNOTATION_FOLDING="orion.annotation.folding",n.ANNOTATION_CURRENT_BRACKET="orion.annotation.currentBracket",n.ANNOTATION_MATCHING_BRACKET="orion.annotation.matchingBracket",n.ANNOTATION_CURRENT_LINE="orion.annotation.currentLine",n.ANNOTATION_CURRENT_SEARCH="orion.annotation.currentSearch",n.ANNOTATION_MATCHING_SEARCH="orion.annotation.matchingSearch",n.ANNOTATION_READ_OCCURRENCE="orion.annotation.readOccurrence",n.ANNOTATION_WRITE_OCCURRENCE="orion.annotation.writeOccurrence",n.ANNOTATION_SELECTED_LINKED_GROUP="orion.annotation.selectedLinkedGroup",n.ANNOTATION_CURRENT_LINKED_GROUP="orion.annotation.currentLinkedGroup",n.ANNOTATION_LINKED_GROUP="orion.annotation.linkedGroup",n.ANNOTATION_BLAME="orion.annotation.blame",n.ANNOTATION_CURRENT_BLAME="orion.annotation.currentBlame",n.ANNOTATION_DIFF_ADDED="orion.annotation.diffAdded",n.ANNOTATION_DIFF_DELETED="orion.annotation.diffDeleted",n.ANNOTATION_DIFF_MODIFIED="orion.annotation.diffModified";var d={};return n.registerType=function(e,t){var n=t;return"function"!=typeof n&&(n=function(e,t,n){this.start=e,this.end=t,void 0!==n&&(this.title=n)},n.prototype=t),n.prototype.type=e,d[e]=n,e},n.createAnnotation=function(e,t,n,i){return new(this.getType(e))(t,n,i)},n.getType=function(e){return d[e]},r(n.ANNOTATION_ERROR),r(n.ANNOTATION_WARNING),r(n.ANNOTATION_TASK),r(n.ANNOTATION_BREAKPOINT),r(n.ANNOTATION_BOOKMARK),r(n.ANNOTATION_CURRENT_BRACKET),r(n.ANNOTATION_MATCHING_BRACKET),r(n.ANNOTATION_CURRENT_SEARCH),r(n.ANNOTATION_MATCHING_SEARCH),r(n.ANNOTATION_READ_OCCURRENCE),r(n.ANNOTATION_WRITE_OCCURRENCE),r(n.ANNOTATION_SELECTED_LINKED_GROUP),r(n.ANNOTATION_CURRENT_LINKED_GROUP),r(n.ANNOTATION_LINKED_GROUP),r(n.ANNOTATION_CURRENT_LINE,!0),r(n.ANNOTATION_BLAME,!0),r(n.ANNOTATION_CURRENT_BLAME,!0),r(n.ANNOTATION_DIFF_ADDED),r(n.ANNOTATION_DIFF_DELETED),r(n.ANNOTATION_DIFF_MODIFIED),n.registerType(n.ANNOTATION_FOLDING,i),o.addMixin=function(e){var t=o.prototype;for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},o.prototype={addAnnotationType:function(e,t){this._annotationTypes||(this._annotationTypes=[]);var n=t-1;void 0!=t&&n>=0&&nn.start?e=t)break}return null},n=i(),{next:function(){var e=n;return e&&(n=i()),e},hasNext:function(){return null!==n}}},modifyAnnotation:function(e){if(e){var t=this._getAnnotationIndex(e);if(!(0>t)){var n={type:"Changed",added:[],removed:[],changed:[e]};this.onChanged(n)}}},onChanged:function(e){return this.dispatchEvent(e)},removeAnnotations:function(e){var t,n,i=this._annotations;if(e)for(t=[],n=i.length-1;n>=0;n--){var r=i[n];r.type===e&&(i.splice(n,1),t.splice(0,0,r),r._annotationModel=null)}else t=i,i=[];var o={type:"Changed",removed:t,added:[],changed:[]};this.onChanged(o)},removeAnnotation:function(e){if(e){var t=this._getAnnotationIndex(e);if(!(0>t)){e._annotationModel=null;var n={type:"Changed",removed:this._annotations.splice(t,1),added:[],changed:[]};this.onChanged(n)}}},replaceAnnotations:function(e,t){var n,i,r,o=this._annotations,a=[];if(e)for(n=e.length-1;n>=0;n--)r=e[n],i=this._getAnnotationIndex(r),0>i||(r._annotationModel=null,o.splice(i,1),a.splice(0,0,r));for(t||(t=[]),n=0;n=0&&s=o?(h._oldStart=h.start,h._oldEnd=h.end,h.start+=d,h.end+=d,l.changed.push(h)):h.end<=t||(h.start0||l.removed.length>0||l.changed.length>0)&&this.onChanged(l)}}},t.EventTarget.addMixin(a.prototype),l.prototype={destroy:function(){var e=this._view;e&&(e.removeEventListener("Destroy",this._listener.onDestroy),e.removeEventListener("LineStyle",this._listener.onLineStyle),this.view=null);var t=this._annotationModel;t&&(t.removeEventListener("Changed",this._listener.onChanged),t=null)},_mergeStyle:function(e,t){if(t){e||(e={}),e.styleClass&&t.styleClass&&e.styleClass!==t.styleClass?e.styleClass+=" "+t.styleClass:e.styleClass=t.styleClass;var n;if(t.tagName&&(e.tagName||(e.tagName=t.tagName)),t.style){e.style||(e.style={});for(n in t.style)e.style[n]||(e.style[n]=t.style[n])}if(t.attributes){e.attributes||(e.attributes={});for(n in t.attributes)e.attributes[n]||(e.attributes[n]=t.attributes[n])}}return e},_mergeStyleRanges:function(e,t){e||(e=[]);for(var n,i=s(e,t.start,!0);i=r.end)){n=this._mergeStyle({},r.style),n=this._mergeStyle(n,t.style);var o=[];o.push(i,1),t.startr.start&&o.push({start:r.start,end:t.start,style:r.style}),o.push({start:Math.max(r.start,t.start),end:Math.min(r.end,t.end),style:n}),t.endr.end?{start:r.end,end:t.end,style:t.style}:null,Array.prototype.splice.apply(e,o)}}return t&&(n=this._mergeStyle({},t.style),e.splice(i,0,{start:t.start,end:t.end,style:n})),e},_onAnnotationModelChanged:function(e){function t(e,t){o.getBaseModel&&(e=o.mapOffset(e,!0),t=o.mapOffset(t,!0)),-1!==e&&-1!==t&&i.redrawRange(e,t)}function n(e,n){for(var i=0;i>0,p=s.getLineStart(f),g=s.getLineEnd(f);s.getBaseModel&&(p=s.mapOffset(p),g=s.mapOffset(g));var v=l.ANNOTATION_CURRENT_LINE,m=l.createAnnotation(v,p,g);c.push(m)}this._currentLineAnnotations=c,r.replaceAnnotations(h,c)}}}},installTextView:function(){this.install()},install:function(){if(!this._textView){if(this._textView=this._textViewFactory(),this._undoStackFactory&&(this._undoStack=this._undoStackFactory.createUndoStack(this),this._textView.setOptions({undoStack:this._undoStack}),this.checkDirty()),this._textDNDFactory&&(this._textDND=this._textDNDFactory.createTextDND(this,this._undoStack)),this._contentAssistFactory){var e=this._contentAssistFactory.createContentAssistMode(this);this._contentAssist=e.getContentAssist()}var t=n.Tooltip.getTooltip(this._textView);this._hoverFactory&&(this._hover=this._hoverFactory.createHover(this),t.hover=this._hover);var i=this,r=this._textView,o=this;if(this._listener={onModelChanged:function(){o.checkDirty()},onMouseOver:function(e){o._listener.onMouseMove(e)},onMouseDown:function(){o._listener.mouseDown=!0},onMouseUp:function(){o._listener.mouseDown=!1},onMouseMove:function(e){t&&!o._listener.mouseDown&&(e.event.clientX!==o._listener.lastMouseX||e.event.clientY!==o._listener.lastMouseY)&&(o._listener.lastMouseX=e.event.clientX,o._listener.lastMouseY=e.event.clientY,o._hoverTimeout&&(window.clearTimeout(o._hoverTimeout),o._hoverTimeout=null),o._hoverTimeout=window.setTimeout(function(){o._hoverTimeout=null,o._listener&&t.onHover({y:e.y,x:e.x,getTooltipInfo:function(){return o._getTooltipInfo(this.x,this.y)}},e.x,e.y)},175))},onMouseOut:function(){o._hoverTimeout&&(window.clearTimeout(o._hoverTimeout),o._hoverTimeout=null)},onSelection:function(e){t&&t.hide(),o._updateCursorStatus(),o._highlightCurrentLine(e.newValue,e.oldValue)}},r.addEventListener("ModelChanged",this._listener.onModelChanged),r.addEventListener("Selection",this._listener.onSelection),r.addEventListener("MouseOver",this._listener.onMouseOver),r.addEventListener("MouseOut",this._listener.onMouseOut),r.addEventListener("MouseDown",this._listener.onMouseDown),r.addEventListener("MouseUp",this._listener.onMouseUp),r.addEventListener("MouseMove",this._listener.onMouseMove),this._keyBindingFactory){var a;a="function"==typeof this._keyBindingFactory?this._keyBindingFactory(this,this.getKeyModes(),this._undoStack,this._contentAssist):this._keyBindingFactory.createKeyBindings(i,this._undoStack,this._contentAssist),a&&(this._textActions=a.textActions,this._linkedMode=a.linkedMode,this._sourceCodeActions=a.sourceCodeActions)}var h=function(e){if(void 0!==e&&-1!==e){for(var t=this.getView(),n=t.getModel(),r=this.getAnnotationModel(),o=i.mapOffset(n.getLineStart(e)),s=i.mapOffset(n.getLineEnd(e)),a=r.getAnnotations(o,s),d=null;a.hasNext();){var h=a.next();if(h.type===l.ANNOTATION_BOOKMARK){d=h;break}}d?r.removeAnnotation(d):(d=l.createAnnotation(l.ANNOTATION_BOOKMARK,o,s,i.getText(o,s)),r.addAnnotation(d))}};if(this._annotationFactory){var c=r.getModel();if(c.getBaseModel&&(c=c.getBaseModel()),this._annotationModel=this._annotationFactory.createAnnotationModel(c),this._annotationModel){var u=this._annotationStyler=this._annotationFactory.createAnnotationStyler(r,this._annotationModel);u&&(u.addAnnotationType(l.ANNOTATION_CURRENT_SEARCH),u.addAnnotationType(l.ANNOTATION_MATCHING_SEARCH),u.addAnnotationType(l.ANNOTATION_ERROR),u.addAnnotationType(l.ANNOTATION_WARNING),u.addAnnotationType(l.ANNOTATION_MATCHING_BRACKET),u.addAnnotationType(l.ANNOTATION_CURRENT_BRACKET),u.addAnnotationType(l.ANNOTATION_CURRENT_LINE),u.addAnnotationType(l.ANNOTATION_READ_OCCURRENCE),u.addAnnotationType(l.ANNOTATION_WRITE_OCCURRENCE),u.addAnnotationType(l.ANNOTATION_SELECTED_LINKED_GROUP),u.addAnnotationType(l.ANNOTATION_CURRENT_LINKED_GROUP),u.addAnnotationType(l.ANNOTATION_LINKED_GROUP),u.addAnnotationType(d))}var f=this._annotationFactory.createAnnotationRulers(this._annotationModel),p=this._annotationRuler=f.annotationRuler;p&&(p.onDblClick=h,p.setMultiAnnotationOverlay({html:"
"}),p.addAnnotationType(l.ANNOTATION_ERROR),p.addAnnotationType(l.ANNOTATION_WARNING),p.addAnnotationType(l.ANNOTATION_TASK),p.addAnnotationType(l.ANNOTATION_BOOKMARK),p.addAnnotationType(l.ANNOTATION_DIFF_ADDED),p.addAnnotationType(l.ANNOTATION_DIFF_DELETED),p.addAnnotationType(l.ANNOTATION_DIFF_MODIFIED)),this.setAnnotationRulerVisible(this._annotationRulerVisible||void 0===this._annotationRulerVisible,!0),p=this._overviewRuler=f.overviewRuler,p&&(p.addAnnotationType(l.ANNOTATION_CURRENT_SEARCH),p.addAnnotationType(l.ANNOTATION_MATCHING_SEARCH),p.addAnnotationType(l.ANNOTATION_READ_OCCURRENCE),p.addAnnotationType(l.ANNOTATION_WRITE_OCCURRENCE),p.addAnnotationType(l.ANNOTATION_CURRENT_BLAME),p.addAnnotationType(l.ANNOTATION_ERROR),p.addAnnotationType(l.ANNOTATION_WARNING),p.addAnnotationType(l.ANNOTATION_TASK),p.addAnnotationType(l.ANNOTATION_BOOKMARK),p.addAnnotationType(l.ANNOTATION_MATCHING_BRACKET),p.addAnnotationType(l.ANNOTATION_CURRENT_BRACKET),p.addAnnotationType(l.ANNOTATION_CURRENT_LINE),p.addAnnotationType(l.ANNOTATION_DIFF_ADDED),p.addAnnotationType(l.ANNOTATION_DIFF_DELETED),p.addAnnotationType(l.ANNOTATION_DIFF_MODIFIED)),this.setOverviewRulerVisible(this._overviewRulerVisible||void 0===this._overviewRulerVisible,!0)}this._zoomRulerFactory&&(this._zoomRuler=this._zoomRulerFactory.createZoomRuler(this._annotationModel),this.setZoomRulerVisible(this._zoomRulerVisible,!0)),this._lineNumberRulerFactory&&(this._lineNumberRuler=this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel),this._lineNumberRuler.addAnnotationType(l.ANNOTATION_CURRENT_BLAME),this._lineNumberRuler.addAnnotationType(l.ANNOTATION_BLAME),this._lineNumberRuler.addAnnotationType(l.ANNOTATION_DIFF_ADDED),this._lineNumberRuler.addAnnotationType(l.ANNOTATION_DIFF_MODIFIED),this._lineNumberRuler.addAnnotationType(l.ANNOTATION_DIFF_DELETED),this._lineNumberRuler.onDblClick=h,this.setLineNumberRulerVisible(this._lineNumberRulerVisible||void 0===this._lineNumberRulerVisible,!0)),this._foldingRulerFactory&&(this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel),this._foldingRuler.addAnnotationType(l.ANNOTATION_FOLDING),this.setFoldingRulerVisible(this._foldingRulerVisible||void 0===this._foldingRulerVisible,!0));var g={type:"TextViewInstalled",textView:r};this.dispatchEvent(g),s.prototype.install.call(this)}},uninstallTextView:function(){this.uninstall()},uninstall:function(){var e=this._textView;if(e){e.destroy(),this._annotationModel&&this._annotationModel.setTextModel(null),this._textView=this._undoStack=this._textDND=this._contentAssist=this._listener=this._annotationModel=this._annotationStyler=this._annotationRuler=this._overviewRuler=this._zoomRuler=this._lineNumberRuler=this._foldingRuler=this._currentLineAnnotations=this._title=null,this._dirty=!1,this._foldingRulerVisible=this._overviewRulerVisible=this._zoomRulerVisible=this._lineNumberRulerVisible=this._annotationRulerVisible=void 0;var t={type:"TextViewUninstalled",textView:e};this.dispatchEvent(t),s.prototype.uninstall.call(this)}},_updateCursorStatus:function(){for(var t=this.getKeyModes(),n=0;n1)r=o.formatMessage(e.multiSelections,a.length);else{var l=a[0].getCaret(),d=s.getLineAtOffset(l),h=s.getLineStart(d),c=l-h;r=o.formatMessage(e.lineColumn,d+1,c+1)}this.reportStatus(r)},showAnnotations:function(e,t,n,i){var r=this._annotationModel;if(r){for(var o,s=[],a=[],d=r.getTextModel(),h=r.getAnnotations();h.hasNext();)o=h.next(),-1!==t.indexOf(o.type)&&o.creatorID===this&&s.push(o);if(e)for(var c=0;c ',s.blame=e,s})},showDiffAnnotations:function(e){this.showAnnotations(e,[l.ANNOTATION_DIFF_ADDED,l.ANNOTATION_DIFF_MODIFIED,l.ANNOTATION_DIFF_DELETED],null,function(e){return"added"===e.type?l.ANNOTATION_DIFF_ADDED:"modified"===e.type?l.ANNOTATION_DIFF_MODIFIED:l.ANNOTATION_DIFF_DELETED})},showSelection:function(e,t,n,i,r){if("number"==typeof e)return"number"!=typeof t&&(t=e),this.moveSelection(e,t),!0;if("number"==typeof n){var o=this.getModel(),s=o.getLineStart(n-1);return"number"==typeof i&&(s+=i),"number"!=typeof r&&(r=0),this.moveSelection(s,s+r),!0}return!1},_setModelText:function(e){this._textView&&(this._textView.setText(e),this._textView.getModel().setLineDelimiter("auto"),this._highlightCurrentLine(this._textView.getSelections()))},setInput:function(e,t,n,i,r){s.prototype.setInput.call(this,e,t,n,i),!this._textView||i||r||this._textView.focus()},onGotoLine:function(e,t,n,i){if(this._textView){var r=this.getModel();e=Math.max(0,Math.min(e,r.getLineCount()-1));var o=r.getLineStart(e),s=0;if(void 0===n&&(n=0),"string"==typeof t){var a=r.getLine(e).indexOf(t);-1!==a&&(s=a,n=s+t.length)}else{s=t;var l=r.getLineEnd(e)-o;s=Math.min(s,l),n=Math.min(n,l)}this.moveSelection(o+s,o+n,i)}}}),{BaseEditor:s,Editor:a}}),define("orion/editor/find",["i18n!orion/editor/nls/messages","orion/keyBinding","orion/editor/keyModes","orion/editor/annotations","orion/regex","orion/objects","orion/util"],function(e,t,n,i,r,o,s){function a(e){var t=e.getTextView();n.KeyMode.call(this,t),this.editor=e,this._active=!1,this._success=!0,this._ignoreSelection=!1,this._prefix="",t.setAction("incrementalFindCancel",function(){return this.setActive(!1),!0}.bind(this)),t.setAction("incrementalFindBackspace",function(){return this._backspace()}.bind(this));var i=this;this._listener={onVerify:function(e){var t=i.editor,n=t.getModel(),o=t.mapOffset(e.start),s=t.mapOffset(e.end),a=n.getText(o,s),l=i._prefix,d=l.match(new RegExp("^"+r.escape(a),"i"));d&&d.length>0&&(l=i._prefix+=e.text,i._success=!0,i._status(),i.find(i._forward,!0),e.text=null)},onSelection:function(){i._ignoreSelection||i.setActive(!1)}}}function l(e,t,n){if(e){this._editor=e,this._undoStack=t,this._showAll=!0,this._visible=!1,this._caseInsensitive=!0,this._wrap=!0,this._wholeWord=!1,this._incremental=!0,this._regex=!1,this._findAfterReplace=!0,this._hideAfterFind=!1,this._reverse=!1,this._start=void 0,this._end=void 0,this._timer=void 0,this._lastString="";var i=this;this._listeners={onEditorFocus:function(e){i._removeCurrentAnnotation(e)}},this.setOptions(n)}}var d={};return a.prototype=new n.KeyMode,o.mixin(a.prototype,{createKeyBindings:function(){var e=t.KeyBinding,n=[];return n.push({actionID:"incrementalFindBackspace",keyBinding:new e(8)}),n.push({actionID:"incrementalFindCancel",keyBinding:new e(13)}),n.push({actionID:"incrementalFindCancel",keyBinding:new e(27)}),n.push({actionID:"incrementalFindReverse",keyBinding:new e(38)}),n.push({actionID:"incrementalFind",keyBinding:new e(40)}),n.push({actionID:"incrementalFindReverse",keyBinding:new e("k",!0,!0)}),n.push({actionID:"incrementalFind",keyBinding:new e("k",!0)}),n},find:function(e,t){if(this._forward=e,!this.isActive())return this.setActive(!0),!1;var n=this._prefix;if(0===n.length)return!1;var i,r=this.editor,o=r.getModel();i=e?this._success?t?this._start:r.getCaretOffset()+1:0:this._success?t?this._start:r.getCaretOffset():o.getCharCount()-1;var s=r.getModel().find({string:n,start:i,reverse:!e,caseInsensitive:n.toLowerCase()===n}).next();return s?(t||(this._start=i),this._success=!0,this._ignoreSelection=!0,r.moveSelection(e?s.start:s.end,e?s.end:s.start),this._ignoreSelection=!1):this._success=!1,this._status(),!0},isActive:function(){return this._active},isStatusActive:function(){return this.isActive()},setActive:function(e){if(this._active!==e){this._active=e,this._prefix="",this._success=!0;var t=this.editor,n=t.getTextView();this._start=this.editor.getCaretOffset(),this.editor.setCaretOffset(this._start),this._active?(n.addEventListener("Verify",this._listener.onVerify),n.addEventListener("Selection",this._listener.onSelection),n.addKeyMode(this)):(n.removeEventListener("Verify",this._listener.onVerify),n.removeEventListener("Selection",this._listener.onSelection),n.removeKeyMode(this)),this._status()}},_backspace:function(){var e=this._prefix;return e=this._prefix=e.substring(0,e.length-1),0===e.length?(this._success=!0,this._ignoreSelection=!0,this.editor.setCaretOffset(this.editor.getSelection().start),this._ignoreSelection=!1,this._status(),!0):this.find(this._forward,!0)},_status:function(){if(!this.isActive())return void this.editor.reportStatus("");var t;t=this._forward?this._success?e.incrementalFindStr:e.incrementalFindStrNotFound:this._success?e.incrementalFindReverseStr:e.incrementalFindReverseStrNotFound,t=s.formatMessage(t,this._prefix),this.editor.reportStatus(t,this._success?"":"error")}}),d.IncrementalFind=a,l.prototype={find:function(e,t,n){this.setOptions({reverse:!e});var i,r=this.getFindString();t&&(r=t.findString||r,i=t.count);var o=this.getOptions();this.setOptions(t);var s=n?this._startOffset:this.getStartOffset(),a=this._doFind(r,s,i);return a&&(n||(this._startOffset=a.start)),this.setOptions(o),this._hideAfterFind&&this.hide(),a},getStartOffset:function(){return void 0!==this._start?this._start:this._reverse?this._editor.getSelection().start-1:this._editor.getCaretOffset()},getFindString:function(){var e=this._editor.getSelection(),t=this._editor.getText(e.start,e.end);return this._regex&&(t=r.escape(t)),t||this._lastString},getOptions:function(){return{showAll:this._showAll,caseInsensitive:this._caseInsensitive,wrap:this._wrap,wholeWord:this._wholeWord,incremental:this._incremental,regex:this._regex,findAfterReplace:this._findAfterReplace,hideAfterFind:this._hideAfterFind,reverse:this._reverse,findCallback:this._findCallback,start:this._start,end:this._end}},getReplaceString:function(){return""},hide:function(){this._visible=!1,this._savedOptions&&(this.setOptions(this._savedOptions.pop()),0===this._savedOptions.length&&(this._savedOptions=null)),this._removeAllAnnotations();var e=this._editor.getTextView();e&&(e.removeEventListener("Focus",this._listeners.onEditorFocus),e.focus())},_processReplaceString:function(e){var t=e;if(this._regex){t="";for(var n=!1,i=this._editor.getModel().getLineDelimiter(),r=0;r0&&(o.endUndo(),i.setRedraw(!0)),a>0?n.reportStatus(s.formatMessage(e.replacedMatches,l)):n.reportStatus(e.nothingReplaced,"error"),o._replacingAll=!1},100)}},setOptions:function(e){if(e){if((e.showAll===!0||e.showAll===!1)&&this._showAll!==e.showAll&&(this._showAll=e.showAll,this.isVisible()))if(this._showAll)this._markAllOccurrences();else{var t=this._editor.getAnnotationModel();t&&t.removeAnnotations(i.AnnotationType.ANNOTATION_MATCHING_SEARCH)}(e.caseInsensitive===!0||e.caseInsensitive===!1)&&(this._caseInsensitive=e.caseInsensitive),(e.wrap===!0||e.wrap===!1)&&(this._wrap=e.wrap),(e.wholeWord===!0||e.wholeWord===!1)&&(this._wholeWord=e.wholeWord),(e.incremental===!0||e.incremental===!1)&&(this._incremental=e.incremental),(e.regex===!0||e.regex===!1)&&(this._regex=e.regex),(e.findAfterReplace===!0||e.findAfterReplace===!1)&&(this._findAfterReplace=e.findAfterReplace),(e.hideAfterFind===!0||e.hideAfterFind===!1)&&(this._hideAfterFind=e.hideAfterFind),(e.reverse===!0||e.reverse===!1)&&(this._reverse=e.reverse),e.hasOwnProperty("findCallback")&&(this._findCallback=e.findCallback),e.hasOwnProperty("start")&&(this._start=e.start),e.hasOwnProperty("end")&&(this._end=e.end)}},show:function(e){this._visible=!0,e&&(this._savedOptions||(this._savedOptions=[]),this._savedOptions.push(this.getOptions()),this.setOptions(e)),this._startOffset=this._editor.getSelection().start,this._editor.getTextView().addEventListener("Focus",this._listeners.onEditorFocus);var t=this;window.setTimeout(function(){t._incremental&&t.find(!0,null,!0)},0)},startUndo:function(){this._undoStack&&this._undoStack.startCompoundChange()},endUndo:function(){this._undoStack&&this._undoStack.endCompoundChange()},_find:function(e,t,n){return this._editor.getModel().find({string:e,start:t,end:this._end,reverse:this._reverse,wrap:n?!1:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive})},_doFind:function(t,n,r,o){r=r||1;var s=this._editor;if(!t)return this._removeAllAnnotations(),null;this._lastString=t;var a,l;if(this._regex)try{l=this._find(t,n,o)}catch(d){return void s.reportStatus(d.message,"error")}else l=this._find(t,n,o);for(var h=0;r>h&&l.hasNext();h++)a=l.next();if(!this._replacingAll){if(a?this._editor.reportStatus(""):this._editor.reportStatus(e.notFound,"error"),this.isVisible()){var c=i.AnnotationType.ANNOTATION_CURRENT_SEARCH,u=s.getAnnotationModel();if(u&&(u.removeAnnotations(c),a&&u.addAnnotation(i.AnnotationType.createAnnotation(c,a.start,a.end))),this._showAll){this._timer&&window.clearTimeout(this._timer);var f=this;this._timer=window.setTimeout(function(){f._markAllOccurrences(),f._timer=null},500)}}this._findCallback?this._findCallback(a):a&&s.moveSelection(a.start,a.end,null,!1)}return a},_doReplace:function(e,t,n,i){var r=this._editor;this._regex&&(i=r.getText(e,t).replace(new RegExp(n,this._caseInsensitive?"i":""),i)),r.setText(i,e,t),r.setSelection(e,e+i.length,!0)},_markAllOccurrences:function(){var e=this._editor.getAnnotationModel();if(e){for(var t,n=i.AnnotationType.ANNOTATION_MATCHING_SEARCH,r=e.getAnnotations(),o=[];r.hasNext();){var s=r.next();s.type===n&&o.push(s)}if(this.isVisible()){var a=this.getFindString();for(r=this._editor.getModel().find({string:a,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive}),t=[];r.hasNext();){var l=r.next();t.push(i.AnnotationType.createAnnotation(n,l.start,l.end))}}e.replaceAnnotations(o,t)}},_removeAllAnnotations:function(){var e=this._editor.getAnnotationModel();e&&(e.removeAnnotations(i.AnnotationType.ANNOTATION_CURRENT_SEARCH),e.removeAnnotations(i.AnnotationType.ANNOTATION_MATCHING_SEARCH))},_removeCurrentAnnotation:function(){var e=this._editor.getAnnotationModel();e&&e.removeAnnotations(i.AnnotationType.ANNOTATION_CURRENT_SEARCH)}},d.Find=l,d}),define("orion/editor/findUI",["i18n!orion/editor/nls/messages","orion/editor/find","orion/objects","orion/editor/util","orion/util"],function(e,t,n,i,r){function o(e,n,i){t.Find.call(this,e,n,i)}return o.prototype=new t.Find,n.mixin(o.prototype,{getFindString:function(){var e=this._findInput;return e?e.value:t.Find.prototype.getFindString.call(this)},getReplaceString:function(){var e=this._replaceInput;return e?e.value:t.Find.prototype.getReplaceString(this)},hide:function(){var e=this.isVisible();t.Find.prototype.hide.call(this),e&&(this._rootDiv.className="textViewFind")},show:function(e){t.Find.prototype.show.call(this,e);var n=e.findString,i=e.replaceString,r=this._findInput;if(r||(this._create(),r=this._findInput),n&&(r.value=n),i){var o=this._replaceInput;o.value=i}var s=this;window.setTimeout(function(){s._rootDiv.className="textViewFind show",r.select(),r.focus()},0)},_create:function(){var e=this,t=this._editor.getTextView(),n=t.getOptions("parent"),o=n.ownerDocument,s=r.createElement(o,"div");s.className="textViewFind",i.addEventListener(s,"keydown",function(t){e._handleKeyDown(t)}),this._rootDiv=s,this._createContents(o,s),t._rootDiv.insertBefore(s,t._rootDiv.firstChild)},_createContents:function(t,n){var o=this,s=r.createElement(t,"input");s.className="textViewFindInput",this._findInput=s,s.type="text",s.placeholder=e.findWith,i.addEventListener(s,"input",function(e){return o._handleInput(e)}),n.appendChild(s);var a=r.createElement(t,"span");o._createButton(t,a,e.next,function(){o.find(!0)}),o._createButton(t,a,e.previous,function(){o.find(!1)}),n.appendChild(a);var l=o._editor.getTextView().getOptions("readonly");if(!l){var d=r.createElement(t,"input");d.className="textViewReplaceInput",this._replaceInput=d,d.type="text",d.placeholder=e.replaceWith,n.appendChild(d),a=r.createElement(t,"span"),o._createButton(t,a,e.replace,function(){o.replace()}),o._createButton(t,a,e.replaceAll,function(){o.replaceAll()}),n.appendChild(a)}a=r.createElement(t,"span"),o._createButton(t,a,e.regex,function(e){o._toggle("regex",e.target)},this._regex,e.regexTooltip),o._createButton(t,a,e.caseInsensitive,function(e){o._toggle("caseInsensitive",e.target)},this._caseInsensitive,e.caseInsensitiveTooltip),o._createButton(t,a,e.wholeWord,function(e){o._toggle("wholeWord",e.target)},this._wholeWord,e.wholeWordTooltip),n.appendChild(a);var h=o._createButton(t,n,"",function(){o.hide()});h.className="textViewFindCloseButton",h.title=e.closeTooltip},_createButton:function(e,t,n,r,o,s){var a=e.createElement("button");return this._checked(o,a),s&&(a.title=s),i.addEventListener(a,"click",function(e){r.call(this,e)},!1),n&&a.appendChild(e.createTextNode(n)),t.appendChild(a),a},_toggle:function(e,t){var n={};n[e]=!this["_"+e],this.setOptions(n),this._checked(n[e],t)},_checked:function(e,t){t.className="textViewFindButton",e&&(t.className+=" checked")},_handleInput:function(){return this._incremental&&this.find(!0,null,!0),!0},_handleKeyDown:function(e){var t,n=(r.isMac?e.metaKey:e.ctrlKey)&&!e.altKey&&!e.shiftKey;return n&&70===e.keyCode&&(t=!0),((r.isMac?e.metaKey:e.ctrlKey)&&!e.altKey&&75===e.keyCode||13===e.keyCode)&&(this.find(13===e.keyCode?this._reverse?e.shiftKey:!e.shiftKey:!e.shiftKey),t=!0),n&&82===e.keyCode&&(this.replace(),t=!0),27===e.keyCode&&(this.hide(),t=!0),t?(e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),e.cancelBubble=!0,!1):!0}}),{FindUI:o}}),define("orion/editor/actions",["i18n!orion/editor/nls/messages","orion/keyBinding","orion/editor/annotations","orion/editor/tooltip","orion/editor/find","orion/editor/findUI","orion/util"],function(e,t,n,i,r,o,s){function a(e,t,n,i){function r(e,t,n){s.setText(e,t,n),o+=t-n+e.length}var o=0,s=e.editor,a=s.getSelections();!i&&(t||a.length>1)&&e.startUndo(),a.forEach(function(e){e.start+=o,e.end+=o,n(e,r)}),s.setSelections(a),!i&&(t||a.length>1)&&e.endUndo()}function l(e,t,n){this.editor=e,this.undoStack=t,this._incrementalFind=new r.IncrementalFind(e),this._find=n?n:new o.FindUI(e,t),this._lastEditLocation=null,this.init()}function d(e,t,n,i){this.editor=e,this.undoStack=t,this.contentAssist=n,this.linkedMode=i,this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",this.contentAssistProposalApplied.bind(this)),this.init()}var h=n.AnnotationType,c={};return l.prototype={init:function(){var n=this.editor.getTextView();this._lastEditListener={onModelChanged:function(e){this.editor.isDirty()&&(this._lastEditLocation=e.start+e.addedCharCount)}.bind(this)},n.addEventListener("ModelChanged",this._lastEditListener.onModelChanged),n.setAction("undo",function(e){if(this.undoStack){var t=1;for(e&&e.count&&(t=e.count);t>0;)this.undoStack.undo(),--t;return!0}return!1}.bind(this),{name:e.undo}),n.setAction("redo",function(e){if(this.undoStack){var t=1;for(e&&e.count&&(t=e.count);t>0;)this.undoStack.redo(),--t;return!0}return!1}.bind(this),{name:e.redo}),n.setKeyBinding(new t.KeyBinding("f",!0),"find"),n.setAction("find",function(){if(this._find){var e=this.editor.getSelection();return this._find.show({findString:this.editor.getText(e.start,e.end)}),!0}return!1}.bind(this),{name:e.find}),n.setKeyBinding(new t.KeyBinding("k",!0),"findNext"),n.setAction("findNext",function(e){return this._find?(this._find.find(!0,e),!0):!1
+}.bind(this),{name:e.findNext}),n.setKeyBinding(new t.KeyBinding("k",!0,!0),"findPrevious"),n.setAction("findPrevious",function(e){return this._find?(this._find.find(!1,e),!0):!1}.bind(this),{name:e.findPrevious}),n.setKeyBinding(new t.KeyBinding("j",!0),"incrementalFind"),n.setAction("incrementalFind",function(){return this._incrementalFind&&this._incrementalFind.find(!0),!0}.bind(this),{name:e.incrementalFind}),n.setKeyBinding(new t.KeyBinding("j",!0,!0),"incrementalFindReverse"),n.setAction("incrementalFindReverse",function(){return this._incrementalFind&&this._incrementalFind.find(!1),!0}.bind(this),{name:e.incrementalFindReverse}),n.setAction("tab",function(){return this.indentLines()}.bind(this)),n.setAction("shiftTab",function(){return this.unindentLines()}.bind(this),{name:e.unindentLines}),n.setKeyBinding(new t.KeyBinding(38,!1,!1,!0),"moveLinesUp"),n.setAction("moveLinesUp",function(){return this.moveLinesUp()}.bind(this),{name:e.moveLinesUp}),n.setKeyBinding(new t.KeyBinding(40,!1,!1,!0),"moveLinesDown"),n.setAction("moveLinesDown",function(){return this.moveLinesDown()}.bind(this),{name:e.moveLinesDown}),n.setKeyBinding(new t.KeyBinding(38,!0,!1,!0),"copyLinesUp"),n.setAction("copyLinesUp",function(){return this.copyLinesUp()}.bind(this),{name:e.copyLinesUp}),n.setKeyBinding(new t.KeyBinding(40,!0,!1,!0),"copyLinesDown"),n.setAction("copyLinesDown",function(){return this.copyLinesDown()}.bind(this),{name:e.copyLinesDown}),n.setKeyBinding(new t.KeyBinding("d",!0,!1,!1),"deleteLines"),n.setAction("deleteLines",function(e){return this.deleteLines(e)}.bind(this),{name:e.deleteLines}),n.setKeyBinding(new t.KeyBinding("l",!s.isMac,!1,!1,s.isMac),"gotoLine"),n.setAction("gotoLine",function(){return this.gotoLine()}.bind(this),{name:e.gotoLine}),n.setKeyBinding(new t.KeyBinding(190,!0),"nextAnnotation"),n.setAction("nextAnnotation",function(){return this.nextAnnotation(!0)}.bind(this),{name:e.nextAnnotation}),n.setKeyBinding(new t.KeyBinding(188,!0),"previousAnnotation"),n.setAction("previousAnnotation",function(){return this.nextAnnotation(!1)}.bind(this),{name:e.prevAnnotation}),n.setKeyBinding(new t.KeyBinding("e",!0,!1,!0,!1),"expand"),n.setAction("expand",function(){return this.expandAnnotation(!0)}.bind(this),{name:e.expand}),n.setKeyBinding(new t.KeyBinding("c",!0,!1,!0,!1),"collapse"),n.setAction("collapse",function(){return this.expandAnnotation(!1)}.bind(this),{name:e.collapse}),n.setKeyBinding(new t.KeyBinding("e",!0,!0,!0,!1),"expandAll"),n.setAction("expandAll",function(){return this.expandAnnotations(!0)}.bind(this),{name:e.expandAll}),n.setKeyBinding(new t.KeyBinding("c",!0,!0,!0,!1),"collapseAll"),n.setAction("collapseAll",function(){return this.expandAnnotations(!1)}.bind(this),{name:e.collapseAll}),n.setKeyBinding(new t.KeyBinding("q",!s.isMac,!1,!1,s.isMac),"lastEdit"),n.setAction("lastEdit",function(){return this.gotoLastEdit()}.bind(this),{name:e.lastEdit})},copyLinesDown:function(){var e=this.editor,t=e.getTextView();if(t.getOptions("readonly"))return!1;var n=e.getModel();return a(this,!1,function(e,t){var i=n.getLineAtOffset(e.start),r=n.getLineAtOffset(e.end>e.start?e.end-1:e.end),o=n.getLineStart(i),s=n.getLineEnd(r,!0),a=n.getLineCount(),l="",d=n.getText(o,s);r===a-1&&(d=(l=n.getLineDelimiter())+d);var h=s;t(d,h,h),e.start=h+l.length,e.end=h+d.length}),!0},copyLinesUp:function(){var e=this.editor,t=e.getTextView();if(t.getOptions("readonly"))return!1;var n=e.getModel();return a(this,!1,function(e,t){var i=n.getLineAtOffset(e.start),r=n.getLineAtOffset(e.end>e.start?e.end-1:e.end),o=n.getLineStart(i),s=n.getLineEnd(r,!0),a=n.getLineCount(),l="",d=n.getText(o,s);r===a-1&&(d+=l=n.getLineDelimiter());var h=o;t(d,h,h),e.start=h,e.end=h+d.length-l.length}),!0},deleteLines:function(e){var t=this.editor,n=t.getTextView();if(n.getOptions("readonly"))return!1;var i=1;e&&e.count&&(i=e.count);var r=t.getModel();return a(this,!1,function(e,t){var n,o=r.getLineAtOffset(e.start),s=r.getLineStart(o);n=e.start!==e.end||1===i?r.getLineAtOffset(e.end>e.start?e.end-1:e.end):Math.min(o+i-1,r.getLineCount()-1);var a=r.getLineEnd(n,!0);t("",s,a),e.start=e.end=s}),!0},expandAnnotation:function(e){var t=this.editor,i=t.getAnnotationModel();if(!i)return!0;var r=t.getModel(),o=t.getCaretOffset(),s=r.getLineAtOffset(o),a=r.getLineStart(s),l=r.getLineEnd(s,!0);r.getBaseModel&&(a=r.mapOffset(a),l=r.mapOffset(l),r=r.getBaseModel());for(var d,h=i.getAnnotations(a,l);!d&&h.hasNext();){var c=h.next();c.type===n.AnnotationType.ANNOTATION_FOLDING&&(d=c)}return d&&e!==d.expanded&&(e?d.expand():(t.setCaretOffset(d.start),d.collapse())),!0},expandAnnotations:function(e){var t=this.editor,i=t.getTextView(),r=t.getAnnotationModel();if(!r)return!0;var o,s=r.getAnnotations();for(i.setRedraw(!1);s.hasNext();)o=s.next(),o.type===n.AnnotationType.ANNOTATION_FOLDING&&e!==o.expanded&&(e?o.expand():o.collapse());return i.setRedraw(!0),!0},indentLines:function(){var e=this.editor,t=e.getTextView();if(t.getOptions("readonly"))return!1;if(t.getOptions("tabMode")){var n=e.getModel(),i=0,r=e.getSelections();return r.length>1&&this.startUndo(),r.some(function(o){o.start+=i,o.end+=i;var s=n.getLineAtOffset(o.start),a=n.getLineAtOffset(o.end>o.start?o.end-1:o.end);if(!(s!==a||r.length>1))return!0;var l=[];l.push("");for(var d=s;a>=d;d++)l.push(n.getLine(d,!0));var h=n.getLineStart(s),c=n.getLineEnd(a,!0),u=t.getOptions("tabSize","expandTab"),f=u.expandTab?new Array(u.tabSize+1).join(" "):" ",p=l.join(f);e.setText(p,h,c);var g=h===o.start?o.start:o.start+f.length,v=o.end+(a-s+1)*f.length;return i+=h-c+p.length,o.start=g,o.end=v,!1})?!1:(e.setSelections(r),r.length>1&&this.endUndo(),!0)}},gotoLastEdit:function(){return"number"==typeof this._lastEditLocation&&this.editor.showSelection(this._lastEditLocation),!0},gotoLine:function(){var t=this.editor,n=t.getModel(),i=n.getLineAtOffset(t.getCaretOffset());return i=prompt(e.gotoLinePrompty,i+1),i&&(i=parseInt(i,10),t.onGotoLine(i-1,0)),!0},moveLinesDown:function(){var e=this.editor,t=e.getTextView();if(t.getOptions("readonly"))return!1;var n=e.getModel();return a(this,!0,function(e,t){var i=n.getLineAtOffset(e.start),r=n.getLineAtOffset(e.end>e.start?e.end-1:e.end),o=n.getLineCount();if(r!==o-1){var s,a=n.getLineStart(i),l=n.getLineEnd(r,!0),d=n.getLineEnd(r+1,!0)-(l-a),h=0;if(r!==o-2)s=n.getText(a,l);else{var c=n.getLineEnd(r);s=n.getText(c,l)+n.getText(a,c),h+=l-c}t("",a,l),t(s,d,d),e.start=d+h,e.end=d+h+s.length}}),!0},moveLinesUp:function(){var e=this.editor,t=e.getTextView();if(t.getOptions("readonly"))return!1;var n=e.getModel();return a(this,!0,function(e,t){var i=n.getLineAtOffset(e.start);if(0!==i){var r=n.getLineAtOffset(e.end>e.start?e.end-1:e.end),o=n.getLineCount(),s=n.getLineStart(i-1),a=n.getLineStart(i),l=n.getLineEnd(r,!0),d=n.getText(a,l),h=0;if(r===o-1){var c=n.getLineEnd(i-1),u=n.getLineEnd(i-1,!0);d+=n.getText(c,u),a=c,h=u-c}t("",a,l),t(d,s,s),e.start=s,e.end=s+d.length-h}}),!0},nextAnnotation:function(e){function t(e){return!!e.lineStyle||e.type===h.ANNOTATION_MATCHING_BRACKET||e.type===h.ANNOTATION_CURRENT_BRACKET||!o.isAnnotationTypeVisible(e.type)}var n=this.editor,r=n.getAnnotationModel();if(!r)return!0;var o=n.getOverviewRuler()||n.getAnnotationStyler();if(!o)return!0;for(var s=n.getModel(),a=n.getCaretOffset(),l=r.getAnnotations(e?a:0,e?s.getCharCount():a),d=null;l.hasNext();){var c=l.next();if(e){if(c.start<=a)continue}else if(c.start>=a)continue;if(!t(c)&&(d=c,e))break}if(d){var u=[d];for(l=r.getAnnotations(d.start,d.start);l.hasNext();)c=l.next(),c===d||t(c)||u.push(c);var f=n.getTextView(),p=(s.getLineAtOffset(d.start),i.Tooltip.getTooltip(f));if(!p)return n.moveSelection(d.start),!0;n.moveSelection(d.start,d.start,function(){setTimeout(function(){var e=n.getTextView(),t=d.start,i=e.getLocationAtOffset(t);p.show({x:i.x,y:i.y,getTooltipInfo:function(){return n._getTooltipInfo(this.x,this.y)}},!1,!1)},0)})}return!0},unindentLines:function(){var e=this.editor,t=e.getTextView();if(t.getOptions("readonly"))return!1;if(t.getOptions("tabMode")){var n=e.getModel();return a(this,!1,function(e,i){for(var r=n.getLineAtOffset(e.start),o=n.getLineAtOffset(e.end>e.start?e.end-1:e.end),s=t.getOptions("tabSize"),a=new Array(s+1).join(" "),l=[],d=0,h=0,c=r;o>=c;c++){var u=n.getLine(c,!0);if(n.getLineStart(c)!==n.getLineEnd(c))if(0===u.indexOf(" "))u=u.substring(1),d++;else{if(0!==u.indexOf(a))return!0;u=u.substring(s),d+=s}c===r&&(h=d),l.push(u)}var f=n.getLineStart(r),p=n.getLineEnd(o,!0),g=n.getLineStart(o),v=l.join("");i(v,f,p);var m=f===e.start?e.start:e.start-h,_=Math.max(m,e.end-d+(e.end===g+1&&e.start!==e.end?1:0));e.start=m,e.end=_}),!0}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}},c.TextActions=l,d.prototype={init:function(){var n=this.editor.getTextView();n.setAction("lineStart",function(){return this.lineStart()}.bind(this)),n.setAction("enter",function(){return this.autoIndent()}.bind(this)),n.setKeyBinding(new t.KeyBinding("t",!0,!1,!0),"trimTrailingWhitespaces"),n.setAction("trimTrailingWhitespaces",function(){return this.trimTrailingWhitespaces()}.bind(this),{name:e.trimTrailingWhitespaces}),n.setKeyBinding(new t.KeyBinding(191,!0),"toggleLineComment"),n.setAction("toggleLineComment",function(){return this.toggleLineComment()}.bind(this),{name:e.toggleLineComment}),n.setKeyBinding(new t.KeyBinding(191,!0,!s.isMac,!1,s.isMac),"addBlockComment"),n.setAction("addBlockComment",function(){return this.addBlockComment()}.bind(this),{name:e.addBlockComment}),n.setKeyBinding(new t.KeyBinding(220,!0,!s.isMac,!1,s.isMac),"removeBlockComment"),n.setAction("removeBlockComment",function(){return this.removeBlockComment()}.bind(this),{name:e.removeBlockComment}),n.setKeyBinding(new t.KeyBinding("[",!1,!1,!1,!1,"keypress"),"autoPairSquareBracket"),n.setAction("autoPairSquareBracket",function(){return this.autoPairBrackets("[","]")}.bind(this)),n.setKeyBinding(new t.KeyBinding("]",!1,!1,!1,!1,"keypress"),"skipClosingSquareBracket"),n.setAction("skipClosingSquareBracket",function(){return this.handleClosingBracket("]")}.bind(this)),n.setKeyBinding(new t.KeyBinding("<",!1,!1,!1,!1,"keypress"),"autoPairAngleBracket"),n.setAction("autoPairAngleBracket",function(){return this.autoPairBrackets("<",">")}.bind(this)),n.setKeyBinding(new t.KeyBinding(">",!1,!1,!1,!1,"keypress"),"skipClosingAngleBracket"),n.setAction("skipClosingAngleBracket",function(){return this.handleClosingBracket(">")}.bind(this)),n.setKeyBinding(new t.KeyBinding("(",!1,!1,!1,!1,"keypress"),"autoPairParentheses"),n.setAction("autoPairParentheses",function(){return this.autoPairBrackets("(",")")}.bind(this)),n.setKeyBinding(new t.KeyBinding(")",!1,!1,!1,!1,"keypress"),"skipClosingParenthesis"),n.setAction("skipClosingParenthesis",function(){return this.handleClosingBracket(")")}.bind(this)),n.setKeyBinding(new t.KeyBinding("{",!1,!1,!1,!1,"keypress"),"autoPairBraces"),n.setAction("autoPairBraces",function(){return this.autoPairBrackets("{","}")}.bind(this)),n.setKeyBinding(new t.KeyBinding("}",!1,!1,!1,!1,"keypress"),"skipClosingBrace"),n.setAction("skipClosingBrace",function(){return this.handleClosingBracket("}")}.bind(this)),n.setKeyBinding(new t.KeyBinding("'",!1,!1,!1,!1,"keypress"),"autoPairSingleQuotation"),n.setAction("autoPairSingleQuotation",function(){return this.autoPairQuotations("'")}.bind(this)),n.setKeyBinding(new t.KeyBinding('"',!1,!1,!1,!1,"keypress"),"autoPairDblQuotation"),n.setAction("autoPairDblQuotation",function(){return this.autoPairQuotations('"')}.bind(this)),n.setAction("deletePrevious",function(){return this.deletePrevious()}.bind(this))},autoIndent:function(){function e(e,t){if(e.start===e.end){for(var n,r=i.getLineAtOffset(e.start),a=i.getLine(r,!1),u=i.getLineStart(r),f=0,p=e.start-u;p>f&&(32===(n=a.charCodeAt(f))||9===n);)f++;var g,v,m=a.substring(0,f),_=a.substring(0,p),y=a.substring(p);if(c.smartIndentation&&123===a.charCodeAt(v=_.trimRight().length-1)){var C=p-v-1,w=y.length-y.trimLeft().length;return g=125===a.charCodeAt(p+w)?s+m+o+s+m:s+m+o,t(g,e.start-C,e.end+w),e.start=e.end=e.start+s.length+m.length+o.length-C,!0}if(c.autoCompleteComments&&!h.test(_)&&(l.test(_)||d.test(_))){var x,S=l.exec(_);if(S)return g=s+m+" * ",g+=h.test(y)?y.substring(0,y.length-2).trim():y.trim(),i.getLineCount()!==r+1&&d.test(i.getLine(r+1))||(g+=s+m+" */"),t(g,e.start,e.end+y.length),e.start=e.end=e.start+s.length+m.length+3,!0;if(S=d.exec(_))for(var b=r-1;b>=0;b--){var T=i.getLine(b,!1);if(l.test(T))return h.test(y)||47===a.charCodeAt(p)?(g=s+m+"*"+y,x=e.start+s.length+m.length+1):(g=s+m+"* "+y,x=e.start+s.length+m.length+2),t(g,e.start,e.end+y.length),e.start=e.end=x,!0;if(!d.test(T))return!1}return!1}if(h.test(_)&&32===m.charCodeAt(m.length-1))return g=s+m.substring(0,m.length-1),t(g,e.start,e.end),e.start=e.end=e.start+g.length,!0;if(f>0){for(f=p;f]"),o=n.getModel();return a(this,!1,function(n,i){var s,a=n.start===o.getCharCount()?"":o.getText(n.start,n.start+1).trim();n.start===n.end&&r.test(a)?(s=e+t,i(s,n.start,n.start),n.start=n.end=n.start+1):n.start!==n.end?(s=e+o.getText(n.start,n.end)+t,i(s,n.start,n.end),n.start+=1,n.end+=1):(i(e,n.start,n.end),n.start=n.end=n.start+e.length)}),!0},autoPairQuotations:function(e){if(!this.autoPairQuotation)return!1;var t=this.editor,n=t.getTextView();if(n.getOptions("readonly"))return!1;var i=new RegExp("^\"$|^'$"),r=new RegExp("\\w"),o=new RegExp("^$|[)}\\]>]"),s=t.getModel();return a(this,!1,function(t,n){function a(){n(e,t.start,t.end),t.start=t.end=t.start+e.length}var l=0===t.start?"":s.getText(t.start-1,t.start).trim(),d=t.start===s.getCharCount()?"":s.getText(t.start,t.start+1).trim();if(t.start!==t.end){var h=s.getText(t.start,t.end);i.test(h)?a():(n(e+h+e,t.start,t.end),t.start+=1,t.end+=1)}else d===e?t.start=t.end=t.start+1:l===e||i.test(d)||r.test(l)||!o.test(d)?a():(n(e+e,t.start,t.end),t.start=t.end=t.start+e.length)}),!0},contentAssistProposalApplied:function(e){function t(){return"number"==typeof n.escapePosition?n.escapePosition:e.data.start+n.proposal.length}var n=e.data.proposal;if(n.positions&&n.positions.length>0&&this.linkedMode){for(var i=[],r=0;r0&&this.linkedMode)this.linkedMode.enterLinkedMode({groups:n.groups,escapePosition:t()});else if("number"==typeof n.escapePosition){var o=this.editor.getTextView();o.setCaretOffset(n.escapePosition)}return!0},deletePrevious:function(){var e=this.editor,t=e.getTextView();if(t.getOptions("readonly"))return!1;var n=e.getModel();return a(this,!1,function(e,t){if(e.start===e.end){var i=0===e.start?"":n.getText(e.start-1,e.start),r=e.start===n.getCharCount()?"":n.getText(e.start,e.start+1);("("===i&&")"===r||"["===i&&"]"===r||"{"===i&&"}"===r||"<"===i&&">"===r||'"'===i&&'"'===r||"'"===i&&"'"===r)&&t("",e.start,e.start+1)}},!0),!1},_findEnclosingComment:function(e,t,n){var i,r,o,s,a,l,d,h="/*",c="*/",u=e.getLineAtOffset(t),f=e.getLineAtOffset(n);for(i=u;i>=0&&(r=e.getLine(i),o=i===u?t-e.getLineStart(u):r.length,s=r.lastIndexOf(h,o),a=r.lastIndexOf(c,o),!(a>s));i--)if(-1!==s){l=e.getLineStart(i)+s;break}for(i=f;is));i++)if(-1!==a){d=e.getLineStart(i)+a;break}return{commentStart:l,commentEnd:d}},lineStart:function(){var e=this.editor,t=e.getModel();return a(this,!1,function(e){var n,i=e.getCaret(),r=t.getLineAtOffset(i),o=t.getLineStart(r),s=t.getLine(r);for(n=0;ne.start?e.end-1:e.end),a=!0,l=[],d=o;s>=d;d++){var h=i.getLine(d,!0);if(r=h.indexOf(n),l.push(r),a&&-1!==r){if(0!==r){var c;for(c=0;r>c;c++){var u=h.charCodeAt(c);if(32!==u&&9!==u)break}a=c===r}}else a=!1}var f,p,g,v=n.length,m=i.getLineStart(o);if(a){for(g=l.length-1;g>=0;g--)r=l[g]+i.getLineStart(o+g),t("",r,r+v);var _=i.getLineStart(s);f=m===e.start?e.start:e.start-v,p=e.end-v*(s-o+1)+(e.end===_+1?v:0)}else{for(g=l.length-1;g>=0;g--)r=i.getLineStart(o+g),t(n,r,r);f=m===e.start?e.start:e.start+v,p=e.end+v*(s-o+1)}e.start=f,e.end=p}),t.setRedraw(!0),!0},trimTrailingWhitespaces:function(){var e=this.editor,t=e.getModel(),n=e.getSelections();e.getTextView().setRedraw(!1),this.startUndo();for(var i=/(\s+$)/,r=t.getLineCount(),o=0;r>o;o++){var s=t.getLine(o),a=i.exec(s);if(a){var l=t.getLineStart(o),d=a[0].length,h=l+a.index;t.setText("",h,h+d),n.forEach(function(e){e.start>h&&(e.start=Math.max(h,e.start-d)),e.start!==e.end&&e.end>h&&(e.end=Math.max(h,e.end-d))})}}this.endUndo(),e.setSelections(n,!1),e.getTextView().setRedraw(!0)},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},handleClosingBracket:function(e){var t=this.editor,n=t.getTextView();if(n.getOptions("readonly"))return!1;var i=t.getModel(),r=t.getSelections();if(1===r.length&&r[0].start===r[0].end){var o=r[0].start===i.getCharCount()?"":i.getText(r[0].start,r[0].start+1);if(o===e)return r[0].start=r[0].end=r[0].start+1,t.setSelections(r),!0;var s=i.getLineAtOffset(r[0].start),a=i.getLine(s,!0);if(a.match(/^\s*$/)&&n.getOptions("tabMode")){var l=n.getOptions("tabSize"),d=new Array(l+1).join(" "),h=i.getLineStart(s),c=i.getLineEnd(s);if(h!==c){if(0===a.indexOf(" "))return a=a.substring(1),i.setText(a,h,c),t.setSelection(r[0].start-1,r[0].end-1),!1;if(0===a.indexOf(d))return a=a.substring(l),i.setText(a,h,c),t.setSelection(r[0].start-l,r[0].end-l),!1}}}return!1},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},setAutoPairParentheses:function(e){this.autoPairParentheses=e},setAutoPairBraces:function(e){this.autoPairBraces=e},setAutoPairSquareBrackets:function(e){this.autoPairSquareBrackets=e},setAutoPairAngleBrackets:function(e){this.autoPairAngleBrackets=e},setAutoPairQuotations:function(e){this.autoPairQuotation=e},setAutoCompleteComments:function(e){this.autoCompleteComments=e},setLineComment:function(e){this.lineComment=e},setSmartIndentation:function(e){this.smartIndentation=e}},c.SourceCodeActions=d,String.prototype.trimLeft||(String.prototype.trimLeft=function(){return this.replace(/^\s+/g,"")}),String.prototype.trimRight||(String.prototype.trimRight=function(){return this.replace(/\s+$/g,"")}),c}),define("orion/editor/rulers",["i18n!orion/editor/nls/messages","orion/editor/textView","orion/editor/annotations","orion/editor/tooltip","orion/objects","orion/editor/util","orion/util"],function(e,t,n,i,r,o,s){function a(e,t,n){this._location=e||"left",this._overview=t||"page",this._rulerStyle=n,this._view=null}function l(e,t,n,i){a.call(this,t,n,i);var r=this;this._listener={onTextModelChanged:function(e){r._onTextModelChanged(e)},onAnnotationModelChanged:function(e){r._onAnnotationModelChanged(e)}},this.setAnnotationModel(e)}function d(e,t,n,i,r){l.call(this,e,t,"page",n),this._oddStyle=i||{style:{backgroundColor:"white"}},this._evenStyle=r||{style:{backgroundColor:"white"}},this._numOfDigits=0,this._firstLine=1}function h(e,t,n){l.call(this,e,t,"page",n)}function c(e,t,n){l.call(this,e,t,"document",n)}function u(e,t,n){h.call(this,e,t,n)}a.prototype={getLocation:function(){return this._location},getOverview:function(){return this._overview},getRulerStyle:function(){return this._rulerStyle},getView:function(){return this._view},setView:function(e){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this._listener.onTextModelChanged),this._view=e,this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this._listener.onTextModelChanged)}},l.prototype=r.mixin(new a,{getAnnotations:function(e,t){var n=this._annotationModel;if(!n)return[];var i=this._view.getModel(),r=i.getLineStart(e),o=i.getLineEnd(t-1),s=i;i.getBaseModel&&(s=i.getBaseModel(),r=i.mapOffset(r),o=i.mapOffset(o));for(var a=[],l=this.getAnnotationsByType(n,r,o),d=0;d=f;f++){var p=f;if(i!==s){var g=s.getLineStart(f);if(g=i.mapOffset(g,!0),-1===g)continue;p=i.getLineAtOffset(g)}if(p>=e&&t>p){var v=this._mergeAnnotation(a[p],h,f-c,u-c+1);v&&(a[p]=v)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var m in a)a[m]._multiple&&(a[m].html=a[m].html+this._multiAnnotationOverlay.html);return a},getAnnotationModel:function(){return this._annotationModel},getWidestAnnotation:function(){return null},setAnnotationModel:function(e){this._annotationModel&&this._annotationModel.removEventListener("Changed",this._listener.onAnnotationModelChanged),this._annotationModel=e,this._annotationModel&&this._annotationModel.addEventListener("Changed",this._listener.onAnnotationModelChanged)},setMultiAnnotation:function(e){this._multiAnnotation=e},setMultiAnnotationOverlay:function(e){this._multiAnnotationOverlay=e},onClick:function(e){if(void 0!==e){var t,n,r,o=this._view,s=o.getModel(),a=s.getLineStart(e),l=s.getLineEnd(e,!0),d=o.getSelection().start,h=o.getSelection().end,c=this._annotationModel;if(c){s.getBaseModel&&(a=s.mapOffset(a),l=s.mapOffset(l),d=s.mapOffset(d),h=s.mapOffset(h));var u=this;t=this._findNextAnnotation(c,a,l,d,h,function(e){return u.isAnnotationTypeVisible(e)}),n=t?t.start:a,r=t?t.end:a,s.getBaseModel&&(n=s.mapOffset(n,!0),r=s.mapOffset(r,!0)),t&&void 0!==t.groupId&&(this._currentClickGroup=this._currentClickGroup===t.groupId?null:t.groupId,this._setCurrentGroup(e))}this._view.setSelection(r,n,1/3,function(){});var f=i.Tooltip.getTooltip(this._view);f&&(t&&"left"===this.getLocation()?f.show({getTooltipInfo:function(){return u._getTooltipInfo([t])}},!1,!1):f.hide())}},onDblClick:function(){},onMouseMove:function(e,t){var n=i.Tooltip.getTooltip(this._view);if(n&&(!n.isVisible()||this._tooltipLineIndex!==e)&&(this._tooltipLineIndex=e,t.clientX!==this._lastMouseX||t.clientY!==this._lastMouseY)){this._lastMouseX=t.clientX,this._lastMouseY=t.clientY,this._hoverTimeout&&(window.clearTimeout(this._hoverTimeout),this._hoverTimeout=null);var r=t.target?t.target:t.srcElement,o=r.getBoundingClientRect();this._curElementBounds=Object.create(null),this._curElementBounds.top=o.top,this._curElementBounds.left=o.left,this._curElementBounds.height=o.height,this._curElementBounds.width=o.width,r===this.node&&(this._curElementBounds.top=t.clientY,this._curElementBounds.height=1);var s=this;s._hoverTimeout=window.setTimeout(function(){s._hoverTimeout=null,n.onHover({getTooltipInfo:function(){var e=s._getAnnotationsAtLineIndex(s._tooltipLineIndex),n=s._getTooltipContents(s._tooltipLineIndex,e);return s._getTooltipInfo(n,t.clientY,{source:"ruler",rulerLocation:s.getLocation()})}},t.clientX,t.clientY)},175)}},onMouseOver:function(e,t){this.onMouseMove(e,t),this._currentClickGroup||this._setCurrentGroup(e)},onMouseOut:function(){this._currentClickGroup||this._setCurrentGroup(-1),this._hoverTimeout&&(window.clearTimeout(this._hoverTimeout),this._hoverTimeout=null)},_findNextAnnotation:function(e,t,n,i,r,o){var s,a=null,l=t;if(i>=0&&r>=0&&i>=t&&n>i){l=i;for(var d=e.getAnnotations(i,r);!s&&d.hasNext();){var h=d.next();(!o||o(h.type))&&h.start===i&&h.end===r&&(s=h)}}for(var c,u=e.getAnnotations(l,n);u.hasNext();)if(h=u.next(),!o||o(h.type)){if(a||(a=h),!s){a=h;break}if(c&&(s.start!==h.start||s.end!==h.end)){c=!1,a=h;break}s&&s===h&&(c=!0)}return c&&(a=null),a},_getAnnotationsAtLineIndex:function(e){if(void 0!==e){var t=this._view,n=t.getModel(),i=this._annotationModel,r=[];if(i){var o=n.getLineStart(e),s=n.getLineEnd(e);n.getBaseModel&&(o=n.mapOffset(o),s=n.mapOffset(s)),r=this.getAnnotationsByType(i,o,s)}return r}},_getTooltipInfo:function(e,t,n){if(!e)return null;var i=Object.create(null);i.top=this._curElementBounds.top,i.left=this._curElementBounds.left,i.height=this._curElementBounds.height,i.width=this._curElementBounds.width,"string"==typeof e&&t&&(i.top=t,i.height=1);var r=this.getLocation(),o=this.getRulerStyle(),s="left"===r?"right":"left",a=this._view._clientDiv.getBoundingClientRect(),l=0,d=0;l=a.left-(i.left+i.width),d=i.height,"left"===s&&(l=-25,1===i.height&&(l+=2)),o.styleClass.indexOf("folding")>=0&&(d-=14);var h={contents:e,position:s,tooltipOffsetX:l,tooltipOffsetY:d,anchorArea:i,context:n};return h},_getTooltipContents:function(e,t){return t},_getOnClickTooltipInfo:function(e){var t=this._view,n=Object.create(null);n.top=this._curElementBounds.top,n.left=this._curElementBounds.left,n.height=this._curElementBounds.height,n.width=this._curElementBounds.width;var i=this.getLocation(),r="left"===i?"right":"left",o={contents:[e],position:r,anchorArea:n},s=t._clientDiv.getBoundingClientRect();return o.offsetX=s.left-(n.left+n.width),o.offsetY=n.height,"left"===o.position&&(o.offsetX=20),o},_onAnnotationModelChanged:function(e){function t(e){for(var t=0;t=l&&void 0!==t.groupId){r=t;break}if(s&&r&&s.groupId===r.groupId)return}if(this._currentGroupAnnotation=null,s&&i.removeAnnotations(s.groupType),r&&-1!==e){this._currentGroupAnnotation=r,n=i.getAnnotations();for(var d=[];n.hasNext();)t=n.next(),delete t.groupAnnotation,t.groupId===r.groupId&&(t=t.createGroupAnnotation(),d.push(t));i.replaceAnnotations(null,d)}}}),n.AnnotationTypeList.addMixin(l.prototype),d.prototype=new l,d.prototype.getAnnotations=function(e,t){for(var n=l.prototype.getAnnotations.call(this,e,t),i=this._view.getModel(),r=e;t>r;r++){var o=r-this._firstLine&1?this._oddStyle:this._evenStyle,s=r;if(i.getBaseModel){var a=i.getLineStart(s);s=i.getBaseModel().getLineAtOffset(i.mapOffset(a))}n[r]||(n[r]={}),n[r].html=this._firstLine+s+"",n[r].style||(n[r].style=o)}return n},d.prototype.getWidestAnnotation=function(){var e=this._view.getModel().getLineCount();return this.getAnnotations(e-1,e)[e-1]},d.prototype.setFirstLine=function(e){this._firstLine=void 0!==e?e:1},d.prototype._onTextModelChanged=function(e){var t=e.start,n=this._view.getModel(),i=n.getBaseModel?n.getBaseModel().getLineCount():n.getLineCount(),r=(this._firstLine+i-1+"").length;if(this._numOfDigits!==r){this._numOfDigits=r;var o=n.getLineAtOffset(t);this._view.redrawLines(o,n.getLineCount(),this)}},h.prototype=new l,c.prototype=new l,c.prototype.getRulerStyle=function(){var e={style:{lineHeight:"1px",fontSize:"1px"}};return e=this._mergeStyle(e,this._rulerStyle)},c.prototype._getTooltipContents=function(t,n){if(n&&0===n.length){var i=this._view.getModel(),r=t;if(i.getBaseModel){var o=i.getLineStart(r);r=i.getBaseModel().getLineAtOffset(i.mapOffset(o))}return s.formatMessage(e.line,r+1)}return l.prototype._getTooltipContents.call(this,t,n)},c.prototype._mergeAnnotation=function(e,t,n,i){if(0!==n)return void 0;var r=e;if(!r){var o=3*i;r={html:" ",style:{style:{height:o+"px"}}},r.style=this._mergeStyle(r.style,t.overviewStyle)}return r},u.prototype=new h,u.prototype.onClick=function(e){if(void 0!==e){var t=this._annotationModel;if(t){var n=this._view,r=n.getModel(),o=r.getLineStart(e),s=r.getLineEnd(e,!0);r.getBaseModel&&(o=r.mapOffset(o),s=r.mapOffset(s),r=r.getBaseModel());for(var a,l=t.getAnnotations(o,s);!a&&l.hasNext();){var d=l.next();this.isAnnotationTypeVisible(d.type)&&r.getLineAtOffset(d.start)===r.getLineAtOffset(o)&&(a=d)}if(a){var h=i.Tooltip.getTooltip(this._view);h&&h.hide(),a.expanded?a.collapse():a.expand()}}}},u.prototype._getTooltipContents=function(e,t){if(t&&t.length>0){var n=this._view,i=n.getModel(),r=i.getLineStart(e);i.getBaseModel&&(r=i.mapOffset(r),i=i.getBaseModel());for(var o=i.getLineAtOffset(r),s=0;s=e.end?s-=e.end-e.start:s>=e.start&&(s=e.start)}),n.setText(o,s,s),n.setSelection(s,s+o.length),this._dropText=null,this._dropOffset=-1}this._undoStack&&this._undoStack.endCompoundChange(),this._dragSelection=null}},_onDragEnter:function(e){this._onDragOver(e)},_onDragOver:function(t){var n=t.event.dataTransfer.types,i=!this._view.getOptions("readonly");if(i&&n&&(i=n.contains?n.contains("text/plain")||n.contains("Text"):-1!==n.indexOf("text/plain")||-1!==n.indexOf("Text")),i){if(!e.isFirefox){var r=e.isMac?t.event.altKey:t.event.ctrlKey;this._dropEffect=t.event.dataTransfer.dropEffect=r?"copy":"move"}}else t.event.dataTransfer.dropEffect="none"},_onDrop:function(t){var n=this._view,i=t.event.dataTransfer.getData("Text");if(i){e.isFirefox||(t.event.dataTransfer.dropEffect=this._dropEffect);var r=n.getOffsetAtLocation(t.x,t.y);this._dragSelection?(this._dropOffset=r,this._dropText=i):(n.setText(i,r,r),n.setSelection(r,r+i.length))}}},{TextDND:t}}),define("orion/editor/linkedMode",["i18n!orion/editor/nls/messages","orion/keyBinding","orion/editor/keyModes","orion/editor/annotations","orion/objects","orion/util"],function(e,t,n,i,r){function o(e){this._data=e}function s(e,t,i){var r=e.getTextView();n.KeyMode.call(this,r),this.editor=e,this.undoStack=t,this.contentAssist=i,this.linkedModeModel=null,r.setAction("linkedModeEnter",function(){return this.exitLinkedMode(!0),!0}.bind(this)),r.setAction("linkedModeCancel",function(){return this.exitLinkedMode(!1),!0}.bind(this)),r.setAction("linkedModeNextGroup",function(){var e=this.linkedModeModel;return this.selectLinkedGroup((e.selectedGroupIndex+1)%e.groups.length),!0}.bind(this)),r.setAction("linkedModePreviousGroup",function(){var e=this.linkedModeModel;return this.selectLinkedGroup(e.selectedGroupIndex>0?e.selectedGroupIndex-1:e.groups.length-1),!0}.bind(this)),this.linkedModeListener={onActivating:function(){this._groupContentAssistProvider&&(this.contentAssist.setProviders([this._groupContentAssistProvider]),this.contentAssist.setProgress(null))}.bind(this),onModelChanged:function(e){if(!this.ignoreVerify){for(var t,n,i=this.editor.mapOffset(e.start),r=this.linkedModeModel;r&&(t=this._getPositionChanged(r,i,i+e.removedCharCount),n=t.position,void 0===n||n.model!==r);)this.exitLinkedMode(!1),r=this.linkedModeModel;if(r){for(var o,s,a=0,l=e.addedCharCount-e.removedCharCount,d=t.positions,h=0;h=0;g--)d=u[g],d.model===s&&d.group===n.group&&i.setText(e.text,d.oldOffset+f,d.oldOffset+p,!1);this.ignoreVerify=!1,e.text=null,this._updateAnnotations(u)}}}.bind(this)}}var a={};return o.prototype={chop:function(e,t){return t.substring(e.length)},computeProposals:function(e,t,n){var i=n.prefix,r=[],o=this._data.style?this._data.style:null;o=o?o:"emphasis";for(var s=this._data.values,a=0;a=0;o--)if(!r[o].escape){var s=r[o].position;if(s.offset<=t&&n<=s.offset+s.length){i=r[o];break}}return{position:i,positions:r}},_updateAnnotations:function(e){var t=this.editor.getAnnotationModel();if(t){for(var n,r=[],o=[],s=t.getAnnotations();s.hasNext();)switch(n=s.next(),n.type){case i.AnnotationType.ANNOTATION_LINKED_GROUP:case i.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP:case i.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:r.push(n)}var a=this.linkedModeModel;if(a){e=e||this._getSortedPositions(a);for(var l=0;l /g,">").replace(/"/g,""").replace(/'/g,"'")}function o(e){return e.replace(/&([#\w]+);/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?String.fromCharCode("x"===t.charAt(1)?parseInt(t.substring(2),16):+t.substring(1)):""})}function s(e,t){return e=e.source,t=t||"",function n(i,r){return i?(r=r.source||r,r=r.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(i,r),n):new RegExp(e,t)}}function a(){}function l(e){for(var t,n,i=1;iAn error occured:
"+r(u.message+"",!0)+" ";throw u}}var h={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:a,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:a,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:a,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};h.bullet=/(?:[*+-]|\d+\.)/,h.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,h.item=s(h.item,"gm")(/bull/g,h.bullet)(),h.list=s(h.list)(/bull/g,h.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+h.def.source+")")(),h.blockquote=s(h.blockquote)("def",h.def)(),h._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",h.html=s(h.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,h._tag)(),h.paragraph=s(h.paragraph)("hr",h.hr)("heading",h.heading)("lheading",h.lheading)("blockquote",h.blockquote)("tag","<"+h._tag)("def",h.def)(),h.normal=l({},h),h.gfm=l({},h.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/}),h.gfm.paragraph=s(h.paragraph)("(?!","(?!"+h.gfm.fences.source.replace("\\1","\\2")+"|"+h.list.source.replace("\\1","\\3")+"|")(),h.tables=l({},h.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),e.rules=h,e.lex=function(t,n){var i=new e(n);return i.lex(t)},e.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},e.prototype.token=function(e,t,n){for(var i,r,o,s,a,l,d,c,u,e=e.replace(/^ +$/gm,"");e;)if((o=this.rules.newline.exec(e))&&(e=e.substring(o[0].length),o[0].length>1&&this.tokens.push({type:"space"})),o=this.rules.code.exec(e))e=e.substring(o[0].length),o=o[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?o:o.replace(/\n+$/,"")});else if(o=this.rules.fences.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"code",lang:o[2],text:o[3]});else if(o=this.rules.heading.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"heading",depth:o[1].length,text:o[2]});else if(t&&(o=this.rules.nptable.exec(e))){for(e=e.substring(o[0].length),l={type:"table",header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/\n$/,"").split("\n")},c=0;c ?/gm,""),this.token(o,t,!0),this.tokens.push({type:"blockquote_end"});else if(o=this.rules.list.exec(e)){for(e=e.substring(o[0].length),s=o[2],this.tokens.push({type:"list_start",ordered:s.length>1}),o=o[0].match(this.rules.item),i=!1,u=o.length,c=0;u>c;c++)l=o[c],d=l.length,l=l.replace(/^ *([*+-]|\d+\.) +/,""),~l.indexOf("\n ")&&(d-=l.length,l=this.options.pedantic?l.replace(/^ {1,4}/gm,""):l.replace(new RegExp("^ {1,"+d+"}","gm"),"")),this.options.smartLists&&c!==u-1&&(a=h.bullet.exec(o[c+1])[0],s===a||s.length>1&&a.length>1||(e=o.slice(c+1).join("\n")+e,c=u-1)),r=i||/\n\n(?!\s*$)/.test(l),c!==u-1&&(i="\n"===l.charAt(l.length-1),r||(r=i)),this.tokens.push({type:r?"loose_item_start":"list_item_start"}),this.token(l,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(o=this.rules.html.exec(e))e=e.substring(o[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:"pre"===o[1]||"script"===o[1]||"style"===o[1],text:o[0],isHTML:!0});else if(!n&&t&&(o=this.rules.def.exec(e)))e=e.substring(o[0].length),this.tokens.links[o[1].toLowerCase()]={href:o[2],title:o[3]},this.tokens.push({type:"def",id:o[1].toLowerCase(),href:o[2],title:o[3]});else if(t&&(o=this.rules.table.exec(e))){for(e=e.substring(o[0].length),l={type:"table",header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/(?: *\| *)?\n$/,"").split("\n")},c=0;c])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:a,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:a,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,c.link=s(c.link)("inside",c._inside)("href",c._href)(),c.reflink=s(c.reflink)("inside",c._inside)(),c.normal=l({},c),c.pedantic=l({},c.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),c.gfm=l({},c.normal,{escape:s(c.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:s(c.text)("]|","~]|")("|","|https?://|")()}),c.breaks=l({},c.gfm,{br:s(c.br)("{2,}","*")(),text:s(c.gfm.text)("{2,}","*")()}),t.rules=c,t.output=function(e,n,i){var r=new t(n,i);return r.output(e)},t.prototype.output=function(e){for(var t,n,i,o,s="";e;)if(o=this.rules.escape.exec(e))e=e.substring(o[0].length),s+=o[1];else if(o=this.rules.autolink.exec(e))e=e.substring(o[0].length),"@"===o[2]?(n=this.mangle(":"===o[1].charAt(6)?o[1].substring(7):o[1]),i=this.mangle("mailto:")+n):(n=r(o[1]),i=n),s+=this.renderer.link(i,null,n);else if(this.inLink||!(o=this.rules.url.exec(e))){if(o=this.rules.tag.exec(e))!this.inLink&&/^/i.test(o[0])&&(this.inLink=!1),e=e.substring(o[0].length),s+=this.options.sanitize?r(o[0]):o[0];else if(o=this.rules.link.exec(e))e=e.substring(o[0].length),this.inLink=!0,s+=this.outputLink(o,{href:o[2],title:o[3]}),this.inLink=!1;else if((o=this.rules.reflink.exec(e))||(o=this.rules.nolink.exec(e))){if(e=e.substring(o[0].length),t=(o[2]||o[1]).replace(/\s+/g," "),t=this.links[t.toLowerCase()],!t||!t.href){s+=o[0].charAt(0),e=o[0].substring(1)+e;continue}this.inLink=!0,s+=this.outputLink(o,t),this.inLink=!1}else if(o=this.rules.strong.exec(e))e=e.substring(o[0].length),s+=this.renderer.strong(this.output(o[2]||o[1]));else if(o=this.rules.em.exec(e))e=e.substring(o[0].length),s+=this.renderer.em(this.output(o[2]||o[1]));else if(o=this.rules.code.exec(e))e=e.substring(o[0].length),s+=this.renderer.codespan(r(o[2],!0));else if(o=this.rules.br.exec(e))e=e.substring(o[0].length),s+=this.renderer.br();else if(o=this.rules.del.exec(e))e=e.substring(o[0].length),s+=this.renderer.del(this.output(o[1]));else if(o=this.rules.text.exec(e))e=e.substring(o[0].length),s+=r(this.smartypants(o[0]));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(o[0].length),n=r(o[1]),i=n,s+=this.renderer.link(i,null,n);return s},t.prototype.outputLink=function(e,t){var n=r(t.href),i=t.title?r(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,i,this.output(e[1])):this.renderer.image(n,i,r(e[1]))},t.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/--/g,"—").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},t.prototype.mangle=function(e){for(var t,n="",i=e.length,r=0;i>r;r++)t=e.charCodeAt(r),Math.random()>.5&&(t="x"+t.toString(16)),n+=""+t+";";return n},n.prototype.code=function(e,t,n){if(this.options.highlight){var i=this.options.highlight(e,t);null!=i&&i!==e&&(n=!0,e=i)}return t?''+(n?e:r(e,!0))+"\n \n":""+(n?e:r(e,!0))+"\n "},n.prototype.blockquote=function(e){return"\n"+e+" \n"},n.prototype.def=function(){return""},n.prototype.html=function(e){return e},n.prototype.heading=function(e,t,n){return"\n"},n.prototype.hr=function(){return this.options.xhtml?" \n":" \n"},n.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+""+n+">\n"},n.prototype.listitem=function(e){return""+e+" \n"},n.prototype.paragraph=function(e){return""+e+"
\n"},n.prototype.table=function(e,t){return" \n"},n.prototype.tablerow=function(e){return"\n"+e+" \n"},n.prototype.tablecell=function(e,t){var n=t.header?"th":"td",i=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return i+e+""+n+">\n"},n.prototype.strong=function(e){return""+e+" "},n.prototype.em=function(e){return""+e+" "},n.prototype.codespan=function(e){return""+e+""},n.prototype.br=function(){return this.options.xhtml?" ":" "},n.prototype.del=function(e){return""+e+""},n.prototype.link=function(e,t,n){if(this.options.sanitize){try{var i=decodeURIComponent(o(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(r){return""}if(0===i.indexOf("javascript:"))return""}var s='"+n+" "},n.prototype.image=function(e,t,n){var i=' ":">"},i.parse=function(e,t,n){var r=new i(t,n);return r.parse(e)},i.prototype.parse=function(e){this.inline=new t(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var n="";this.next();)n+=this.tok();return n},i.prototype.next=function(){return this.token=this.tokens.pop()},i.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},i.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},i.prototype.tok=function(){switch(this.token.type){case"space":return"";case"def":return this.renderer.def(this.token.id,this.token.href,this.token.title);case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,i,r,o="",s="";for(n="",e=0;e0||e.addedLineCount>0),n},setState:function(e,t){var n;e===p.ACTIVE?(n="Activating",this._mode&&this._mode.setActive(!0)):e===p.INACTIVE&&(n="Deactivating",this._mode&&this._mode.setActive(!1)),n&&this.dispatchEvent({type:n,providers:t}),this.state=e,this.onStateChange(e)},setMode:function(e){this._mode=e},onStateChange:function(e){e===p.INACTIVE?(this._removeTextViewListeners(),this._filterText="",this._initialCaretOffset=-1,this._computedProposals=null):e===p.ACTIVE&&(this._filterText="",this._addTextViewListeners(),this.computeProposals())},computeProposals:function(){var e=this.textView.getCaretOffset(),t=this.textView.getSelection(),n=Math.min(t.start,t.end);this._initialCaretOffset=Math.min(e,n),this._computedProposals=null,this._computeProposals(this._initialCaretOffset).then(function(e){if(this.isActive()){var t=this._flatten(e);t&&Array.isArray(t)&&00&&/[A-Za-z0-9_]/.test(e.getText(n-1,n));)n--;return n},handleError:function(e){"undefined"!=typeof console&&(console.log("Error retrieving content assist proposals"),console.log(e&&e.stack))},initialize:function(){this._providers.forEach(function(e){var t=e.provider;"function"==typeof t.initialize&&t.initialize()})},_computeProposals:function(t){var n=this._providers,i=this.textView,s=i.getSelection(),a=i.getModel(),l=t;a.getBaseModel&&(l=a.mapOffset(l),s.start=a.mapOffset(s.start),s.end=a.mapOffset(s.end),a=a.getBaseModel());for(var d=a.getLine(a.getLineAtOffset(l)),h=0;h0)for(var i=0;i0){n=!0;break}return n||g.pageMessage.setErrorMessage(e.noProposals),t}),g.pageMessage.showWhile(m,e.computingProposals)),m},filterProposals:function(e){if(this._computedProposals&&(this._latestModelChangingEvent||e)){var t=this.textView.getModel();t.getBaseModel&&(t=t.getBaseModel());var n=this.getPrefixStart(t,this._initialCaretOffset),i=this.textView.getText(n,this._initialCaretOffset),r=i,o=[];this._computedProposals.forEach(function(e){if(e&&Array.isArray(e)){var t=e.filter(function(e){if(!e)return!1;if(r="string"==typeof e.prefix?e.prefix:i,g[e.style]===g.hr||g[e.style]===g.noemphasis_title)return!0;var t="";if(e.overwrite){if(e.name)t=e.name;else{if(!e.proposal)return!1;t=e.proposal}return 0===t.indexOf(r+this._filterText)}if(e.name||e.proposal){var n=!1;return e.name&&(n=0===e.name.indexOf(r+this._filterText)),!n&&e.proposal&&(n=0===e.proposal.indexOf(this._filterText)),n}return"string"==typeof e?0===e.indexOf(this._filterText):!1},this);t.length>0&&o.push(t)}},this);var s=[];o&&(o=this._removeExtraUnselectableElements(o),s=this._flatten(o)),this.dispatchEvent({type:"ProposalsComputed",data:{proposals:s},autoApply:!1})}},_removeExtraUnselectableElements:function(e){var t=e.map(function(e){var t=e.filter(function(t,n){var i=!0;if(g[t.style]===g.hr)0===n||e.length-1===n?i=!1:g.hr===g[e[n-1].style]&&(i=!1);else if(g[t.style]===g.noemphasis_title){var r=e[n+1];r?g[r.style]===g.noemphasis_title&&(i=!1):i=!1}return i});return t});return t},setEditorContextProvider:function(e){this.editorContextProvider=e},_generateProviderId:function(){return this._idcount?this._idcount++:this._idcount=0,"ContentAssistGeneratedID_"+this._idcount},setAutoTriggerEnabled:function(e){this._autoTriggerEnabled=e,this._updateAutoTriggerListenerState()},setProviders:function(e){var t=this;this.setProviderInfoArray(e.map(function(e){return e.id?e:{provider:e,id:t._generateProviderId()}}))},setProviderInfoArray:function(e){this.clearProviders(),this._providers=e,this._charTriggersInstalled=e.some(function(e){return e.charTriggers}),this._updateAutoTriggerListenerState()},getProviders:function(){return this._providers.slice()},clearProviders:function(){this._providers=[],this._charTriggersInstalled=!1,this._updateAutoTriggerListenerState()},setProgress:function(e){this.progress=e},setStyleAccessor:function(e){this._styleAccessor=e},_flatten:function(e){return e.reduce(function(e,t){var n=e,i=null;if(t&&Array.isArray(t)&&(i=t.filter(function(e){return e})),i&&Array.isArray(i)&&i.length>0){var r=i,o=e,s=i[0].style;if(s&&g[s]&&0===g[s].indexOf(g.noemphasis)&&(r=e,o=i),r.length>0){var a=r[r.length-1].style;a&&g.hr!==g[a]&&(r=r.concat({proposal:"",name:"",description:"---------------------------------",style:"hr",unselectable:!0}))}n=r.concat(o)}return n},[])},_triggerListener:function(){var e=this.textView.getCaretOffset(),t=null,n=[];if(this._charTriggersInstalled){var i=this.textView.getText(e-1,e);this._providers.forEach(function(r){var o=r.charTriggers;if(o&&o.test(i)){var s=!1,a=r.excludedStyles;this._styleAccessor&&a&&(t||(t=this._styleAccessor.getStyles(e-1)),s=t.some(function(e){return a.test(e.style)})),s||n.push(r)}},this),n.length>0&&this.activate(n,!0)}},_updateAutoTriggerListenerState:function(){this._boundTriggerListener||(this._boundTriggerListener=this._triggerListener.bind(this)),this._triggerListenerInstalled?this._autoTriggerEnabled&&this._charTriggersInstalled||(this.textView.removeEventListener("Modify",this._boundTriggerListener),this._triggerListenerInstalled=!1):this._autoTriggerEnabled&&this._charTriggersInstalled&&(this.textView.addEventListener("Modify",this._boundTriggerListener),this._triggerListenerInstalled=!0)},_addTextViewListeners:function(){this._textViewListenersAdded||(this.textView.addEventListener("ModelChanging",this._textViewListeners.onModelChanging),this.textView.addEventListener("Scroll",this._textViewListeners.onScroll),this.textView.addEventListener("Selection",this._textViewListeners.onSelection),this._textViewListenersAdded=!0)},_removeTextViewListeners:function(){this._textViewListenersAdded&&(this._latestModelChangingEvent=null,this.textView.removeEventListener("ModelChanging",this._textViewListeners.onModelChanging),this.textView.removeEventListener("Scroll",this._textViewListeners.onScroll),this.textView.removeEventListener("Selection",this._textViewListeners.onSelection),this._textViewListenersAdded=!1)},_updateFilterText:function(e){var t=e.removedCharCount;if(t){var n=this._filterText.length-t;this._filterText=this._filterText.substring(0,n)}var i=e.text;i&&(this._filterText=this._filterText.concat(i))}},i.EventTarget.addMixin(c.prototype),u.prototype=new n.KeyMode,o.mixin(u.prototype,{createKeyBindings:function(){var e=t.KeyBinding,n=[];return n.push({actionID:"contentAssistApply",keyBinding:new e(13)}),n.push({actionID:"contentAssistCancel",keyBinding:new e(27)}),n.push({actionID:"contentAssistNextProposal",keyBinding:new e(40)}),n.push({actionID:"contentAssistPreviousProposal",keyBinding:new e(38)}),n.push({actionID:"contentAssistNextPage",keyBinding:new e(34)}),n.push({actionID:"contentAssistPreviousPage",keyBinding:new e(33)}),n.push({actionID:"contentAssistHome",keyBinding:new e(d.KEY.HOME)}),n.push({actionID:"contentAssistEnd",keyBinding:new e(d.KEY.END)}),n.push({actionID:"contentAssistTab",keyBinding:new e(9)}),n},cancel:function(){this.getContentAssist().deactivate()},getContentAssist:function(){return this.contentAssist},getProposals:function(){return this.proposals},isActive:function(){return this.getContentAssist().isActive()},setActive:function(e){e?this.contentAssist.textView.addKeyMode(this):this.contentAssist.textView.removeKeyMode(this)},lineUp:function(e,t){return this.selectNew(e,t,!1)},lineDown:function(e,t){return this.selectNew(e,t,!0)},selectNew:function(e,t,n){var i=e;if(n){if(void 0===i&&(i=this.selectedIndex+1),i>=this.proposals.length){if(t)return!0;i=0}}else if(void 0===i&&(i=this.selectedIndex-1),0>i){if(t)return!0;i=this.proposals.length-1}for(var r=i;this.proposals[i]&&this.proposals[i].unselectable;){if(n){if(i++,i>=this.proposals.length){if(t)return!0;i=0}}else if(i--,0>i){if(t)return!0;i=this.proposals.length-1}if(i===r){i=-1;break}}return this.selectedIndex=i,this.widget&&this.widget.selectNode(i),this._showTooltip(!0),!0},_showTooltip:function(e,t){var n=s.Tooltip.getTooltip(this.contentAssist.textView),i=this,r={getTooltipInfo:function(){var e=i.widget.parentNode.getBoundingClientRect(),t={width:350,height:e.height,top:e.top};e.left+e.width>=document.documentElement.clientWidth?(t.left=e.left-t.width,t.left-=10):(t.left=e.left+e.width,t.left+=10);var n={context:{proposal:i.proposals[i.selectedIndex]},anchorArea:e,tooltipArea:t};return n}};e?n.update(r,t):n.show(r,!0,!1)},_hideTooltip:function(){var e=s.Tooltip.getTooltip(this.contentAssist.textView);e.hide(!0)},pageUp:function(){if(this.widget){var e=this.widget.getTopIndex();return e===this.selectedIndex&&(this.widget.scrollIndex(e,!1),e=this.widget.getTopIndex()),0===e?this.lineDown(e,!0):this.lineUp(e,!0)}return this.lineUp()},pageDown:function(){if(this.widget){var e=this.widget.getBottomIndex();return e===this.selectedIndex&&(this.widget.scrollIndex(e,!0),e=this.widget.getBottomIndex()),this.lineDown(e,!0)}return this.lineDown()},enter:function(){var e=this.proposals[this.selectedIndex]||null;return this.contentAssist.apply(e)},tab:function(){return this.widget?(this.widget.parentNode.focus(),!0):!1}}),f.prototype={onClick:function(e){e||(e=window.event),this.contentAssist.apply(this.getProposal(e.target||e.srcElement)),this.textView.focus()},onScroll:function(){this.previousCloneNode&&!this.preserveCloneThroughScroll&&(this._removeCloneNode(),this.previousSelectedNode.classList.add(g.selected)),this.preserveCloneThroughScroll=!1},createDiv:function(e,t,n){var i=t.ownerDocument,r=l.createElement(i,"div");r.id="contentoption"+n,r.setAttribute("role","option"),r.className=g[e.style]?g[e.style]:g.dfault;var o;"hr"===e.style?o=l.createElement(i,"hr"):(o=this._createDisplayNode(e,n),r.contentAssistProposalIndex=n),r.appendChild(o),t.appendChild(r)},createAccessible:function(){var e=this._contentAssistMode,t=this;a.addEventListener(this.parentNode,"keydown",function(n){return n||(n=window.event),n.preventDefault&&n.preventDefault(),n.keyCode===d.KEY.ESCAPE?e.cancel():n.keyCode===d.KEY.UP?e.lineUp():n.keyCode===d.KEY.DOWN?e.lineDown():n.keyCode===d.KEY.ENTER?e.enter():n.keyCode===d.KEY.PAGEDOWN?e.pageDown():n.keyCode===d.KEY.PAGEUP?e.pageUp():n.keyCode===d.KEY.HOME?(t.scrollIndex(0,!0),e.lineDown(0)):n.keyCode===d.KEY.END?e.lineUp(e.getProposals().length-1):!1})},_createDisplayNode:function(e,t){var n=document.createElement("span");if(!e)return n;if("string"==typeof e){var i=this._createNameNode(e);return i.contentAssistProposalIndex=t,i}var r,o;if(e.name&&"string"==typeof e.name)r=this._createNameNode(e.name);else if(e.description&&"string"==typeof e.description)r=this._createNameNode(e.description),o=!0;else{if(!e.proposal||"string"!=typeof e.proposal)return n;r=this._createNameNode(e.proposal)}var s,a=this._createTagsNode(e.tags);return!o&&e.description&&"string"==typeof e.description&&(s=document.createTextNode(e.description)),a&&n.appendChild(a),n.appendChild(r),s&&n.appendChild(s),r.contentAssistProposalIndex=t,n.contentAssistProposalIndex=t,n},_stopResizeTimer:function(){this._resizeTimer&&(window.clearInterval(this._resizeTimer),this._resizeTimer=null)},_startResizeTimer:function(){this._stopResizeTimer(),this._cachedResizeBound=this.parentNode.getBoundingClientRect(),this._resizeTimer=window.setInterval(function(){if(this._contentAssistMode){var e=this.parentNode.getBoundingClientRect();if(e.left===this._cachedResizeBound.left&&e.top===this._cachedResizeBound.top&&e.width===this._cachedResizeBound.width&&e.height===this._cachedResizeBound.height)return;this._cachedResizeBound=e,this._contentAssistMode._showTooltip(!0,!0)}}.bind(this),100)},_createNameNode:function(e){var t=document.createElement("span");return t.classList.add("proposal-name"),t.appendChild(document.createTextNode(e)),t},_createTagsNode:function(e){var t=null;if(e&&e.constructor===Array&&e.length>0){t=document.createElement("span");for(var n=0;n=this.parentNode.scrollTop)return t}return 0},getBottomIndex:function(){for(var e=this.parentNode.childNodes,t=0;tthis.parentNode.scrollTop+this.parentNode.clientHeight)return Math.max(0,t-1)}return e.length-1},scrollIndex:function(e,t){var n=this.parentNode.childNodes[e];n&&(n.scrollIntoView(t),this.preserveCloneThroughScroll=!0)},selectNode:function(e){var t=null;if(this._hideTimeout&&(window.clearTimeout(this._hideTimeout),this._hideTimeout=null),this._fadeTimer&&(window.clearTimeout(this._fadeTimer),this._fadeTimer=null),this.previousSelectedNode&&(this.previousSelectedNode.classList.remove(g.selected),this.previousSelectedNode=null,this.previousCloneNode&&this._removeCloneNode()),-1!==e&&(t=this.parentNode.childNodes[e])){t.classList.add(g.selected),this.parentNode.setAttribute("aria-activedescendant",t.id),t.focus(),t.offsetTopthis.parentNode.scrollTop+this.parentNode.clientHeight&&(t.scrollIntoView(!1),this.preserveCloneThroughScroll=!0);var n=t.firstChild||t,i=n.getBoundingClientRect(),r=this.parentNode.clientWidth?this.parentNode.clientWidth:this.parentNode.getBoundingClientRect(),o=window.getComputedStyle(this.parentNode),s=window.getComputedStyle(t),a=parseInt(o.paddingLeft)+parseInt(o.paddingRight)+parseInt(s.paddingLeft)+parseInt(s.paddingRight);if(i.width>=r-a){var l=parseInt(o.top),d=t.cloneNode(!0);d.classList.add("cloneProposal"),d.style.top=l+t.offsetTop-this.parentNode.scrollTop+"px",d.style.left=o.left,d.setAttribute("id",d.id+"_clone");var h=document.documentElement.clientWidth,c=i.left+i.width-parseInt(h);if(c>0){var u=parseInt(o.left)-c;0>u&&(u=0),d.style.left=u+"px"}var f=document.createElement("div");f.id="clone_contentassist",f.classList.add("contentassist"),f.classList.add("cloneWrapper"),f.appendChild(d),f.onclick=this.parentNode.onclick,this.parentNode.parentNode.insertBefore(f,this.parentNode);var p=function(e){if(e.contentAssistProposalIndex=t.contentAssistProposalIndex,e.hasChildNodes())for(var n=0;n=e?(v._removeCloneNode(),window.clearInterval(v._fadeTimer),v._fadeTimer=null):(f.style.opacity=e,f.style.filter="alpha(opacity="+100*e+")",e-=.1*e)},50)},1500),t.classList.remove(g.selected),this.previousCloneNode=f}}this.previousSelectedNode=t},setContentAssistMode:function(e){this._contentAssistMode=e},show:function(){var e=this._contentAssistMode.getProposals();if(0===e.length)this.hide();else{this.parentNode.innerHTML="";for(var t=0;tl){var d=r.y-this.textView.getLineHeight();this.parentNode.offsetHeight>d?l>d?this.parentNode.style.maxHeight=l+"px":(this.parentNode.style.maxHeight=d+"px",this.parentNode.style.top="0"):(this.parentNode.style.top=r.y-this.parentNode.offsetHeight-this.textView.getLineHeight()+"px",this.parentNode.style.maxHeight=d+"px")}else this.parentNode.style.maxHeight=l+"px";if(r.x+this.parentNode.offsetWidth>s){var h=s-this.parentNode.offsetWidth;0>h&&(h=0),this.parentNode.style.left=h+"px",this.parentNode.style.maxWidth=s-h}else this.parentNode.style.maxWidth=s+r.x+"px"},_removeCloneNode:function(){this.parentNode.parentNode.contains(this.previousCloneNode)&&this.parentNode.parentNode.removeChild(this.previousCloneNode),this.previousCloneNode=null}},{ContentAssist:c,ContentAssistMode:u,ContentAssistWidget:f}}),define("orion/editor/emacs",["i18n!orion/editor/nls/messages","orion/editor/keyModes","orion/keyBinding","orion/util"],function(e,t,n,i){function r(e){t.KeyMode.call(this,e)}return r.prototype=new t.KeyMode,r.prototype.createKeyBindings=function(){var e=[];e.push({actionID:"emacs-beginning-of-line",keyBinding:this._createStroke("a",!i.isMac,!1,!1,i.isMac)}),e.push({actionID:"emacs-end-of-line",keyBinding:this._createStroke("e",!i.isMac,!1,!1,i.isMac)}),e.push({actionID:"emacs-forward-char",keyBinding:this._createStroke("f",!i.isMac,!1,!1,i.isMac)}),e.push({actionID:"emacs-backward-char",keyBinding:this._createStroke("b",!i.isMac,!1,!1,i.isMac)}),e.push({actionID:"emacs-forward-word",keyBinding:this._createStroke("f",!1,!1,!0)}),e.push({actionID:"emacs-backward-word",keyBinding:this._createStroke("b",!1,!1,!0)}),e.push({actionID:"emacs-next-line",keyBinding:this._createStroke("n",!i.isMac,!1,!1,i.isMac)}),e.push({actionID:"emacs-previous-line",keyBinding:this._createStroke("p",!i.isMac,!1,!1,i.isMac)}),e.push({actionID:"emacs-beginning-of-buffer",keyBinding:this._createStroke(188,!1,!0,!0)}),e.push({actionID:"emacs-end-of-buffer",keyBinding:this._createStroke(190,!1,!0,!0)}),e.push({actionID:"emacs-delete-backward-char",keyBinding:this._createStroke(46,!i.isMac,!1,!1,i.isMac)}),e.push({actionID:"emacs-delete-char",keyBinding:this._createStroke("d",!i.isMac,!1,!1,i.isMac)}),e.push({actionID:"emacs-kill-line",keyBinding:this._createStroke("k",!i.isMac,!1,!1,i.isMac)}),e.push({actionID:"emacs-kill-word",keyBinding:this._createStroke("d",!1,!1,!0)}),e.push({actionID:"emacs-backward-kill-word",keyBinding:this._createStroke(46,!1,!1,!0)}),e.push({actionID:"undo",keyBinding:this._createSequence([this._createStroke("x",!0),this._createStroke("u")])}),e.push({actionID:"redo",keyBinding:this._createSequence([this._createStroke("x",!0),this._createStroke("r")])}),e.push({actionID:"emacs-scroll-up",keyBinding:this._createStroke("v",!i.isMac,!1,!1,i.isMac)}),e.push({actionID:"emacs-scroll-down",keyBinding:this._createStroke("v",!1,!1,!0)}),e.push({actionID:"emacs-set-mark-command",keyBinding:this._createStroke(" ",!i.isMac,!1,!1,i.isMac)}),e.push({actionID:"emacs-reset-mark-command",keyBinding:this._createStroke("g",!i.isMac,!1,!1,i.isMac)}),e.push({actionID:"emacs-exchange-point-and-mark",keyBinding:this._createSequence([this._createStroke("x",!i.isMac,!1,!1,i.isMac),this._createStroke("x",!i.isMac,!1,!1,i.isMac)])});for(var t=0;9>=t;t++)e.push({actionID:"emacs-digit-argument-"+t,keyBinding:this._createStroke(48+t,!i.isMac,!1,!1,i.isMac)}),e.push({actionID:"emacs-digit-argument-"+t,keyBinding:this._createStroke(48+t,!1,!1,!0)}),e.push({actionID:"emacs-digit-argument-"+t,keyBinding:this._createStroke(48+t,!i.isMac,!1,!0,i.isMac)});return e.push({actionID:"emacs-negative-argument",keyBinding:this._createStroke(189,!i.isMac,!1,!1,i.isMac)}),e.push({actionID:"emacs-negative-argument",keyBinding:this._createStroke(189,!1,!1,!0)}),e.push({actionID:"emacs-negative-argument",keyBinding:this._createStroke(189,!i.isMac,!1,!0,i.isMac)}),e.push({actionID:"emacs-uppercase",keyBinding:this._createStroke("u",!1,!1,!0)}),e.push({actionID:"emacs-lowercase",keyBinding:this._createStroke("l",!1,!1,!0)}),e.push({actionID:"emacs-capitalize",keyBinding:this._createStroke("c",!1,!1,!0)}),e.push({actionID:"contentAssist",keyBinding:this._createStroke(191,!1,!1,!0)}),e.push({actionID:"find",keyBinding:this._createStroke("r",!1,!1,!0)}),e.push({actionID:"incrementalFind",keyBinding:this._createStroke("s",!0)}),e.push({actionID:"incrementalFindReverse",keyBinding:this._createStroke("r",!0)}),e.push({actionID:"save",keyBinding:this._createSequence([this._createStroke("x",!i.isMac,!1,!1,i.isMac),this._createStroke("s",!i.isMac,!1,!1,i.isMac)])}),this._createActions(this.getView()),e},r.prototype._createStroke=function(t,i,r,o,s){var a=new n.KeyStroke(t,i,r,o,s);return a.scopeName=e.emacs,a},r.prototype._createSequence=function(t){var i=new n.KeySequence(t);return i.scopeName=e.emacs,i},r.prototype._getData=function(){var e={count:(this._argument||1)*(this._sign||1)};return this._argument=0,this._sign=1,e},r.prototype._moveCursor=function(e){var t=this._getData();this._marker&&(t.select=!0);var n=this.getView();return n.invokeAction(e,!1,t)},r.prototype._digitArgument=function(e){return this._argument=10*(this._argument||0)+e,!0},r.prototype._negativeArgument=function(){return this._sign=-1*(this._sign||1),!0},r.prototype._createActions=function(t){var n=this;t.setAction("emacs-beginning-of-line",function(){return n._moveCursor("lineStart")},{name:e.lineStart}),t.setAction("emacs-end-of-line",function(){return n._moveCursor("lineEnd")},{name:e.lineEnd}),t.setAction("emacs-forward-char",function(){return n._moveCursor("charNext")},{name:e.charNext}),t.setAction("emacs-backward-char",function(){return n._moveCursor("charPrevious")},{name:e.charPrevious}),t.setAction("emacs-forward-word",function(){return n._moveCursor("wordNext")},{name:e.wordNext}),t.setAction("emacs-backward-word",function(){return n._moveCursor("wordPrevious")},{name:e.wordPrevious}),t.setAction("emacs-next-line",function(){return n._moveCursor("lineDown")},{name:e.lineDown}),t.setAction("emacs-previous-line",function(){return n._moveCursor("lineUp")},{name:e.lineUp}),t.setAction("emacs-beginning-of-buffer",function(){return n._moveCursor("textStart")},{name:e.textStart}),t.setAction("emacs-end-of-buffer",function(){return n._moveCursor("textEnd")},{name:e.textEnd}),t.setAction("emacs-delete-backward-char",function(){return t.invokeAction("deletePrevious")},{name:e.deletePrevious}),t.setAction("emacs-delete-char",function(){return t.invokeAction("deletePrevious")},{name:e.deletePrevious}),t.setAction("emacs-kill-line",function(){return t.invokeAction("deleteLineEnd")},{name:e.deleteLineEnd}),t.setAction("emacs-kill-word",function(){return t.invokeAction("deleteWordNext")},{name:e.deleteWordNext}),t.setAction("emacs-backward-kill-word",function(){return t.invokeAction("deleteWordPrevious")
+},{name:e.deleteWordPrevious}),t.setAction("emacs-scroll-up",function(){return n._moveCursor("pageDown")},{name:e.pageDown}),t.setAction("emacs-scroll-down",function(){return n._moveCursor("pageUp")},{name:e.pageUp}),t.setAction("emacs-set-mark-command",function(){var e=t.getCaretOffset();return t.setCaretOffset(e),n._marker=e,!0},{name:e.setMarkCommand}),t.setAction("emacs-exchange-point-and-mark",function(){if(void 0!==n._marker){var e=t.getCaretOffset(),i=t.getSelection();if(i.end===e){var r=i.start;i.start=i.end,i.end=r}n._marker=e,t.setSelection(i.start,i.end)}return!0},{name:e.exchangeMarkPoint}),t.setAction("emacs-reset-mark-command",function(){var e=t.getCaretOffset();return t.setCaretOffset(e),n._marker=void 0,!0},{name:e.clearMark}),t.setAction("emacs-digit-argument-0",function(){return n._digitArgument(0)},{name:i.formatMessage(e.digitArgument,"0")}),t.setAction("emacs-digit-argument-1",function(){return n._digitArgument(1)},{name:i.formatMessage(e.digitArgument,"1")}),t.setAction("emacs-digit-argument-2",function(){return n._digitArgument(2)},{name:i.formatMessage(e.digitArgument,"2")}),t.setAction("emacs-digit-argument-3",function(){return n._digitArgument(3)},{name:i.formatMessage(e.digitArgument,"3")}),t.setAction("emacs-digit-argument-4",function(){return n._digitArgument(4)},{name:i.formatMessage(e.digitArgument,"4")}),t.setAction("emacs-digit-argument-5",function(){return n._digitArgument(5)},{name:i.formatMessage(e.digitArgument,"5")}),t.setAction("emacs-digit-argument-6",function(){return n._digitArgument(6)},{name:i.formatMessage(e.digitArgument,"6")}),t.setAction("emacs-digit-argument-7",function(){return n._digitArgument(7)},{name:i.formatMessage(e.digitArgument,"7")}),t.setAction("emacs-digit-argument-8",function(){return n._digitArgument(8)},{name:i.formatMessage(e.digitArgument,"8")}),t.setAction("emacs-digit-argument-9",function(){return n._digitArgument(9)},{name:i.formatMessage(e.digitArgument,"9")}),t.setAction("emacs-negative-argument",function(){return n._negativeArgument()},{name:e.negativeArgument}),t.setAction("emacs-uppercase",function(){var e=n._getData();return e.unit="word",t.invokeAction("uppercase",!1,e)},{name:e.uppercase}),t.setAction("emacs-lowercase",function(){var e=n._getData();return e.unit="word",t.invokeAction("lowercase",!1,e)},{name:e.lowercase}),t.setAction("emacs-capitalize",function(){var e=n._getData();return e.unit="word",t.invokeAction("capitalize",!1,e)},{name:e.capitalize})},{EmacsMode:r}}),define("orion/editor/vi",["i18n!orion/editor/nls/messages","orion/editor/keyModes","orion/keyBinding","orion/util"],function(e,t,n,i){function r(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}function o(t,i,r,o,s,a,l){var d=new n.KeyStroke(t,i,r,o,s,a);return d.scopeName=l||e.vi,d}function s(t,i){var r=new n.KeySequence(t);return r.scopeName=i||e.vi,r}function a(e,n,i){this.key=n,this.msg=i,this.number="",t.KeyMode.call(this,e),e&&this._createActions(e)}function l(e){var n=e.getView();this.viMode=e,t.KeyMode.call(this,n),this._createActions(n)}function d(e,t,n,i){this.viMode=e,this.nextMode=t,a.call(this,e.getView(),n,i)}function h(e){var n=e.getView();t.KeyMode.call(this,n),this.viMode=e,this._createActions(n)}function c(t,n){a.call(this,t,"",e.vimove),this.insertMode=new h(this),this.changeMode=new d(this,this.insertMode,"c",e.vichange),this.deleteMode=new d(this,this,"d",e.videlete),this.yankMode=new d(this,this,"y",e.viyank),this.statusReporter=n}var u,f;return a.prototype=new t.KeyMode,r(a.prototype,{_msg:function(t){return{name:i.formatMessage(e[t],this.msg)}},createKeyBindings:function(){var e=[],t=this.key;t=t?"-"+t+"-":"-";for(var n=0;9>=n;n++)e.push({actionID:"vi"+t+n,keyBinding:o(n+"",!1,!1,!1,!1,"keypress"),predefined:!0});return e.push({actionID:"vi"+t+"Left",keyBinding:o("h",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"Left",keyBinding:o("h",!0,!1,!1,!1)}),e.push({actionID:"vi"+t+"Left",keyBinding:o(8)}),e.push({actionID:"vi"+t+"Left",keyBinding:o(37)}),e.push({actionID:"vi"+t+"Down",keyBinding:o("j",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"Down",keyBinding:o(40)}),e.push({actionID:"vi"+t+"Up",keyBinding:o("k",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"Up",keyBinding:o(38)}),e.push({actionID:"vi"+t+"Right",keyBinding:o("l",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"Right",keyBinding:o(39)}),e.push({actionID:"vi"+t+"Right",keyBinding:o(32)}),e.push({actionID:"vi"+t+"w",keyBinding:o("w",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"b",keyBinding:o("b",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"W",keyBinding:o("W",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"B",keyBinding:o("B",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"e",keyBinding:o("e",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"E",keyBinding:o("E",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"$",keyBinding:o("$",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"^_",keyBinding:o("^",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"^_",keyBinding:o("_",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"+",keyBinding:o("+",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"+",keyBinding:o(13)}),e.push({actionID:"vi"+t+"-",keyBinding:o("-",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"|",keyBinding:o("|",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"H",keyBinding:o("H",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"M",keyBinding:o("M",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"L",keyBinding:o("L",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"/",keyBinding:o("/",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"?",keyBinding:o("?",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"n",keyBinding:o("n",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"N",keyBinding:o("N",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"f",keyBinding:o("f",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"F",keyBinding:o("F",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"t",keyBinding:o("t",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"T",keyBinding:o("T",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+",",keyBinding:o(",",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+";",keyBinding:o(";",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi"+t+"G",keyBinding:o("G",!1,!1,!1,!1,"keypress")}),e},_createActions:function(e){function t(t){for(var n=e.getModel(),i=n.getLine(t),r=0,o=i.charCodeAt(r);32===o||9===o;)r++,o=i.charCodeAt(r);return r}function n(e,t){e&&r.getView().setCaretOffset(e.start),t.editDone&&t.editDone()}var i=this.key;i=i?"-"+i+"-":"-";var r=this;e.setAction("vi"+i+"0",function(){return r._storeNumber(0)}),e.setAction("vi"+i+"1",function(){return r._storeNumber(1)}),e.setAction("vi"+i+"2",function(){return r._storeNumber(2)}),e.setAction("vi"+i+"3",function(){return r._storeNumber(3)}),e.setAction("vi"+i+"4",function(){return r._storeNumber(4)}),e.setAction("vi"+i+"5",function(){return r._storeNumber(5)}),e.setAction("vi"+i+"6",function(){return r._storeNumber(6)}),e.setAction("vi"+i+"7",function(){return r._storeNumber(7)}),e.setAction("vi"+i+"8",function(){return r._storeNumber(8)}),e.setAction("vi"+i+"9",function(){return r._storeNumber(9)}),e.setAction("vi"+i+"Left",function(){return r._invoke("charPrevious",{unit:"character"})},this._msg("viLeft")),e.setAction("vi"+i+"Right",function(){return r._invoke("charNext",{unit:"character"})},this._msg("viRight")),e.setAction("vi"+i+"Up",function(){return r._invoke("lineUp",{editLine:!0})},this._msg("viUp")),e.setAction("vi"+i+"Down",function(){return r._invoke("lineDown",{editLine:!0})},this._msg("viDown")),e.setAction("vi"+i+"w",function(){return r._invoke("wordNext",{unit:"word"})},this._msg("viw")),e.setAction("vi"+i+"b",function(){return r._invoke("wordPrevious",{unit:"word"})},this._msg("vib")),e.setAction("vi"+i+"W",function(){return r._invoke("wordNext",{unit:"wordWS"})},this._msg("viW")),e.setAction("vi"+i+"B",function(){return r._invoke("wordPrevious",{unit:"wordWS"})},this._msg("viB")),e.setAction("vi"+i+"e",function(){return r._invoke("charNext",{unit:"character"}),r._invoke("wordNext",{unit:"wordend"}),r._invoke("charPrevious",{unit:"character"}),!0},this._msg("vie")),e.setAction("vi"+i+"E",function(){return r._invoke("wordNext",{unit:"wordendWS"})},this._msg("viE")),e.setAction("vi"+i+"$",function(){return r._invoke("lineEnd")},this._msg("vi$")),e.setAction("vi"+i+"^_",function(){return r._invoke(function(){var n=e.getModel(),i=e.getCaretOffset(),r=n.getLineAtOffset(i);e.setCaretOffset(n.getLineStart(r)+t(r))})},this._msg("vi^_")),e.setAction("vi"+i+"+",function(){return r._invoke(function(n){var i=e.getModel(),r=e.getCaretOffset(),o=i.getLineCount()-1,s=Math.min(i.getLineAtOffset(r)+n.count,o);e.setCaretOffset(i.getLineStart(s)+t(s))},{editLine:!0})},this._msg("vi+")),e.setAction("vi"+i+"-",function(){return r._invoke(function(n){var i=e.getModel(),r=e.getCaretOffset(),o=Math.max(i.getLineAtOffset(r)-n.count,0);e.setCaretOffset(i.getLineStart(o)+t(o))},{editLine:!0})},this._msg("vi-")),e.setAction("vi"+i+"|",function(){return r._invoke(function(t){var n=e.getModel(),i=e.getCaretOffset(),r=n.getLineAtOffset(i);e.setCaretOffset(Math.min(n.getLineStart(r)+t.count-1,n.getLineEnd(r)))})},this._msg("vi|")),e.setAction("vi"+i+"H",function(){return r._invoke(function(t){var n=e.getModel().getLineStart(e.getTopIndex(!0)+(t.count-1));e.setCaretOffset(n)},{editLine:!0})},this._msg("viH")),e.setAction("vi"+i+"M",function(){return r._invoke(function(){var t=Math.ceil((e.getBottomIndex(!0)-e.getTopIndex(!0))/2)+e.getTopIndex(!0);e.setCaretOffset(e.getModel().getLineStart(t))},{editLine:!0})},this._msg("viM")),e.setAction("vi"+i+"L",function(){return r._invoke(function(t){e.setCaretOffset(e.getModel().getLineStart(e.getBottomIndex(!0)-(t.count-1)))},{editLine:!0})},this._msg("viL")),e.setAction("vi"+i+"/",function(){var e={hideAfterFind:!0,incremental:!1,reverse:!1,findCallback:function(t){r._searchFwd=!0,n(t,e)}};return r._invoke("find",e)},this._msg("vi/")),e.setAction("vi"+i+"?",function(){var e={hideAfterFind:!0,incremental:!1,reverse:!0,findCallback:function(t){r._searchFwd=!1,n(t,e)}};return r._invoke("find",e)},this._msg("vi?")),e.setAction("vi"+i+"n",function(){var t,i=e.getCaretOffset();r._searchFwd?(t="findNext",i++):t="findPrevious";var o={start:i,findCallback:function(e){n(e,o)}};return r._invoke(t,o)},this._msg("vin")),e.setAction("vi"+i+"N",function(){var t,i=e.getCaretOffset();r._searchFwd?t="findPrevious":(t="findNext",i++);var o={start:i,findCallback:function(e){n(e,o)}};return r._invoke(t,o)},this._msg("viN")),e.setAction("vi"+i+"f",function(){var t=e.getModel(),n=e.getCaretOffset();return r._findChar(n,t.getLineEnd(t.getLineAtOffset(n)),!1,0)},this._msg("vif")),e.setAction("vi"+i+"F",function(){var t=e.getModel(),n=e.getCaretOffset();return r._findChar(t.getLineStart(t.getLineAtOffset(n)),n,!0,0)},this._msg("viF")),e.setAction("vi"+i+"t",function(){var t=e.getModel(),n=e.getCaretOffset();return r._findChar(n,t.getLineEnd(t.getLineAtOffset(n)),!1,-1)},this._msg("vit")),e.setAction("vi"+i+"T",function(){var t=e.getModel(),n=e.getCaretOffset();return r._findChar(t.getLineStart(t.getLineAtOffset(n)),n,!0,1)},this._msg("viT")),e.setAction("vi"+i+",",function(){return r._findNextChar(r._charTempOptions.reverse)},this._msg("vi,")),e.setAction("vi"+i+";",function(){return r._findNextChar(!r._charTempOptions.reverse)},this._msg("vi;")),e.setAction("vi"+i+"G",function(){if(""===r.number){var t=e.getModel();t.getBaseModel&&(t=t.getBaseModel()),r.number=t.getLineCount()}return r._invoke(function(t){t=t||{},t.line=t.count,t.editLine=!0,t.callback=function(){t.editDone&&t.editDone()},e.invokeAction("gotoLine",!1,t)})},this._msg("viG"))},_invoke:function(e,t){var n=this.getView();return t=t||{},t.count=this._getCount(),"function"==typeof e?e(t):n.invokeAction(e,!1,t),!0},_getCount:function(){var e=1;return""!==this.number&&(e=this.number>>0),this.number="",e},_findChar:function(e,t,n,i){this._charTempOptions={},this._charTempOptions.start=e,this._charTempOptions.end=t,this._charTempOptions.hideAfterFind=!0,this._charTempOptions.incremental=!1,this._charTempOptions.reverse=n,this._charTempOptions.offset=i;var r=this._charTempOptions,o=this;return this._charTempOptions.findCallback=function(e){e&&o.getView().setCaretOffset(e.start+i),r.editDone&&r.editDone()},this._invoke("find",this._charTempOptions)},_findNextChar:function(e){if(this._charTempOptions){var t=this.getView(),n={};n.hideAfterFind=this._charTempOptions.hideAfterFind,n.incremental=this._charTempOptions.incremental,n.reverse=this._charTempOptions.reverse,n.wrap=!1;var i=n,r=this;n.findCallback=function(e){e&&r.getView().setCaretOffset(e.start+r._charTempOptions.offset),i.editDone&&i.editDone()};var o=t.getModel();return e?(n.start=t.getCaretOffset()+1-this._charTempOptions.offset,n.end=o.getLineEnd(o.getLineAtOffset(n.start)),n.reverse=!1,this._invoke("findNext",n)):(n.start=t.getCaretOffset()-this._charTempOptions.offset,n.end=o.getLineStart(o.getLineAtOffset(n.start)),n.reverse=!0,this._invoke("findPrevious",n))}return!0},_storeNumber:function(e){var t=this;return 0!==e||this.number?(this.number+=e,!0):this._invoke(function(){t.getView().invokeAction("lineStart",!0)})}}),l.prototype=new t.KeyMode,r(l.prototype,{createKeyBindings:function(){var e=[];return e.push({actionID:"vi-:-ESC",keyBinding:o(27),predefined:!0}),e},_createActions:function(e){var t=this;e.setAction("vi-:-ESC",function(){return e.removeKeyMode(t),e.addKeyMode(t.viMode),!0})},match:function(e){var n=t.KeyMode.prototype.match.call(this,e);return n||(n=this.getView().getKeyModes()[0].match(e)),n},storeNumber:function(e){this.number=e}}),d.prototype=new a,r(d.prototype,{createKeyBindings:function(){var e=a.prototype.createKeyBindings.call(this);return e.push({actionID:"vi-"+this.key+"ESC",keyBinding:o(27),predefined:!0}),e.push({actionID:"vi-"+this.key+"-"+this.key,keyBinding:o(this.key,!1,!1,!1,!1,"keypress")}),e},_invoke:function(e,t){t=t||{};var n=this.getView(),i=n.getCaretOffset(),r=i,o=n.getModel(),s=this;return t.editDone=function(){var e=n.getCaretOffset();if(r>e){var a=r;r=e,e=a}t.editLine&&(r=o.getLineStart(o.getLineAtOffset(r)),e=o.getLineEnd(o.getLineAtOffset(e),"c"===s.key?!1:!0)),"y"===s.key?(u=n.getText(r,e),f=t.editLine,n.setCaretOffset(i)):n.setText("",r,e),n.removeKeyMode(s),n.addKeyMode(s.nextMode)},a.prototype._invoke.call(this,e,t),t.editDone(),!0},_getCount:function(){var e=1;""!==this.firstNumber&&(e=this.firstNumber>>0);var t=1;return""!==this.number&&(t=this.number>>0),e*=t,this.number=this.firstNumber="",e},_createActions:function(e){a.prototype._createActions.call(this,e);var t=this;e.setAction("vi-"+t.key+"ESC",function(){return e.removeKeyMode(t),e.addKeyMode(t.viMode),!0}),e.setAction("vi-"+t.key+"-"+t.key,function(){return t._invoke("lineEnd",{editLine:!0})},this._msg("viycd"))},storeNumber:function(e){this.firstNumber=e},_modeAdded:function(){this.secondNumber=""},_modeRemoved:function(){this.command="",this.firstNumber="",this.number=""}}),h.prototype=new t.KeyMode,r(h.prototype,{createKeyBindings:function(){var e=[];return e.push({actionID:"vi-insert-ESC",keyBinding:o(27),predefined:!0}),e},_createActions:function(e){var t=this;e.setAction("vi-insert-ESC",function(){return e.removeKeyMode(t),e.addKeyMode(t.viMode),!0})},match:function(e){var n=t.KeyMode.prototype.match.call(this,e);return n||(n=this.getView().getKeyModes()[0].match(e)),n},storeNumber:function(){}}),c.prototype=new a,r(c.prototype,{createKeyBindings:function(){var e=a.prototype.createKeyBindings.call(this);return e.push({actionID:"vi-ctrl-f",keyBinding:o("f",!0)}),e.push({actionID:"vi-ctrl-b",keyBinding:o("b",!0)}),e.push({actionID:"vi-ctrl-e",keyBinding:o("e",!0)}),e.push({actionID:"vi-ctrl-y",keyBinding:o("y",!0)}),e.push({actionID:"statusLineMode",keyBinding:o(":",!1,!1,!1,!1,"keypress")}),e.push({actionID:"vi-a",keyBinding:o("a",!1,!1,!1,!1,"keypress"),predefined:!0}),e.push({actionID:"vi-A",keyBinding:o("A",!1,!1,!1,!1,"keypress"),predefined:!0}),e.push({actionID:"vi-i",keyBinding:o("i",!1,!1,!1,!1,"keypress"),predefined:!0}),e.push({actionID:"vi-I",keyBinding:o("I",!1,!1,!1,!1,"keypress"),predefined:!0}),e.push({actionID:"vi-o",keyBinding:o("o",!1,!1,!1,!1,"keypress"),predefined:!0}),e.push({actionID:"vi-O",keyBinding:o("O",!1,!1,!1,!1,"keypress"),predefined:!0}),e.push({actionID:"vi-R",keyBinding:o("R",!1,!1,!1,!1,"keypress"),predefined:!0}),e.push({actionID:"vi-s",keyBinding:o("s",!1,!1,!1,!1,"keypress"),predefined:!0}),e.push({actionID:"vi-S",keyBinding:o("S",!1,!1,!1,!1,"keypress"),predefined:!0}),e.push({actionID:"vi-p",keyBinding:o("p",!1,!1,!1,!1,"keypress"),predefined:!0}),e.push({actionID:"vi-P",keyBinding:o("P",!1,!1,!1,!1,"keypress"),predefined:!0}),e.push({actionID:"vi-u",keyBinding:o("u",!1,!1,!1,!1,"keypress"),predefined:!0}),e.push({actionID:"vi-c",keyBinding:o("c",!1,!1,!1,!1,"keypress"),predefined:!0}),e.push({actionID:"vi-d",keyBinding:o("d",!1,!1,!1,!1,"keypress"),predefined:!0}),e.push({actionID:"vi-y",keyBinding:o("y",!1,!1,!1,!1,"keypress"),predefined:!0}),e.push({actionID:"vi-~",keyBinding:o("~",!1,!1,!1,!1,"keypress"),predefined:!0}),e.push({actionID:"vi-x",keyBinding:o("x",!1,!1,!1,!1,"keypress"),predefined:!0}),e.push({actionID:"vi-X",keyBinding:o("X",!1,!1,!1,!1,"keypress"),predefined:!0}),e.push({actionID:"vi-C",keyBinding:o("C",!1,!1,!1,!1,"keypress"),predefined:!0}),e.push({actionID:"vi-D",keyBinding:o("D",!1,!1,!1,!1,"keypress"),predefined:!0}),e.push({actionID:"vi-*",keyBinding:o("*",!1,!1,!1,!1,"keypress"),predefined:!0}),e},getKeyBindings:function(e){var n=t.KeyMode.prototype.getKeyBindings.call(this,e);n=n||[];var i,r=this.changeMode.getKeyBindings(e);if(!this.changeMode.isActive())for(i=0;i>0),t.count=n;var i=this.getView();return this.insertMode.storeNumber(this.number),i.invokeAction(e,!1,t),i.removeKeyMode(this),i.addKeyMode(this.insertMode),this.number="",!0},_modeAdded:function(){this.getView().setOptions({blockCursorVisible:!0})},_modeRemoved:function(){var e=this.getView();e.setOptions({blockCursorVisible:!1}),e.removeKeyMode(this.insertMode),e.removeKeyMode(this.changeMode),e.removeKeyMode(this.deleteMode)}}),{VIMode:c}}),define("orion/editorPreferences",[],function(){return{}}),define("orion/widgets/themes/ThemePreferences",[],function(){return{}}),define("orion/widgets/themes/editor/ThemeData",[],function(){return{}}),define("orion/widgets/settings/EditorSettings",[],function(){return null}),define("orion/searchAndReplace/textSearcher",[],function(){return{TextSearcher:null}}),define("orion/widgets/input/DropDownMenu",["orion/objects","orion/webui/littlelib"],function(e,t){function n(e,n,i){var r=t.node(e);if(!r)throw new Error("Parent node of dropdown menu not found");this._parent=r,i=i||{},this.options=i,this.navDropDownId=this._parent.id+"_navdropdown",this.selectionClass=i.selectionClass;var o=document.createElement("div");if(o.classList.add("dropdownMenu"),o.classList.add("dropdownMenuOpen"),o.id=this.navDropDownId,o.style.display="none",this._parent.appendChild(o),this._dropdownMenu=o,n=t.node(n),!n)throw"Trigger node of dropdown menu not found";this._triggerNode=n,"hidden"===this._triggerNode.style.visibility&&(this._triggerNode.style.visibility="visible"),i.noClick||(this._triggerNode.onclick=this.click.bind(this)),this._dropdownMenu.addEventListener("keydown",function(e){e.keyCode===t.KEY.ESCAPE&&this.clearPanel()}.bind(this))}return e.mixin(n.prototype,{click:function(){"none"===this._dropdownMenu.style.display?this.updateContent(this.getContentNode(),function(){t.setFramesEnabled(!1),this._dropdownMenu.style.display="",this._positionDropdown(),this.selectionClass&&this._triggerNode.classList.add(this.selectionClass),this.handle=t.addAutoDismiss([this._triggerNode,this._dropdownMenu],this.clearPanel.bind(this)),this.options.onShow&&this.options.onShow()}.bind(this)):this.clearPanel()},clearPanel:function(){this.isVisible()&&(this._dropdownMenu.style.display="none",t.setFramesEnabled(!0),this.selectionClass&&this._triggerNode.classList.remove(this.selectionClass),this.options.onHide&&this.options.onHide())},addContent:function(e){this._dropdownMenu.innerHTML=e},getContentNode:function(){return this._dropdownMenu},updateContent:function(e,t){t()},_positionDropdown:function(){this._dropdownMenu.style.right="";var e=t.bounds(this._dropdownMenu),n=t.bounds(document.body);if(e.left+e.width>n.left+n.width){var i=t.bounds(this._boundingNode(this._triggerNode)),r=t.bounds(this._triggerNode);this._dropdownMenu.style.right=i.width-(r.left-i.left+r.width)+"px"}},_boundingNode:function(e){var t=window.getComputedStyle(e,null);if(null===t)return e;var n=t.getPropertyValue("position");return"absolute"!==n&&e.parentNode&&e!==document.body?this._boundingNode(e.parentNode):e},isDestroyed:function(){return!this._dropdownMenu.parentNode},isVisible:function(){return"none"!==this._dropdownMenu.style.display&&!this.isDestroyed()},focus:function(){this._dropdownMenu.focus()},destroy:function(){this._parent&&(t.setFramesEnabled(!0),t.empty(this._parent),this._parent=this.select=null)}}),n}),define("orion/URITemplate",[],function(){function e(e){this._text=e}function t(e){return e.replace("%25","%")}function n(e,n){if("U"===n)return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()});if("U+R"===n)return encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(c,t);if("U+R-,"===n)return encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw new Error("Unknown allowed character set: "+n)}function i(e,t,i){for(var r=[],o=0;on?-1:n>i?1:0}function p(e,t,n){var i=document.createElement("a");return i.href=e,i.target=t,i.classList.add("targetSelector"),i.textContent=n,i}var g;return o.mixin(c.prototype,{getCategoryIDs:function(){return Object.keys(this.categories)},getCategory:function(e){return this.categories[e]||null}}),o.mixin(u.prototype,{createLinkElements:function(){return this.allPageLinks.map(function(e){return p(e.href,"_self",e.textContent)})},getAllLinks:function(){return this.allPageLinks}}),{getCategoriesInfo:h,getPageLinksInfo:a,getOrionHome:s}}),define("orion/extensionCommands",["orion/Deferred","orion/commands","orion/contentTypes","orion/URITemplate","orion/i18nUtil","orion/PageLinks","i18n!orion/edit/nls/messages","orion/URL-shim"],function(e,t,n,i,r,o,s){function a(e){var t={},n=e.getPropertyKeys();return n.forEach(function(n){t[n]=e.getProperty(n)}),t}function l(e){return e.id||e.name}var d={},h=o.getOrionHome();d._cloneItemWithoutChildren=function p(e){if(null===e||"object"!=typeof e)return e;var t=e.constructor();for(var n in e)"children"!==n&&"Children"!==n&&"parent"!==n&&"Project"!==n&&(t[n]=p(e[n]));return t},d._getOpenWithNavCommandExtensions=function(e){function t(){for(var t=e.getServiceReferences("orion.edit.editor"),n=[],i=0;i=0){if((d=t.indexOf("]"))<0)return!1;var c,u,f=t.substring(0,l);if(!(c=e[f])||!Array.isArray(c))return!1;if(r=t.substring(l+1,d),u=parseInt(r,10),isNaN(u))return!1;0>u&&(u+=c.length),o=t.substring(d+1),t=f+":"+String(u)+o}return t.indexOf("|")>=0?(r=t.substring(0,t.indexOf("|")),o=t.substring(t.indexOf("|")+1),a(e,r,n,i)?!0:a(e,o,n,i)):t.indexOf(":")>=0?(r=t.substring(0,t.indexOf(":")),o=t.substring(t.indexOf(":")+1),e[r]?a(e[r],o,n,i):!1):s(e,t,h,n,i)}function l(t,i,r){if(r.info.validationProperties)for(var o=0;o=0?!0:!1;var d=!0,h=i?n.getFilenameContentType(t.Name,i):null;return h=h||{id:"application/octet-stream"},r.info.excludedContentTypes&&i&&(d=r.info.excludedContentTypes.every(function(e){var t=e.replace(/([*?])/g,".$1");return-1!==h.id.search(t)?!1:!0})),d&&r.info.contentType&&i&&(d=r.info.contentType.some(function(e){var t=e.replace(/([*?])/g,".$1");return-1!==h.id.search(t)?!0:!1})),d}var d={info:e};return d.validationFunction=function(e){if("function"==typeof o&&(e=o.call(this,e)),e){if(Array.isArray(e)){if((this.info.forceSingleItem||this.info.uriTemplate)&&1!==e.length)return!1;if(e.length<1)return!1}else e=[e];for(var t=0;t-1,l=n.indexOf("?")>-1;a&&(n=n.split("*").join(".*")),l&&(n=n.split("?").join(".")),a||l||e.nameSearch?(s.searchStr=e.caseSensitive?n:n.toLowerCase(),r(s,e,t),s.wildCard=!0):(s.searchStr=e.caseSensitive?n.split("\\").join(""):n.split("\\").join("").toLowerCase(),s.wildCard=!1)}return s.searchStrLength=s.searchStr.length,{params:e,inFileQuery:s,displayedSearchTerm:i}},o.convertSearchParams=function(e){void 0!==e.rows&&(e.rows=parseInt(e.rows,10)),void 0!==e.start&&(e.start=parseInt(e.start,10)),"string"==typeof e.regEx&&(e.regEx="true"===e.regEx.toLowerCase()),"string"==typeof e.caseSensitive&&(e.caseSensitive="true"===e.caseSensitive.toLowerCase()),"string"==typeof e.nameSearch&&(e.nameSearch="true"===e.nameSearch.toLowerCase()),void 0!==e.fileNamePatterns&&(e.fileNamePatterns=o.getFileNamePatternsArray(e.fileNamePatterns))},o.getFileNamePatternsArray=function(e){var t=void 0;if(e){var n=e.trim();n=n.replace(/^(\s*,\s*)+/g,""),n=n.replace(/([^\\]),(\s*,\s*)*/g,"$1/"),n=n.replace(/(\s*\/\s*)/g,"/"),n=n.replace(/\/\/+/g,"/"),n=n.replace(/\/+$/g,""),t=n.split("/")}return t},o.copySearchParams=function(e,t){var n={};for(var i in e)if(void 0!==e[i]&&null!==e[i]){if(!t&&"replace"===i)continue;n[i]=e[i]}return n},o.generateFindURLBinding=function(e,t,n,r,o){var s={find:t.searchStr,regEx:t.wildCard?!0:void 0,caseSensitive:e.caseSensitive?!0:void 0,replaceWith:"string"==typeof r?r:void 0,atLine:"number"==typeof n?n:void 0};if(o)return s;var a=new i("{,params*}").expand({params:s});return","+a},o.convertFindURLBinding=function(e){"string"==typeof e.regEx&&(e.regEx="true"===e.regEx.toLowerCase()),"string"==typeof e.caseSensitive&&(e.caseSensitive="true"===e.caseSensitive.toLowerCase()),"string"==typeof e.atLine&&(e.atLine=parseInt(e.atLine,10))},o.replaceRegEx=function(e,t,n){var i=new RegExp(t.pattern,t.flags);return e.replace(i,n)},o.replaceStringLiteral=function(e,n,i){var r=t.parse("/"+n+"/gim");return o.replaceRegEx(e,r,i)},o.searchOnelineLiteral=function(e,t,n,i,r){for(var o,s=0,a=!1,l=[];;){if(o=t.indexOf(e.searchStr,s),0>o)break;if(i){var d=i.getLineStart(r)+o;l.push({startIndex:o,length:e.searchStrLength,start:d,end:d+e.searchStrLength})}else l.push({startIndex:o,length:e.searchStrLength});if(a=!0,n)break;s=o+e.searchStrLength}return a?l:null},o.findRegExp=function(e,t,n,i){if(!t)return null;n=n||"",n+=(-1===n.indexOf("g")?"g":"")+(-1===n.indexOf("m")?"m":"");var r=new RegExp(t,n),o=null;return o=r.exec(e.substring(i)),o&&{startIndex:o.index+i,length:o[0].length}},o.searchOnelineRegEx=function(e,t,n,i,r){for(var s=0,a=!1,l=[];;){var d=o.findRegExp(t,e.regExp.pattern,e.regExp.flags,s);if(!d)break;if(i){var h=i.getLineStart(r)+d.startIndex;d.start=h,d.end=h+d.length}if(l.push(d),a=!0,n)break;s=d.startIndex+d.length}return a?l:null},o.generateNewContents=function(e,t,n,i,r,s){if(i&&t){e||(n.contents=[]);for(var a=0;a0,l=i.children[g].matches,c=!0;break}}if(c){var m;if(u){var _=o.replaceCheckedMatches(h,r,l,f,s);for(m=_.replacedStr,d=0;di?(i=0,r=i+s-1):(r=n+e,r>t.length-1&&(r=t.length-1,i=r-s+1)));for(var a=i;r>=a;a++)o.push({context:t[a],current:a===n});return o},o.splitFile=function(e){for(var t=0,n=0,i=0,r=0,o=[];;){if(-1!==t&&i>=t&&(t=e.indexOf("\r",i)),-1!==n&&i>=n&&(n=e.indexOf("\n",i)),-1===n&&-1===t){o.push(e.substring(r));break}var s=1;-1!==t&&-1!==n?t+1===n?(s=2,i=n+1):i=(n>t?t:n)+1:i=-1!==t?t+1:n+1,o.push(e.substring(r,i-s)),r=i}return o},o.searchWithinFile=function(e,t,i,r,s,a){var l;a&&(l=new n.TextModel(i));var d=o.splitFile(i);if((r||a)&&(t.contents=d),t){t.children=[];for(var h=0,c=0;c0){var f,p=s?u:u.toLowerCase();if(f=e.wildCard?o.searchOnelineRegEx(e,p,!1,l,c):o.searchOnelineLiteral(e,p,!1,l,c)){var g,v=c+1;if(r)for(var m=0;m0)for(var i=t-1;i>-1;i--){var r=""===n?"":"/";n=n+r+e[i].Name}return n},o}),define("orion/editorCommands",["i18n!orion/edit/nls/messages","orion/i18nUtil","orion/webui/littlelib","orion/widgets/input/DropDownMenu","orion/Deferred","orion/URITemplate","orion/commands","orion/keyBinding","orion/commandRegistry","orion/extensionCommands","orion/contentTypes","orion/searchUtils","orion/objects","orion/PageUtil","orion/PageLinks","orion/editor/annotations","orion/regex","orion/uiUtils","orion/util"],function(e,t,n,i,r,o,s,a,l,d,h,c,u,f,p,g,v,m,_){function y(e){var t=new o(e.uriTemplate),n=e.params||{};n.OrionHome=n.OrionHome||p.getOrionHome();var i=t.expand(n),r=document.createElement("div"),s=document.createElement("iframe");return s.id=e.id,s.name=e.id,s.type="text/html",s.sandbox="allow-scripts allow-same-origin allow-forms allow-popups",s.frameborder=void 0!==e.border?e.border:1,s.src=i,s.className="delegatedUI",e.width&&(r.style.width=e.width,s.style.width=e.width),e.height&&(r.style.height=e.height,s.style.height=e.height),s.style.visibility="hidden",null!==e.parent&&(e.parent||window.document.body).appendChild(r),r.appendChild(s),s.style.left=e.left||(window.innerWidth-parseInt(s.clientWidth,10))/2+"px",s.style.top=e.top||(window.innerHeight-parseInt(s.clientHeight,10))/2+"px",s.style.visibility="",window.addEventListener("message",function a(t){if(t.source===s.contentWindow&&"string"==typeof t.data){var n=JSON.parse(t.data);"orion.page.delegatedUI"===n.pageService&&n.source===e.id&&(n.cancelled?e.cancelled&&e.cancelled():n.result?e.done&&e.done(n.result):(n.Status||n.status)&&e.status&&e.status(n.Status||n.status),window.removeEventListener("message",a,!1),r.parentNode&&r.parentNode.removeChild(r))}},!1),r}function C(e,t){t&&"undefined"!=typeof t.HTML&&delete t.HTML;var n=e.getService("orion.page.message");return n?n.setProgressResult(t).then(null,function(e){throw console.log(e),e}):(console.log(t),(new r).resolve(t))}function w(e){return{_error:e}}function x(e){this.serviceRegistry=e.serviceRegistry,this.commandService=e.commandRegistry,this.fileClient=e.fileClient,this.inputManager=e.inputManager,this.renderToolbars=e.renderToolbars,this.toolbarId=e.toolbarId,this.saveToolbarId=e.saveToolbarId,this.editToolbarId=e.editToolbarId,this.pageNavId=e.navToolbarId,this.editorContextMenuId=e.editorContextMenuId,this.isReadOnly=e.readonly,this.textSearcher=e.textSearcher,this.searcher=e.searcher,this.localSettings=e.localSettings,this.editorPreferences=e.editorPreferences,this.differ=e.differ,this.blamer=e.blamer;var t=this;this.listener={onServiceAdded:function(e){t._onServiceAdded(e.serviceReference)},onServiceRemoved:function(e){t._onServiceRemoved(e.serviceReference)}},this.serviceRegistry.addEventListener("registered",this.listener.onServiceAdded),this.serviceRegistry.addEventListener("unregistering",this.listener.onServiceRemoved)}var S={},b=null;return S.createDelegatedUI=y,x.prototype={createCommands:function(){return this._createSettingsCommand(),this._createGotoLineCommnand(),this._createFindCommnand(),this._createBlameCommand(),this._createDiffCommand(),this._createShowTooltipCommand(),this._createUndoStackCommands(),this._createClipboardCommands(),this._createSaveCommand(),this._createEditCommands()},setSideBar:function(e){this.sideBar=e},getEditCommands:function(){var e=[],t=this.commandService;for(var n in t._commandList){var i=t._commandList[n];i.editInfo&&e.push(i)}return e},updateCommands:function(e){e=e||{},this.editor=e.editor,this.inputManager=e.inputManager,this.localSettings=e.localSettings,this.differ=e.differ,this.blamer=e.blamer,this.textSearcher=e.textSearcher,this._recreateEditCommands&&this._createEditCommands().then(function(){this.registerCommands(),this.registerContextMenuCommands(),this.renderToolbars&&this.renderToolbars()}.bind(this))},_registerCommandGroups:function(e,t){var n,i=this.commandService,r=this.serviceRegistry,o=r.getServiceReferences("orion.edit.command.category");o.forEach(function(r){for(var o={},s=r.getPropertyKeys(),a=0;a0)for(var u=0;ur.start){var s=n.getModel();o=s.getText(r.start,r.end),i&&i.getOptions().regex&&(o=v.escape(o))}return[new l.CommandParameter("find","text","Find:",o)]}),r=new s.Command({name:e.Find,tooltip:e.Find,id:"orion.edit.find",visibleWhen:function(e,n){var i=n.handler.editor||t.editor,r=n.handler.textSearcher||t.textSearcher;return i&&i.installed&&r},parameters:i,callback:function(e){var i=n.node("replaceCompareDiv");if(i&&i.classList.contains("replaceCompareDivVisible"))return!1;var o=this.editor||t.editor,s=this.textSearcher||t.textSearcher;r.textSearcher&&r.textSearcher!==s&&r.textSearcher.hide(),r.textSearcher=s;var a="",l=null,d=o.getSelection();if(d.end>d.start&&e.parameters.valueFor("useEditorSelection")){var h=o.getModel();a=h.getText(d.start,d.end),s.getOptions().regex&&(a=v.escape(a))}else e.parameters&&e.parameters.valueFor("find")&&(a=e.parameters.valueFor("find"),l=f.matchResourceParameters(),c.convertFindURLBinding(l));if(l){s.setOptions({regex:l.regEx,caseInsensitive:!l.caseSensitive});var u={};l.atLine&&(u.start=o.getModel().getLineStart(l.atLine-1)),s.show({findString:a,replaceString:l.replaceWith}),s.find(!0,u),t.commandService.closeParameterCollector()}else s.show({findString:a})}});this.commandService.addCommand(r)},_createBlameCommand:function(){var t=this,n=new s.Command({name:e.Blame,tooltip:e.BlameTooltip,id:"orion.edit.blame",parameters:new l.ParametersDescription([new l.CommandParameter("blame","boolean")],{clientCollect:!0}),visibleWhen:function(e,n){var i=n.handler.editor||t.editor,r=n.handler.blamer||t.blamer;return i&&i.installed&&r&&r.isVisible()},callback:function(e){for(var n=!1,i=this.editor||t.editor,r=this.blamer||t.blamer,o=i.getAnnotationModel().getAnnotations();o.hasNext();){var s=o.next();if(s.type===g.AnnotationType.ANNOTATION_BLAME){n=!0;break}}n=!n,e.parameters&&e.parameters.valueFor("blame")&&(n="true"===e.parameters.valueFor("blame")),n?r.doBlame():i.showBlame([]),i.focus()}});this.commandService.addCommand(n)},_createDiffCommand:function(){var t=this,n=new s.Command({name:e.Diff,tooltip:e.DiffTooltip,id:"orion.edit.diff",visibleWhen:function(e,n){var i=n.handler.editor||t.editor,r=n.handler.differ||t.differ;return i&&i.installed&&r&&r.isVisible()},callback:function(){var e=this.editor||t.editor,n=this.differ||t.differ;n.toggleEnabled();var i=this.editorPreferences;i.getPrefs(function(e){e.diffService=n.isEnabled(),i.setPrefs(e)}),e.focus()}});this.commandService.addCommand(n)},_createShowTooltipCommand:function(){var t=this,n=new s.Command({name:e.showTooltip,tooltip:e.showTooltipTooltip,id:"orion.edit.showTooltip",visibleWhen:function(e,n){var i=n.handler.editor||t.editor;return i&&i.installed},callback:function(){var e=this.editor||t.editor,n=e.getTooltip(),i=e.getTextView(),r=i.getCaretOffset(),o=i.getLocationAtOffset(r);n.show({x:o.x,y:o.y,getTooltipInfo:function(){return e._getTooltipInfo(this.x,this.y)}},!1,!0)}});this.commandService.addCommand(n)},_onServiceRemoved:function(e){-1!==e.getProperty("objectClass").indexOf("orion.edit.command")&&(this._recreateEditCommands=!0)},_onServiceAdded:function(e){-1!==e.getProperty("objectClass").indexOf("orion.edit.command")&&(this._recreateEditCommands=!0)},_createEditCommands:function(){function n(e){if(b)return b;var t=e.getService("orion.core.contentTypeRegistry");return t||(t=new h.ContentTypeRegistry(e),t=e.getService("orion.core.contentTypeRegistry")),t.getContentTypes().then(function(e){return b=e})}var i=this;this._recreateEditCommands=!1;var o=this.serviceRegistry,a=this.commandService,l=o.getServiceReferences("orion.edit.command"),c=o.getService("orion.page.progress"),f=C.bind(null,o),p=function(n,r,a){var l=a.visibleWhen;return a.visibleWhen=function(e,t){var r=t.handler.editor||i.editor,o=t.handler.inputManager||i.inputManager;return r&&r.installed&&o?n.editor&&r.id&&n.editor!==r.id?!1:i.inputManager.getReadOnly()?!1:!l||l(e):!1},a.callback=function(s){var l,d,h=this.editor||i.editor,p=this.inputManager||i.inputManager,g=h.getSelection?h.getSelection():{start:0,end:0},v=h.getModel(),m=function(e){"object"==typeof e&&e?(e.text&&h.setText(e.text),e.selection&&(h.setSelection&&h.setSelection(e.selection.start,e.selection.end,!0),h.focus())):"string"==typeof e&&(h.setText(e,g.start,g.end,!0),h.setSelection&&h.setSelection(g.start,g.start+e.length),h.focus())
+};if(r.execute){var _={contentType:p.getContentType(),input:p.getInput(),offset:h.getCaretOffset()};"orion.edit.quickfix"===n.scopeId&&(_.annotation={start:s.userData.start,end:s.userData.end,title:s.userData.title,id:s.userData.id,data:s.userData.data});var C=h.getEditorContext();C.openDelegatedUI=function(){var e=arguments[0];e=e||{},e.done=m,e.status=f,e.params=e.params||{},u.mixin(e.params,p.getFileMetadata()),y.apply(null,Array.prototype.slice.call(arguments))},C.setStatus=f,h.focus(),l=r.execute(C,_),d=function(e){e&&e.searchParams&&e.refResult&&i.sideBar&&i.sideBar.fillSearchPane(e.searchParams.keyword,{Location:e.searchParams.resource},e);var t=o.getService("orion.page.message");t&&t.setProgressMessage("")}}else l=r.run(v.getText(g.start,g.end),v.getText(),g,p.getInput()),d=function(e){if(e&&e.uriTemplate){var t={};t.uriTemplate=e.uriTemplate,t.params=p.getFileMetadata(),t.id=n.id,t.width=e.width,t.height=e.height,t.done=m,t.status=f,y(t)}else e&&(e.Status||e.status)?f(e.Status||e.status):m(e)};return c.showWhile(l,t.formatMessage(e.running,a.name)).then(d),!0},new s.Command(a)};return r.when(n(this.serviceRegistry),function(){var e=[];return l.forEach(function(t){for(var n=i.serviceRegistry.getService(t),r={},o=t.getPropertyKeys(),s=0;s=5e4)var h=(new Date).getTime();if(this._rootBlock=this._stylerAdapter.createBlock(d,this,s,null),h){var c=(new Date).getTime()-h;c>10&&n.logTiming("editor","styler compute blocks (ms/50000 chars)",5e4*c/l,r.getContentType())}if(i){var u=[];i.removeAnnotations(e.AnnotationType.ANNOTATION_FOLDING),this._computeFolding(this._rootBlock.getBlocks(),t.getModel(),u),this._detectTasks&&(i.removeAnnotations(e.AnnotationType.ANNOTATION_TASK),this._computeTasks(this._rootBlock,s,u)),i.replaceAnnotations([],u)}t.redrawLines()}var d=function(e,t,n,i,r){var o;for(void 0===i&&(i=-1),void 0===r&&(r=e.length);r-i>1;)if(o=Math.floor((r+i)/2),t<=e[o].start)r=o;else{if(n&&tt.result.index?1:e.pattern.pattern.index0;){var c=d[0];if(d.splice(0,1),ot.result.index?1:e.pattern.pattern.index0;){var h=l[0];if(l.splice(0,1),h.result.indext.start?1:0});for(var g=0;g=o);u++){var f=h[u].start,p=h[u].end;if(f>l){var g=e.getLineAtOffset(l),v=e.getLineStart(g);this._stylerAdapter.parse(i.substring(v-r,f-r),v,l-v,n,a),a.forEach(function(e){e.style&&(0===e.style.indexOf(t.beginName)?s.push(e.start+1):0===e.style.indexOf(t.endName)&&s.push(-(e.start+1)))}),a=[]}l=p}return o>l&&(g=e.getLineAtOffset(l),v=e.getLineStart(g),this._stylerAdapter.parse(i.substring(v-r,o-r),v,l-v,n,a),a.forEach(function(e){e.style&&(0===e.style.indexOf(t.beginName)?s.push(e.start+1):0===e.style.indexOf(t.endName)&&s.push(-(e.start+1)))})),s},_findMatchingBracket:function(e,t,n){var i=e.getLineAtOffset(n),r=e.getLineEnd(i),o=e.getText(n,r),s=this._stylerAdapter.getBracketMatch(t,o);if(!s)return-1;for(var a=e.getLine(i),l=e.getLineStart(i),d=this._findBrackets(e,s,t,a,l,r),h=0;h=0?1:-1;if(d[h]*c-1===n){var u=1;if(s.atStart){for(h++;h=0?1:-1,u+=c,0===u)return d[h]*c-1;i+=1;for(var f=e.getLineCount();f>i;){a=e.getLine(i),l=e.getLineStart(i),r=e.getLineEnd(i),d=this._findBrackets(e,s,t,a,l,r);for(var p=0;p=0?1:-1,u+=c,0===u)return d[p]*c-1;i++}}else{for(h--;h>=0;h--)if(c=d[h]>=0?1:-1,u+=c,0===u)return d[h]*c-1;for(i-=1;i>=0;){a=e.getLine(i),l=e.getLineStart(i),r=e.getLineEnd(i),d=this._findBrackets(e,s,t,a,l,r);for(var g=d.length-1;g>=0;g--)if(c=d[g]>=0?1:-1,u+=c,0===u)return d[g]*c-1;i--}}break}}return-1},_getLineStyle:function(e){if(this._highlightCaretLine){var t=this._view,n=t.getModel(),i=t.getSelections(),r=!1;if(!i.some(function(t){return t.start===t.end?(r=r||n.getLineAtOffset(t.start)===e,!1):!0})&&r)return this._caretLineStyle}return null},_getStyles:function(e,t,n,i,r){for(var o=i+n.length,s=[],a=i+r,l=e.getBlocks(),h=d(l,a,!0),c=h;c=o);c++){var u=l[c].start,f=l[c].end;if(u>a){var p=t.getLineAtOffset(a),g=t.getLineStart(p);this._stylerAdapter.parse(n.substring(g-i,u-i),g,a-g,e,s)}var v=Math.max(a,u);if(v===u){var m=this._stylerAdapter.getBlockStartStyle(l[c],n.substring(v-i),v,s);m&&(v+=m.length)}var _=Math.min(o,f),y=[];if(_===f){var C=n.substring(_-a-(l[c].end-l[c].contentEnd)),w=this._stylerAdapter.getBlockEndStyle(l[c],C,_,y);w&&(_-=w.length)}p=t.getLineAtOffset(v),g=t.getLineStart(p);var x=this._getStyles(l[c],t,n.substring(g-i,_-i),g,v-g),S=this._stylerAdapter.getBlockContentStyleName(l[c]);if(S){var b=v;x.forEach(function(e){e.start-b&&s.push({start:b,end:e.start,style:S}),e.mergeable&&(e.style+=","+S),s.push(e),b=e.end}),_-b&&s.push({start:b,end:_,style:S})}else s=s.concat(x);s=s.concat(y),a=f}return o>a&&(p=t.getLineAtOffset(a),g=t.getLineStart(p),this._stylerAdapter.parse(n.substring(g-i,o-i),g,a-g,e,s)),s},_isRenderingWhitespace:function(){return this._whitespacesVisible},_onDestroy:function(){this.destroy()},_onLineStyle:function(e){e.textView===this._view&&(e.style=this._getLineStyle(e.lineIndex));var t=e.lineStart,n=e.textView.getModel();if(n.getBaseModel){t=n.mapOffset(t);var i=n.getBaseModel()}e.ranges=this._getStyles(this._rootBlock,i||n,e.lineText,t,0);for(var r=e.ranges.length-1;r>=0;r--){var o=e.ranges[r];if(o.style){if(o.style={styleClass:o.style.replace(/\./g," ")},i){var s=o.end-o.start;o.start=n.mapOffset(o.start,!0),o.end=o.start+s}}else e.ranges.splice(r,1)}this._isRenderingWhitespace()&&(this._spliceStyles(this._spacePattern,e.ranges,e.lineText,e.lineStart),this._spliceStyles(this._tabPattern,e.ranges,e.lineText,e.lineStart))},_onModelChanged:function(t){for(var n,i,r,o,s,a,l,h=t.start,c=t.removedCharCount,u=t.addedCharCount,f=u-c,p=this._view.getModel(),g=p.getBaseModel?p.getBaseModel():p,v=h+c,m=g.getCharCount(),_=g.getLineStart(g.getLineAtOffset(h)),y=this._findBlock(this._rootBlock,h);;){if(r=y.parent,!n&&r){if(0>f&&y.end-h<=-f){y=r;continue}if(s=g.getText(y.start,Math.min(m,y.end+f+1)),!this._stylerAdapter.verifyBlock(g,s,y,f)){y=r;continue}}i=y.getBlocks();var C=i.length,w=d(i,_,!0),x=d(i,v,!1,w-1,C);if(n=!1,w&&i.length&&i[w-1].end===h){s=g.getText(i[w-1].start,Math.min(m,h+1));var S=this.computeBlocks(g,s,y,i[w-1].start,null,null,null);S.length&&S[0].end!==i[w-1].end&&(w--,n=!0)}C>w&&i[w].start<=_&&(_h&&(l+=f)):w===C&&C>0&&y.end-f===i[C-1].end?(l=i[--w].start,l>h&&(l+=f)):l=Math.max(_,y.contentStart),a=C>x?i[x].end:y.contentEnd,a>=h&&(a+=f),a=Math.min(a,m-1),s=g.getText(l,a+1);var b=this.computeBlocks(g,s,y,l,null,null,null);if(C>x){if(b.length&&b[b.length-1].end===a&&b[b.length-1].typeId===i[x].typeId)break;if(b.length&&this._stylerAdapter.blockSpansBeyondEnd(b[b.length-1])){x++;for(var T=b[b.length-1].getBlocks(),E=(T.length?T[T.length-1]:b[b.length-1]).typeId;C>x;){if(i[x].typeId===E){var L=i[x].end+f;L=Math.min(L,m-1),s=g.getText(l,L+1);var k=this.computeBlocks(g,s,y,l,null,null,null);if(k.length&&k[k.length-1].end===L){a=L,b=k;break}}x++}if(C>x)break}}else if(!b.length||b[b.length-1].end<=y.contentEnd+f)break;if(!r){a=m,x=C,s=g.getText(l,a),b=this.computeBlocks(g,s,y,l,null,null,null);break}y=r,o=!0}this._rootBlock.adjustBounds(h,f),x=Math.min(x+1,C);var A;if(o||(o=x-w!==b.length),!o)for(var M=0;Mh&&(G-=f),$>h&&($-=f),h>=G&&$>h&&v>=G&&$>v){var z=g.getLineAtOffset(H.start),Y=g.getLineAtOffset(H.end);z!==Y?H.expanded||H.expand():P.push(H)}}else P.push(H),H.expand()}else H.type===e.AnnotationType.ANNOTATION_TASK&&y.start<=H.start&&H.end<=y.end&&P.push(H)}K&&W.getBlocks().forEach(function(e){this._updateFolding(e,g,p,V,F,l,a)}.bind(this)),this._detectTasks&&this._computeTasks(y,g,F,l,a),this._annotationProviders.forEach(function(e){var t=[],n=[];e(this._annotationModel,g,y,l,a,t,n),P=P.concat(t),F=F.concat(n)}.bind(this)),this._annotationModel.replaceAnnotations(P,F)}},_onMouseDown:function(e){if(2===e.clickCount){var t=this._view.getModel(),n=this._view.getOffsetAtLocation(e.x,e.y);if(n>0){var i=n-1,r=t;t.getBaseModel&&(i=t.mapOffset(i),r=t.getBaseModel());var o=this._findBlock(this._rootBlock,i),s=this._findMatchingBracket(r,o,i);if(-1!==s){e.preventDefault();var a=s;t.getBaseModel&&(a=t.mapOffset(a,!0)),n>a&&(n--,a++),this._view.setSelection(a,n)}}}},_onSelection:function(t){function n(e){var t={};return e.some(function(e){return e.isEmpty()?(t[l.getLineAtOffset(e.start).toString()]=!0,!1):!0})?{}:t}function i(e,t){for(var n in e)t[n]||(r=n>>0,a.redrawLines(r,r+1))}var r,o=Array.isArray(t.oldValue)?t.oldValue:[t.oldValue],s=Array.isArray(t.newValue)?t.newValue:[t.newValue],a=this._view,l=a.getModel();if(this._highlightCaretLine){var d=n(o),h=n(s);i(d,h),i(h,d)}if(this._annotationModel){var c,u,f=this._bracketAnnotations;if(1===s.length&&s[0].isEmpty()&&(u=s[0].getCaret())>0){var p=u-1;l.getBaseModel&&(p=l.mapOffset(p),l=l.getBaseModel());var g=this._findBlock(this._rootBlock,p),v=this._findMatchingBracket(l,g,p);-1!==v&&(c=[e.AnnotationType.createAnnotation(e.AnnotationType.ANNOTATION_MATCHING_BRACKET,v,v+1),e.AnnotationType.createAnnotation(e.AnnotationType.ANNOTATION_CURRENT_BRACKET,p,p+1)])}this._bracketAnnotations=c,this._annotationModel.replaceAnnotations(f,c)}},_spliceStyles:function(e,t,n,r){var o=e.regex;o.lastIndex=0;for(var s=0,a=o.exec(n);a;){for(var l=r+a.index;s/,func:function(){return"atomic group"}}],toRegExp:function(e){function t(e,t){throw new Error('Unsupported regex feature "'+e+'": "'+t[0]+'" at index: '+t.index+" in "+t.input)}function n(e){for(var t="",n=!1,i=e.length,r=0;i>r;){var o=e.charAt(r);if(n||"#"!==o)if(!n&&/\s/.test(o))for(;i>r&&/\s/.test(o);)o=e.charAt(++r);else"\\"===o?(t+=o,/\s/.test(e.charAt(r+1))||(t+=e.charAt(r+1),r+=1),r+=1):"["===o?(n=!0,t+=o,r+=1):"]"===o?(n=!1,t+=o,r+=1):(t+=o,r+=1);else for(;i>r&&"\r"!==o&&"\n"!==o;)o=e.charAt(++r)}return t}var r,o="";for(e=i.processGlobalFlag("x",e,function(e){return n(e)}),e=i.processGlobalFlag("i",e,function(e){return o+="i",e}),r=0;ro&&-1===r;o++)switch(e.charAt(o)){case"\\":o++;break;case"(":n++;break;case")":n--,0===n&&(r=o)}return r}var r="(?"+e+")",o="(?"+e+":";if(t.substring(0,r.length)===r)return n(t.substring(r.length));if(t.substring(0,o.length)===o){var s=i(t,0);if(sv;v++){var m=l[l.length-1],_=s.charAt(v);switch(_){case"(":m===o&&(l.pop(),f.push(")"),h[h.length-1].end=v);var y=a>v+2?s.charAt(v+1)+""+s.charAt(v+2):null;if("?:"===y||"?="===y||"?!"===y){var C;"?:"===y?C=n:(C=r,d++),l.push(C),h.push({start:v,end:-1,type:C}),f.push(_),f.push(y),v+=y.length}else l.push(i),h.push({start:v,end:-1,type:i,oldNum:c,num:u}),f.push(_),0===d&&(g[u]=null),p[c]=u,c++,u++;break;case")":var w=l.pop();w===r&&d--,h[h.length-1].end=v,f.push(_);break;case"*":case"+":case"?":case"}":var x=_,S=s.charAt(v-1),b=v-1;if("}"===_){for(var T=v-1;"{"!==s.charAt(T)&&T>=0;T--);S=s.charAt(T-1),b=T-1,x=s.substring(T,v+1)}var E=h[h.length-1];if(")"===S&&(E.type===i||E.type===o)){f.splice(E.start,0,"("),f.push(x),f.push(")");for(var L={start:E.start,end:f.length-1,type:o,num:E.num},k=0;k=E.start&&w.end<=b&&(w.start+=1,w.end+=1,w.num=w.num+1,w.type===i&&(p[w.oldNum]=w.num));h.push(L),u++;break}default:if("|"!==_&&m!==i&&m!==o&&0===d&&(l.push(o),h.push({start:v,end:-1,type:o,num:u}),f.push("("),g[u]=null,u++),f.push(_),"\\"===_){var A=s.charAt(v+1);f.push(A),v+=1}}}for(;l.length;)l.pop(),f.push(")");var M=new RegExp(f.join("")),D={};t=t||p;for(var O in t)t.hasOwnProperty(O)&&(D[O]="\\"+t[O]);return M=this.getSubstitutedRegex(M,D,!1),[M,p,g]},complexCaptures:function(e){if(!e)return!1;for(var t in e)if(e.hasOwnProperty(t)&&"0"!==t)return!0;return!1}};return n.prototype={initialize:function(e){this.textView=e,this.textView.stylerOptions=this;var t=this;this._listener={onModelChanged:function(e){t.onModelChanged(e)},onDestroy:function(e){t.onDestroy(e)},onLineStyle:function(e){t.onLineStyle(e)},onStorage:function(e){t.onStorage(e)}},e.addEventListener("ModelChanged",this._listener.onModelChanged),e.addEventListener("Destroy",this._listener.onDestroy),e.addEventListener("LineStyle",this._listener.onLineStyle),e.redrawLines()},onDestroy:function(){this.destroy()},destroy:function(){this.textView&&(this.textView.removeEventListener("ModelChanged",this._listener.onModelChanged),this.textView.removeEventListener("Destroy",this._listener.onDestroy),this.textView.removeEventListener("LineStyle",this._listener.onLineStyle),this.textView=null),this.grammar=null,this._styles=null,this._tree=null,this._listener=null},preprocess:function(e){for(var t=[e];0!==t.length;){var n=t.pop();if((!n._resolvedRule||!n._typedRule)&&(n._resolvedRule=this._resolve(n),n._typedRule=this._createTypedRule(n),this.addStyles(n.name),this.addStyles(n.contentName),this.addStylesForCaptures(n.captures),this.addStylesForCaptures(n.beginCaptures),this.addStylesForCaptures(n.endCaptures),n._resolvedRule!==n&&t.push(n._resolvedRule),n.patterns))for(var i=0;i0;)e.push(t[--n])},exec:function(e,t,n){var i=e.exec(t);return i&&(i.index+=n),e.lastIndex=0,i},afterMatch:function(e){return e.index+e[0].length},getEndMatch:function(e,t,n){if(e instanceof this.BeginEndNode){var i=e.rule,r=e.endRegexSubstituted||i.endRegex;return r?this.exec(r,t,n):null}return null},initialParse:function(){var e=(this.textView.getModel().getCharCount(),new this.ContainerNode(null,this.grammar._typedRule));this._tree=e,this.parse(this._tree,!1,0)},onModelChanged:function(e){var t=e.addedCharCount,n=(e.addedLineCount,e.removedCharCount),i=(e.removedLineCount,e.start);if(this._tree){var r=this.textView.getModel(),o=r.getCharCount(),s=r.getLineEnd(r.getLineAtOffset(i)-1),a=this.getFirstDamaged(s,s);s=-1===s?0:s;var l;l=a?this.parse(a,!0,s,i,t,n):o,this.textView.redrawRange(s,l)}else this.initialParse()},getFirstDamaged:function(e,t){if(0>e)return this._tree;for(var n=[this._tree],i=null;n.length;){var r=n.pop();if(!r.parent||this.isDamaged(r,e,t)){r instanceof this.BeginEndNode&&(i=r);for(var o=0;ot},parse:function(e,t,n,i,r,o){var s=this.textView.getModel(),a=s.getLineStart(s.getLineCount()-1),l=s.getCharCount(),d=this.getInitialExpected(e,n),h=-1;if(t){e.repaired=!0,e.endNeedsUpdate=!0;var c=e.children[e.children.length-1],u=r-o,f=c?s.getLineEnd(s.getLineAtOffset(c.end+u)):-1,p=s.getLineEnd(s.getLineAtOffset(i+o));h=Math.max(f,p)}h=-1===h?l:h;for(var g=d,v=e,m=!1,_=n,y=-1;v&&(!t||h>_);){var C=this.getNextMatch(s,v,_);C||(_=_>=a?l:s.getLineStart(s.getLineAtOffset(_)+1));var w=C&&C.match,x=C&&C.rule,S=C&&C.isSub,b=C&&C.isEnd;if(S){if(_=this.afterMatch(w),x instanceof this.BeginEndRule)if(m=!0,t&&x===g.rule&&v===g.parent){var T=g;T.setStart(w),T.repaired=!0,T.endNeedsUpdate=!0,v=T,g=this.getNextExpected(g,"begin")}else{t&&(this.prune(v,g),t=!1);var E=new this.BeginEndNode(v,x,w);v.addChild(E),v=E}}else(b||_===l)&&(v instanceof this.BeginEndNode&&(w?(m=!0,y=Math.max(y,v.end),v.setEnd(w),_=this.afterMatch(w),t&&v===g&&v.parent===g.parent?(v.repaired=!0,delete v.endNeedsUpdate,g=this.getNextExpected(g,"end")):t&&(this.prune(v,g),t=!1)):(v.setEnd(l),delete v.endNeedsUpdate)),v=v.parent);t&&_>=h&&!m&&(this.prune(e,d),t=!1)}return this.removeUnrepairedChildren(e,t,n),this.cleanup(t,e,n,h,l,r,o),t?Math.max(y,_):_},removeUnrepairedChildren:function(e,t,n){if(t){for(var i=e.children,r=-1,o=0;o=t)return i}else if(e instanceof this.BeginEndNode&&e.endMatch){var r=e.endMatch.index;for(n=0;n=t));n++);if(i&&i.startr;){var l=this.getNextMatch(e,t,r);if(!l)break;var d=l&&l.match,h=l&&l.rule,c=l&&l.isSub,u=l&&l.isEnd;d.index!==r&&a.push({start:r,end:d.index,node:t}),c?(r=this.afterMatch(d),h instanceof this.BeginEndRule?(this.addBeginScope(s,d,h),t=o,o=this.getNextExpected(o,"begin")):this.addMatchScope(s,d,h)):u&&(r=this.afterMatch(d),this.addEndScope(s,d,h),o=this.getNextExpected(o,"end"),t=t.parent)}i>r&&a.push({start:r,end:i,node:t});var f=this.getInheritedLineScope(a,n,i);return s.concat(f)},getInheritedLineScope:function(e){for(var t=[],n=0;na;a++)i.push(r.children[a])}return n.reverse()},toStyleRanges:function(e){for(var t=[],n=0;n",rangeStyle:{styleClass:"annotationRange error"}}),i.prototype={initialize:function(e,t,i){this.textView=e,this.serviceRegistry=t,this.annotationModel=i,this.services=[];var o=this;this.listener={onModelChanging:function(e){o.onModelChanging(e)},onModelChanged:function(e){o.onModelChanged(e)},onDestroy:function(e){o.onDestroy(e)},onLineStyle:function(e){o.onLineStyle(e)},onStyleReady:function(e){o.onStyleReady(e)},onServiceAdded:function(e){o.onServiceAdded(e.serviceReference,o.serviceRegistry.getService(e.serviceReference))},onServiceRemoved:function(e){o.onServiceRemoved(e.serviceReference,o.serviceRegistry.getService(e.serviceReference))}},e.addEventListener("ModelChanging",this.listener.onModelChanging),e.addEventListener("ModelChanged",this.listener.onModelChanged),e.addEventListener("Destroy",this.listener.onDestroy),e.addEventListener("LineStyle",this.listener.onLineStyle),t.addEventListener("registered",this.listener.onServiceAdded),t.addEventListener("unregistering",this.listener.onServiceRemoved);for(var s=t.getServiceReferences(r),a=0;a=f;f++){a=f;var p=this.lineStyles[a],g=p&&p.errors,v=s.getLineStart(a);if(g)for(var m=0;mr;r++){var o=e[r];i.push({start:o.start+t,end:o.end+t,style:o.style})}return i}var n=this.lineStyles[e.lineIndex];n&&(n.ranges?e.ranges=t(n.ranges,e.lineStart):n.style&&(e.style=n.style))},_getEmptyStyle:function(e){for(var t=[],n=0;e>n;n++)t.push(null);return t},setContentType:function(e){if(this.contentType=e,this.services)for(var t=0;t=0;s--){var c=e[s];if(c&&!c._error&&p(c)){r=c;break}}var u;if(r){var f=r.getProperty("type");if("highlighter"===f)u=new i(d,o,h),u.setContentType(l);else if("grammar"===f||!a&&"undefined"==typeof f){var g=r.getProperty("grammar");u=new n.TextMateStyler(d,g,C)}else if(a){var v=[];for(var m in this.orionGrammars)v.push(this.orionGrammars[m]);var _=new t.createPatternBasedAdapter(v,r.getProperty("id"),l.id);u=new t.TextStyler(d,h,_)}}else!a||l&&"text/x-markdown"===l.id||(_=new t.createPatternBasedAdapter([],""),u=new t.TextStyler(d,h,_));return u})}function s(e,t){this.serviceRegistry=e,this.contentTypeService=t,this.styler=null}var a=1;return s.prototype={setup:function(e,t,n,i,r){r="undefined"==typeof r?!0:r,this.styler&&(this.styler.destroy&&this.styler.destroy(),this.styler=null);var s=this;return o(this.serviceRegistry,this.contentTypeService?this.contentTypeService:this.serviceRegistry.getService("orion.core.contentTypeRegistry"),e,t,n,i,r).then(function(e){return s.styler=e,e})},getStyler:function(){return this.styler}},{createStyler:o,SyntaxHighlighter:s}}),define("orion/markOccurrences",["orion/Deferred"],function(e){function t(e,t,n){this.registry=e,this.inputManager=t,this.editor=n}return t.prototype={setOccurrencesVisible:function(e){this.occurrencesVisible!==e&&(this.occurrencesVisible=e,e||this.editor.showOccurrences([]))},findOccurrences:function(){function t(t,n,i){function r(e,t,n){var i=t.getProperty("contentType");return o.isSomeExtensionOf(n,i).then(function(e){return e?t:null})}for(var o=t.getService("orion.core.contentTypeRegistry"),s=t.getServiceReferences("orion.edit.occurrences"),a=[],l=0;l1)return void i.editor.showOccurrences([]);var o={selection:t[0],contentType:i.inputManager.getContentType().id};r.computeOccurrences(e.getEditorContext(),o).then(function(e){i.editor.showOccurrences(e)})},500))};i.inputManager.addEventListener("InputChanged",function(e){var r=i.editor.getTextView();r&&(r.removeEventListener("Selection",o),t(i.registry,e.contentType,e.title).then(function(e){e&&0!==e.length?r.addEventListener("Selection",o):n&&window.clearTimeout(n)}))})}},{MarkOccurrences:t}}),define("orion/syntaxchecker",["orion/Deferred","orion/edit/editorContext","orion/i18nUtil"],function(e,t){function n(t,n,i){function r(e,t){var n=e.getProperty("contentType");return o.isSomeExtensionOf(t,n).then(function(t){return t?e:null})}for(var o=t.getService("orion.core.contentTypeRegistry"),s=t.getServiceReferences("orion.edit.validator"),a=[],l=0;l1&&s===t.getLineStart(t.getLineCount()-1)){var a=t.getLineCount()-2,l=t.getLineStart(a),d=t.getLineEnd(a);l===d?i.start=i.end=d:(i.start=d-1,i.end=d)}}}}},i}();return{SyntaxChecker:i,getValidators:n}}),define("orion/liveEditSession",["orion/Deferred"],function(e){function t(e){return e instanceof Error?e:new Error(e)}function n(e,t){this.registry=e,this.editor=t}var i,r=[];return n.prototype={start:function(n,o){function s(n,i){function r(e,t){var n=e.getProperty("contentType");return o.isSomeExtensionOf(t,n).then(function(t){return t?e:null})}for(var o=n.getService("orion.core.contentTypeRegistry"),s=n.getServiceReferences("orion.edit.live"),a=[],l=0;ls;s++){this._addFileModeProperties(this._diffContents[s],r);var a=this._parseHunkRange(s);a&&this._hunkRanges.push(a)}if(0===this._hunkRanges.length)return r.outPutFile=e,r;this._DEBUG&&(console.log("***Diff contents: \n"),this._diffContents.forEach(function(e){console.log(e)}),console.log("***Hunk ranges: \n"),console.log(JSON.stringify(this._hunkRanges)));for(var l=0;l0){console.log(" **Diff content on change/add: \n");for(var t=0;tc;c++)if(0!==this._diffContents[c].length){var u=this._diffContents[c][0];if("\\"!==u||n!==this._diffContents[c].substring(0,this._diffContents[c].length-1)&&n!==this._diffContents[c]){switch(u){case"-":case"+":case" ":break;default:continue}if(t!==u){switch("+"===u&&(d=c),"-"===u&&(h=c),t){case" ":a=this._hunkRanges[e][1]+o,l=this._hunkRanges[e][3]+s;break;case"-":this._createMinusBlock(a,l,this._hunkRanges[e][1]+o-a,h);break;case"+":this._createPlusBlock(a,l,this._hunkRanges[e][3]+s-l,d)}t=u}switch(u){case"-":o++;break;case"+":s++;break;case" ":o++,s++}}else"-"===t?this._oNewLineAtEnd=!1:" "===t?(this._nNewLineAtEnd=!1,this._oNewLineAtEnd=!1):this._nNewLineAtEnd=!1,c>i&&"\r"===this._diffContents[c-1][this._diffContents[c-1].length-1]&&(this._diffContents[c-1]=this._diffContents[c-1].substring(0,this._diffContents[c-1].length-1))}switch(t){case"-":this._createMinusBlock(a,l,this._hunkRanges[e][1]+o-a,h);break;case"+":this._createPlusBlock(a,l,this._hunkRanges[e][3]+s-l,d)}},_detectConflictes:function(e,t){if(0>e)return!1;for(var n=e+t,i=e;n>i;i++){var r=this._diffContents[i];if(r.indexOf("<<<<<")>-1||r.indexOf(">>>>>")>-1)return!0}return!1},_buildMap:function(e){for(var t,n=this._oBlocks.length,i=this._oFileContents.length,r=0,o=1,s=0;n>s;s++)t=this._oBlocks[s][0]-o,t>0&&(this._deltaMap.push([t,t,0]),r+=t),this._deltaMap.push(e&&this._detectConflictes(this._nBlocks[s][2],this._nBlocks[s][1])?[this._nBlocks[s][1],this._oBlocks[s][1],this._nBlocks[s][2]+1,1]:[this._nBlocks[s][1],this._oBlocks[s][1],this._nBlocks[s][2]+1]),r+=this._oBlocks[s][1],o=this._oBlocks[s][0]+this._oBlocks[s][1];if(i-o>0&&(this._deltaMap.push([i-o+1,i-o+1,0]),r+=i-o+1),i>r){t=i-r;var a=this._deltaMap[this._deltaMap.length-1];0===a[2]?(a[0]+=t,a[1]+=t):-1===a[2]?this._deltaMap.push([t,t,0]):this._nNewLineAtEnd===this._oNewLineAtEnd?this._deltaMap.push([t,t,0]):(this._nNewLineAtEnd&&(a[0]+=t),this._oNewLineAtEnd&&(a[1]+=t))}},_buildNewFile:function(){var e,t,n=1,i=!1,r=this._deltaMap.length;for(e=0;r>e;e++){if(i=!1,0===this._deltaMap[e][2]){for(t=0;t0)for(t=0;t=0?n:1)}else t.push(1)},_parseHunkRange:function(e){var t=this._diffContents[e],n=/^@@\s*-([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*\+([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*@@+/,i=/^@@\s*\+([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*-([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*@@+/,r=n.exec(t),o=null;return r&&5===r.length?(o=[e],this._converHRangeBody(r[1],o),this._converHRangeBody(r[2],o),this._converHRangeBody(r[3],o),this._converHRangeBody(r[4],o)):(r=i.exec(t),r&&5===r.length&&(o=[e],this._converHRangeBody(r[3],o),this._converHRangeBody(r[4],o),this._converHRangeBody(r[1],o),this._converHRangeBody(r[2],o))),o}},e}(),e}),define("orion/differ",["orion/extensionCommands","orion/compare/diffParser"],function(e,t){function n(e,t,n){this._serviceRegistry=e,this._inputManager=t,this._editor=n,this._enabled=!1,this.init()}return n.prototype={init:function(){var e=this;this._changeListener=function(){e._enabled&&(e.occurrenceTimer&&window.clearTimeout(e.occurrenceTimer),e.occurrenceTimer=window.setTimeout(function(){e.occurrenceTimer=null,e.doDiff()},500))},this._inputManager.addEventListener("InputChanged",function(){var t=e._editor.getTextView();t&&t.removeEventListener("ModelChanged",e._changeListener);var n=e.service=e.getDiffer();n&&t&&t.addEventListener("ModelChanged",e._changeListener)})},isVisible:function(){return!!this.getDiffer()},getDiffer:function(){for(var t=this._inputManager.getFileMetadata(),n=this._serviceRegistry.getServiceReferences("orion.edit.diff"),i=0;i0&&(this._dropdownNode.style.left=Math.floor(n-d)+"px");var h=i+a-(l.top+l.height);h>0&&(this._dropdownNode.style.top=Math.floor(i-h)+"px")}else r.prototype._positionDropdown.call(this)},i.prototype.destroy=function(){this._triggerNode.removeEventListener("contextmenu",this._boundcontextmenuEventHandler,!0),this._triggerNode.removeEventListener("click",this._boundContextMenuCloser,!1),window.removeEventListener("contextmenu",this._boundContextMenuCloser,!1),this._dropdownNode.dropdown=null,r.prototype.destroy.call(this)},{ContextMenu:i}}),define("orion/editorView",["i18n!orion/edit/nls/messages","orion/editor/editor","orion/editor/eventTarget","orion/editor/textView","orion/editor/textModel","orion/editor/projectionTextModel","orion/editor/editorFeatures","orion/hover","orion/editor/contentAssist","orion/editor/emacs","orion/editor/vi","orion/editorPreferences","orion/widgets/themes/ThemePreferences","orion/widgets/themes/editor/ThemeData","orion/widgets/settings/EditorSettings","orion/searchAndReplace/textSearcher","orion/editorCommands","orion/globalCommands","orion/edit/dispatcher","orion/edit/editorContext","orion/edit/typedefs","orion/highlight","orion/markOccurrences","orion/syntaxchecker","orion/liveEditSession","orion/problems","orion/blamer","orion/differ","orion/keyBinding","orion/util","orion/Deferred","orion/webui/contextmenu","orion/metrics","orion/objects"],function(e,t,n,i,r,o,s,a,l,d,h,c,u,f,p,g,v,m,_,y,C,w,x,S,b,T,E,L,k,A,M,D,O,N){function I(e,t){for(var n=0;n0&&(i=n.extension[0]);var r,o=B+this.id+"/foo."+i,s=o===this.lastFileLocation;return r=s||!this.lastFileLocation?(new M).resolve():this.fileClient.deleteFile(this.lastFileLocation),r.then(function(){return this.fileClient.write(o,e).then(function(){this.lastFileLocation=o,s?this.inputManager.load():this.inputManager.setInput(o)}.bind(this))}.bind(this))},getParent:function(){return this._parent},getSettings:function(){return this.settings},setParent:function(e){this._parent=e},updateSourceCodeActions:function(e,t){t&&(t.setAutoPairParentheses(e.autoPairParentheses),t.setAutoPairBraces(e.autoPairBraces),t.setAutoPairSquareBrackets(e.autoPairSquareBrackets),t.setAutoPairAngleBrackets(e.autoPairAngleBrackets),t.setAutoPairQuotations(e.autoPairQuotations),t.setAutoCompleteComments(e.autoCompleteComments),t.setSmartIndentation(e.smartIndentation))},updateViewOptions:function(e){var t=0;e.showMargin&&(t=e.marginOffset,"number"!=typeof t&&(t=e.marginOffset=parseInt(t,10)));var n=0;return e.wordWrap&&(n=t),{readonly:this.readonly||this.inputManager.getReadOnly(),tabSize:e.tabSize||4,expandTab:e.expandTab,wrapMode:e.wordWrap,wrapOffset:n,marginOffset:t,scrollAnimation:e.scrollAnimation?e.scrollAnimationTimeout:0}},updateSettings:function(e){this.settings=e;var t=this.editor,n=this.inputManager;n.setAutoLoadEnabled(e.autoLoad),n.setAutoSaveTimeout(e.autoSave?e.autoSaveTimeout:-1),n.setSaveDiffsEnabled(e.saveDiffs),n.setEncodingCharset(e.encodingCharset),this.differ.setEnabled(this.settings.diffService),this.updateStyler(e);var i=t.getTextView();i&&(this.updateKeyMode(e,i),i.setOptions(this.updateViewOptions(e))),this.updateSourceCodeActions(e,t.getSourceCodeActions()),t.setAnnotationRulerVisible(e.annotationRuler),t.setLineNumberRulerVisible(e.lineNumberRuler),t.setFoldingRulerVisible(e.foldingRuler),t.setOverviewRulerVisible(e.overviewRuler),t.setZoomRulerVisible(e.zoomRuler),this.renderToolbars&&this.renderToolbars(n.getFileMetadata()),this.markOccurrences.setOccurrencesVisible(e.showOccurrences),t.getContentAssist()&&t.getContentAssist().setAutoTriggerEnabled(e.contentAssistAutoTrigger),this.dispatchEvent({type:"Settings",newSettings:this.settings})},updateStyler:function(e){var t=this.syntaxHighlighter.getStyler();t&&t.setWhitespacesVisible&&t.setWhitespacesVisible(e.showWhitespaces,!0)},createSession:function(e){var t=this.editor,n=t.getTextView(),i=this.inputManager;if(n&&i){var r=i.getFileMetadata();r&&(e.session={get:function(){return sessionStorage.editorViewSection?JSON.parse(sessionStorage.editorViewSection):{}},apply:function(e){var i=this.get(),o=i[r.Location];o&&o.ETag===r.ETag&&(t.setSelections(o.selections),n.setTopIndex(o.topIndex,e?function(){}:void 0))},save:function(){var e=this.get();e[r.Location]={ETag:r.ETag,topIndex:n.getTopIndex(),selections:t.getSelections().map(function(e){return e.getOrientedSelection()})},sessionStorage.editorViewSection=JSON.stringify(e)}})}},_init:function(){this.preferences&&(this.editorCommands.editorPreferences=this.editorPreferences=this.editorCommands.editorPreferences||new c.EditorPreferences(this.preferences),this.editorPreferences.addEventListener("Changed",function(e){var t=e.preferences;t?this.updateSettings(t):this.editorPreferences.getPrefs(this.updateSettings.bind(this))}.bind(this)),this.editorCommands.themePreferences=this.themePreferences=this.editorCommands.themePreferences||new u.ThemePreferences(this.preferences,new f.ThemeData),this.themePreferences.apply());var n=this,d=this.readonly,h=this.commandRegistry,m=this.serviceRegistry,_=this.activateContext,C=this.inputManager,w=this.progress,A=this.contentTypeRegistry,M=this.editorCommands,D=function(){var e=n.updateViewOptions(n.settings);N.mixin(e,{parent:n._parent,model:new o.ProjectionTextModel(n.model||new r.TextModel),wrappable:!0});var t=new i.TextView(e);return t},O=function(t,i,r,o){var a=n.textSearcher=g.TextSearcher?new g.TextSearcher(t,m,h,r):null,l=(new s.KeyBindingsFactory).createKeyBindings(t,r,o,a);n.updateSourceCodeActions(n.settings,l.sourceCodeActions);var d=t.getTextView();return d.setAction("toggleWrapMode",function(){d.invokeAction("toggleWrapMode",!0);var e=d.getOptions("wrapMode");return n.settings.wordWrap=e,n.editorPreferences&&n.editorPreferences.setPrefs(n.settings),!0}),d.setKeyBinding(new k.KeyStroke("z",!0,!1,!0),"toggleZoomRuler"),d.setAction("toggleZoomRuler",function(){return n.settings.zoomRulerVisible?(n.settings.zoomRuler=!n.settings.zoomRuler,n.editorPreferences&&n.editorPreferences.setPrefs(n.settings),!0):!1},{name:e.toggleZoomRuler}),n.vi=n.emacs=null,n.updateKeyMode(n.settings,d),M.overwriteKeyBindings(t),l},R=function(e,t,i){var r=C.getContentType(),o=e.getTitle(),s=m.getServiceReferences("orion.edit.contentAssist").concat(m.getServiceReferences("orion.edit.contentassist")),a=i&&i.providers;a||(a=s.map(function(e){var t=e.getProperty("contentType"),n=e.getProperty("pattern");if(t&&A.isSomeExtensionOf(r,t)||n&&new RegExp(n).test(o)){var i=m.getService(e),s=e.getProperty("service.id").toString(),a=e.getProperty("charTriggers"),l=e.getProperty("excludedStyles");return a&&(a=new RegExp(a)),l&&(l=new RegExp(l)),{provider:i,id:s,charTriggers:a,excludedStyles:l}}return null}).filter(function(e){return!!e}));var l={};Object.keys(y).forEach(function(e){"function"==typeof y[e]&&(l[e]=y[e].bind(null,m,n.editContextServiceID))}),t.setEditorContextProvider(l),t.setProviders(a),t.setAutoTriggerEnabled(n.settings.contentAssistAutoTrigger),t.setProgress(w),t.setStyleAccessor(n.getStyleAccessor())},B=d?null:{createContentAssistMode:function(e){var t=new l.ContentAssist(e.getTextView(),m);t.addEventListener("Activating",R.bind(null,e,t));var n=new l.ContentAssistWidget(t,"contentassist"),i=new l.ContentAssistMode(t,n);return t.setMode(i),R(e,t),t.initialize(),i}},F=this.editor=new t.Editor({textViewFactory:D,undoStackFactory:n.undoStack?{createUndoStack:function(e){return n.undoStack.setView(e.getTextView()),n.undoStack}}:new s.UndoFactory,textDNDFactory:new s.TextDNDFactory,annotationFactory:new s.AnnotationFactory,foldingRulerFactory:new s.FoldingRulerFactory,zoomRulerFactory:new s.ZoomRulerFactory,lineNumberRulerFactory:new s.LineNumberRulerFactory,hoverFactory:new a.HoverFactory(m,C,h),contentAssistFactory:B,keyBindingFactory:O,statusReporter:this.statusReporter,domNode:this._parent});F.id="orion.editor",F.processParameters=function(e){return I(e,["start","end","line","offset","length"]),this.showSelection(e.start,e.end,e.line,e.offset,e.length)},F.getEditorContext=function(){return y.getEditorContext(m,n.editContextServiceID)},this.dispatcher=new P(this.serviceRegistry,this.contentTypeRegistry,F,C),this.themePreferences&&this.editorPreferences&&(this.localSettings=p?new p({local:!0,editor:F,themePreferences:this.themePreferences,preferences:this.editorPreferences}):null);var V=new b(m,F);C.addEventListener("InputChanging",function(e){n.createSession(e)}),window.addEventListener("beforeunload",function(e){n.createSession(e),e.session&&e.session.save()}),C.addEventListener("InputChanged",function(e){n.createSession(e);var t=F.getTextView();t?(V.start(C.getContentType(),e.title),t.setOptions(this.updateViewOptions(this.settings)),this.syntaxHighlighter.setup(e.contentType,F.getTextView(),F.getAnnotationModel(),e.title,!0).then(function(){this.updateStyler(this.settings),F.getContentAssist()&&R(F,F.getContentAssist())}.bind(this)),t.onInputChanged&&t.onInputChanged({type:e.type})):V.start()}.bind(this)),C.addEventListener("Saving",function(e){n.settings.trimTrailingWhiteSpace&&F.getTextView().invokeAction("trimTrailingWhitespaces");var t=F.getTextView();t&&t.onSaving&&t.onSaving({type:e.type})}),this.blamer=new E.Blamer(m,C,F),this.differ=new L.Differ(m,C,F),this.problemService=new T.ProblemService(m,this.problemsServiceID);var U=m.getService(this.problemsServiceID);U&&U.addEventListener("problemsChanged",function(e){F.showProblems(e.problems)});var K=this.markOccurrences=new x.MarkOccurrences(m,C,F);K.setOccurrencesVisible(this.settings.occurrencesVisible),K.findOccurrences();var W=new S.SyntaxChecker(m,F.getModel());F.addEventListener("InputChanged",function(t){W.setTextModel(F.getModel());var i=C.getInput();W.checkSyntax(C.getContentType(),t.title,t.message,t.contents,F.getEditorContext()).then(function(e){i===C.getInput()&&m.getService(n.problemsServiceID)._setProblems(e)}),C.getReadOnly()&&F.reportStatus(e.readonly,"error")});var H=Object.create(null);["getCaretOffset","setCaretOffset","getSelection","getSelectionText","setSelection","getSelections","setSelections","getText","setText","getLineAtOffset","getLineStart","isDirty","markClean"].forEach(function(e){H[e]=F[e].bind(F)}),H.showMarkers=function(e){m.getService(n.problemsServiceID)._setProblems(e)},H.enterLinkedMode=function(e){F.getLinkedMode().enterLinkedMode(e)},H.exitLinkedMode=function(e){F.getLinkedMode().exitLinkedMode(e)},H.openEditor=function(e,t){_.openEditor(e,t)},H.getFileMetadata=function(){return n.dispatcher.getServiceFileObject()},H.setStatus=v.handleStatusMessage.bind(null,m),m.registerService(this.editContextServiceID,H,null)},create:function(){this.editor.install(),this.editorPreferences&&this.editorPreferences.getPrefs(this.updateSettings.bind(this)),this._createContextMenu()},destroy:function(){this.lastFileLocation&&this.fileClient.deleteFile(this.lastFileLocation),this.editor.uninstall()},getStyleAccessor:function(){var e=null,t=this.syntaxHighlighter.getStyler();return t&&t.getStyleAccessor&&(e=t.getStyleAccessor()),e},_createContextMenu:function(){this._editorContextMenuNode=document.createElement("ul"),this._editorContextMenuNode.className="dropdownMenu",this._editorContextMenuNode.setAttribute("role","menu"),this._parent.parentNode.appendChild(this._editorContextMenuNode);var e=this.editor.getTextView(),t=new D.ContextMenu({dropdown:this._editorContextMenuNode,triggerNode:e._clientDiv}),n=function(e){var t=e.event;t.target&&(this.commandRegistry.destroy(this._editorContextMenuNode),this.commandRegistry.renderCommands("editorContextMenuActions",this._editorContextMenuNode,null,this,"menu"),O.logEvent("contextMenu","opened","editor"))}.bind(this);t.addEventListener("triggered",n)}},n.EventTarget.addMixin(R.prototype),{EditorView:R}}),define("embeddedEditor/helper/editorSetup",["orion/editor/textModel","orion/editor/undoStack","orion/commandRegistry","orion/inputManager","orion/fileClient","orion/contentTypes","orion/editorView","orion/editorCommands","orion/objects"],function(e,t,n,i,r,o,s,a,l){function d(e){this._serviceRegistry=e.serviceRegistry,this._pluginRegistry=e.pluginRegistry,this._commandRegistry=new n.CommandRegistry({}),this._fileClient=new r.FileClient(this._serviceRegistry),this._contentTypeRegistry=new o.ContentTypeRegistry(this._serviceRegistry),this._editorCommands=new a.EditorCommandFactory({serviceRegistry:this._serviceRegistry,commandRegistry:this._commandRegistry,fileClient:this._fileClient,toolbarId:"_orion_hidden_actions",navToolbarId:"_orion_hidden_actions"}),this._progressService={progress:function(e){return e},showWhile:function(e){return e}},this._serviceRegistry.registerService("orion.page.progress",this._progressService)}var h=0;return l.mixin(d.prototype,{destroy:function(){},createInputManager:function(){var e=this._inputManager=new i.InputManager({serviceRegistry:this._serviceRegistry,fileClient:this._fileClient,progressService:this._progressService,selection:this.selection,contentTypeRegistry:this._contentTypeRegistry});e.addEventListener("InputChanged",function(e){e.editor=this.editorView.editor,this.pageActionsScope="_orion_hidden_actions",this._commandRegistry.destroy(this.pageActionsScope),this._commandRegistry.renderCommands(this.pageActionsScope,this.pageActionsScope,e.metadata,e.editor,"tool")}.bind(this)),e.addEventListener("InputChanging",function(e){e.editor=this.editorView.editor}.bind(this))},defaultOptions:function(n){var i=new e.TextModel,r=h.toString(),o=Object.create(null);return o.openEditor=function(e,t){this.editorView.editor.setSelection(t.start,t.end)}.bind(this),{activateContext:o,id:r,parent:n,model:i,undoStack:new t.UndoStack(i,500),serviceRegistry:this._serviceRegistry,pluginRegistry:this._pluginRegistry,commandRegistry:this._commandRegistry,contentTypeRegistry:this._contentTypeRegistry,editorCommands:this._editorCommands,progressService:this._progressService,inputManager:this._inputManager,fileService:this._fileClient,problemsServiceID:"orion.core.marker"+r,editContextServiceID:"orion.edit.context"+r,editModelContextServiceID:"orion.edit.model.context"+r,readonly:!1}},createEditor:function(e){return this._editorCommands.createCommands().then(function(){return this._editorCommands.registerCommands(),this.createInputManager(),this.editorView=new s.EditorView(this.defaultOptions(e.parent)),h++,this.editorView.create(),this._inputManager.editor=this.editorView.editor,this._inputManager.setAutoSaveTimeout(300),this._editorCommands.inputManager=this._inputManager,e.contentType&&"string"==typeof e.contents&&this.editorView.setContents(e.contents,e.contentType),this.editorView}.bind(this))}}),{EditorSetupHelper:d}}),define("embeddedEditor/builder/embeddedEditor",["embeddedEditor/helper/bootstrap","embeddedEditor/helper/editorSetup","orion/objects"],function(e,t,n){function i(){}return n.mixin(i.prototype,{create:function(n){return e.startup(n).then(function(e){var i=e.serviceRegistry,r=e.pluginRegistry,o=new t.EditorSetupHelper({serviceRegistry:i,pluginRegistry:r});return o.createEditor(n)})}}),i}),define("orion/codeEdit",["embeddedEditor/builder/embeddedEditor"],function(e){return e});
\ No newline at end of file
diff --git a/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/orion-10.0/code_edit/built-codeEdit.css b/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/orion-10.0/code_edit/built-codeEdit.css
new file mode 100644
index 000000000..67b4b9ffb
--- /dev/null
+++ b/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/orion-10.0/code_edit/built-codeEdit.css
@@ -0,0 +1,2441 @@
+.textview {
+ background-color: white;
+ font-family: "Consolas", "Monaco", "Vera Mono", monospace;
+ font-size: 12px;
+ min-width: 50px;
+ min-height: 50px;
+}
+.textviewSelection {
+ background: rgb(180, 213, 255);
+}
+.textviewContent ::-moz-selection {
+ background: rgb(180, 213, 255);
+}
+.textviewContent ::selection {
+ background: rgb(180, 213, 255);
+}
+.textviewSelectionUnfocused {
+ background: lightgray;
+}
+.textviewSelectionCaret {
+ background: black;
+}
+.textviewScroll {
+ padding: 4px 2px 4px 2px;
+}
+.textviewContent {
+ cursor: auto;
+}
+.textviewLeftRuler {
+ border-right: 1px solid #eaeaea;
+}
+.textviewRightRuler {
+ border-left: 1px solid #eaeaea;
+}
+.textviewInnerRightRuler {
+ border-left: 1px solid #eaeaea;
+ background-color: white;
+}
+.textviewMarginRuler {
+ border-left: 1px solid #eaeaea;
+}
+.textviewBlockCursor {
+ background: black;
+ opacity: 0.4;
+}
+.ruler {
+}
+.ruler.annotations {
+ width: 16px;
+}
+.ruler.folding {
+ width: 14px;
+}
+.ruler.lines {
+ text-align: right;
+}
+.ruler.overview {
+ width: 14px;
+}
+.ruler.zoom {
+ width: 100px;
+ height: 100%;
+}
+.rulerLines {
+ color: silver;
+}
+.rulerLines.even
+.rulerLines.odd {
+}
+.rulerZoomWindow {
+ background-color: rgba(0, 0, 0, 0.1);
+ margin-left: 1px;
+ border: 1px solid #eee;
+ position: absolute;
+ width: calc(100% - 4px);
+ border-radius: 5px;
+ z-index: 100;
+}
+.textviewZoom {
+ font-size: 2px !important;
+ cursor: pointer;
+}
+.textviewZoom .textviewContent {
+ cursor: pointer;
+}
+.textviewZoom .textviewScroll {
+ padding: 0;
+}
+.textviewZoom .punctuation.separator.tab {
+ background-image: none;
+}
+.textviewZoom .punctuation.separator.space {
+ background-image: none;
+}
+.textviewTooltip {
+ font-family: "Consolas", "Monaco", "Vera Mono", monospace;
+ font-size: 12px;
+ background-color: #325C80;
+ color: #FAFAFA;
+ padding: 8px;
+
+ box-sizing: content-box;
+ border-radius: 3px;
+ z-index: 101;
+ position: fixed;
+ overflow: hidden;
+}
+.tooltipTheme .textviewScroll {
+ padding: 0;
+}
+.tooltipTheme .annotationLine.currentLine {
+ background-color: transparent !important;
+}
+.textviewTooltipCodeProjection {
+ border: 1px solid black !important;
+
+ padding: 0 !important;
+}
+.textviewTooltip a {
+ color: #7CC7FF;
+}
+.textviewTooltip h3 {
+ -webkit-margin-before: 0;
+ margin-top: 0;
+}
+.textviewTooltip p:first-of-type {
+ -webkit-margin-before: 0;
+ margin-top: 0;
+ -webkit-margin-after: 0;
+ margin-bottom: 0;
+}
+.textviewTooltip p {
+ word-wrap: break-word;
+}
+.textviewTooltip multi_anno {
+ font-style: normal;
+ font-weight: bold;
+}
+.textviewTooltip span {
+ vertical-align: baseline;
+}
+.textviewTooltip .tooltipRow {
+ display: table-row;
+}
+.textviewTooltip .tooltipImage {
+ display: inline-block;
+ vertical-align: middle;
+ padding: 1px;
+}
+.textviewTooltip .tooltipTitle {
+ padding-left: 3px;
+ vertical-align: middle;
+}
+.textviewTooltip .hoverTooltipTitle {
+ font-weight: normal;
+}
+.textviewTooltip .commandButton {
+ border: 1px solid #325C80;
+ background-color: inherit;
+ color: white;
+}
+.textviewTooltip .commandButton:not(.dropdownTrigger){
+ text-transform: initial;
+}
+.textViewTooltipOnFocus {
+ resize: both;
+ overflow: auto;
+}
+.textViewTooltipOnHover {
+ overflow: auto;
+}
+
+.textViewFind {
+ background-color: #ddd;
+ position: absolute;
+ top: -50px;
+ right: -1000px;
+ border: 1px solid #aaa;
+ border-top: 0;
+ border-bottom-right-radius: 4px;
+ border-bottom-left-radius: 4px;
+ padding: 2px;
+ z-index: 100;
+}
+.textViewFind.show {
+ top: 0;
+ right: 40px;
+ transition: top 0.3s ease-out;
+ -ms-transition: top 0.3s ease-out;
+ -moz-transition: top 0.3s ease-out;
+ -webkit-transition: top 0.3s ease-out;
+ -o-transition: top 0.3s ease-out;
+}
+.textViewFindButton {
+ margin-right: 1px;
+ margin-left: 0;
+}
+.textViewFindButton:first-child {
+ margin-left: 5px;
+}
+.textViewFindButton:last-child {
+ margin-right: 5px;
+}
+.textViewFindButton.checked {
+ color: blue;
+ text-decoration: underline;
+}
+.textViewReplaceInput {
+}
+.textViewFindInput {
+}
+.textViewFindCloseButton {
+ width: 16px;
+ height: 16px;
+ border-width: 0;
+ background-color: transparent;
+ vertical-align: baseline;
+ background-position: center;
+ background-repeat: no-repeat;
+ background-image: url(data:image/gif;base64,R0lGODlhEAAQAJEAAAAAAP///4CAgP///yH5BAEAAAMALAAAAAAQABAAAAIdnI+py+1vhECSyTluu9px+HkctnSdUh0pxLYuVAAAOw==);
+}
+.contentassist {
+ font-size:12px;
+ display: none;
+ background-color: white;
+ position: fixed;
+ top: 100px;
+ left: 100px;
+ z-index:100;
+ cursor: default;
+ min-width: 70px;
+ width: 350px;
+ height: 170px;
+ overflow-x: hidden;
+ overflow-y: auto;
+ white-space: nowrap;
+ border-radius: 5px;
+ box-shadow: rgba(0, 0, 0, 0.3) 2px 2px 10px;
+ line-height: 18px;
+ resize: both;
+}
+.contentassist:focus {
+ outline: none;
+}
+.contentassist .proposal-emphasis {
+ font-weight: normal;
+}
+.contentassist hr{
+ border: 0;
+ height: 0;
+ border-top: 1px solid rgba(0, 0, 0, 0.1);
+ border-bottom: 1px solid rgba(255, 255, 255, 0.3);
+}
+.contentassist .proposal-noemphasis-keyword {
+ background-color: aliceblue;
+ color: #CC4C07;
+ font-weight: bold;
+}
+.contentassist .proposal-noemphasis {
+ background-color: aliceblue;
+ font-weight: lighter;
+ color: black;
+}
+.contentassist .proposal-noemphasis-title-keywords {
+ background-color: aliceblue;
+ color: gray;
+}
+.contentassist .proposal-noemphasis-title {
+ background-color: aliceblue;
+ color: gray;
+ padding-top: 5px;
+}
+.contentassist .proposal-default {
+
+}
+.contentassist .proposal-name {
+ font-weight: bold;
+}
+.contentassist .selected {
+ background-color: rgb(48, 135, 179);
+ background: linear-gradient(rgb(60, 150, 190), rgb(30, 120, 160));
+ border-radius: 3px;
+ color: white;
+}
+.contentassist .cloneProposal {
+ box-shadow: rgba(0, 0, 0, 0.9) 2px 2px 8px;
+ position: fixed;
+ visibility: visible;
+ z-index: 1000;
+}
+.contentassist .proposalTag {
+ display: inline-block;
+ line-height: 11px;
+ height: 10px;
+ border-radius: 2px;
+ background: #325C80;
+ padding: 2px;
+ margin-right: 3px;
+ text-align: center;
+ color: white;
+}
+.contentassist .iconTagGreen {
+ display: inline-block;
+ font-size: 10px;
+ font-weight: bold;
+ line-height: 13px;
+ height: 12px;
+ width: 12px;
+ border-radius: 50%;
+ background: green;
+ padding: 1px;
+ margin-right: 3px;
+ text-align: center;
+ color: white;
+}
+.contentassist>div {
+ padding: 1px 3px 1px 5px;
+}
+.cloneWrapper {
+ display: block;
+ height: 0;
+ overflow: visible;
+ visibility: hidden;
+ width: 0;
+ z-index: 1000;
+}
+.contentassist.cloneWrapper:hover {
+ overflow: visible;
+}
+.comment {
+ color: #3C802C;
+}
+.constant {
+ color: blue;
+}
+.entity {
+ color: #3f7f7f;
+}
+.invalid {
+ color: red;
+ font-weight: bold;
+}
+.keyword {
+ color: #9F4177;
+ font-weight: bold;
+}
+.storage {
+ color: #7F0055;
+}
+.string {
+ color: #446fbd;
+}
+.support {
+ color: #21439c;
+}
+.variable {
+ color: #0000c0;
+}
+.punctuation.separator.space {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAAXNSR0IArs4c6QAAABVJREFUCNdj3L17938GBgYGJgYoAAAxOAM004kASgAAAABJRU5ErkJggg==");
+ background-repeat: no-repeat;
+ background-position: center center;
+}
+.punctuation.separator.tab {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAFCAYAAABmWJ3mAAAAAXNSR0IArs4c6QAAABtJREFUCNdj2L17938GKEBmYwgQJ0m8IAMDAwDemh/hgxuOkwAAAABJRU5ErkJggg==");
+ background-repeat: no-repeat;
+ background-position: left center;
+}
+.comment-block-documentation {
+ color: #00008F;
+}
+.constant-character-entity {
+ font-style: normal;
+}
+.entity-name-function, .entity-name-type {
+ font-weight: bold;
+ color: #67BBB8;
+}
+.entity-name-tag {
+ color: #98937B;
+}
+.entity-other-attribute-name {
+ color: #3C802C;
+}
+.invalid-illegal {
+ color: white;
+ background-color: red;
+}
+.invalid-deprecated {
+ text-decoration: line-through;
+}
+.keyword-operator {
+ color: #CC4C07;
+ font-weight: bold;
+}
+.meta.annotation.currentLine {
+ background-color: #EAF2FE;
+}
+.meta.tag {
+ color: #3f7f7f;
+}
+.punctuation-definition-comment {
+ color: #3f5fbf;
+}
+.punctuation-definition-string {
+ color: blue;
+}
+.variable-parameter {
+ color: #D1416F;
+}
+.variable-language {
+ color: #7F0055;
+ font-weight: bold;
+}
+.cm-meta { color: #00008F; }
+.cm-keyword { font-weight: bold; color: #7F0055; }
+.cm-atom { color: #21439c; }
+.cm-number { color: black; }
+.cm-def { color: green; }
+.cm-variable { color: black; }
+.cm-variable-2 { color: #004080; }
+.cm-variable-3 { color: #004080; }
+.cm-property { color: black; }
+.cm-operator { color: #222; }
+.cm-comment { color: green; }
+.cm-string { color: blue; }
+.cm-error { color: #ff0000; }
+.cm-qualifier { color: gray; }
+.cm-builtin { color: #7F0055; }
+.cm-bracket { color: white; background-color: gray; }
+.cm-tag { color: #3f7f7f; }
+.cm-attribute { color: #7f007f; }
+
+.annotation {
+}
+.annotation.error,
+.annotation.warning,
+.annotation.task,
+.annotation.bookmark,
+.annotation.breakpoint,
+.annotation.collapsed,
+.annotation.expanded,
+.annotation.currentBracket,
+.annotation.matchingBracket,
+.annotation.currentLine,
+.annotation.matchingSearch,
+.annotation.currentSearch,
+.annotation.readOccurrence,
+.annotation.writeOccurrence,
+.annotation.linkedGroup,
+.annotation.currentLinkedGroup,
+.annotation.selectedLinkedGroup {
+}
+.annotation.blame {
+ color: gray;
+ background-color: rgb(255, 132, 44);
+}
+.annotation.currentBlame {
+ color: black;
+ background-color: rgb(184, 103, 163);
+}
+.annotation.diffAdded {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAaSURBVBhXY5x/KoyBgSHBdCUTkIIAGIuBAQBMsAMD4UOAtwAAAABJRU5ErkJggg==);
+ background-repeat: repeat-y;
+ color: #CCCCCC;
+}
+.annotation.diffModified {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAYAAABWKLW/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAcSURBVBhXYwzdevs/AxCs8lJhYAIxYACJw8AAAIlKBAKlNXzqAAAAAElFTkSuQmCC);
+ background-repeat: repeat-y;
+ color: #CCCCCC;
+}
+.annotation.diffDeleted {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAVSURBVBhXY3growJBDP9hAMb6/x8ADgMVdmD2Og4AAAAASUVORK5CYII=);
+ background-repeat: repeat-x;
+ color: #CCCCCC;
+}
+.lines .annotation.diffAdded {
+ background-image: none;
+ background-color: rgba(159, 202, 86, 0.68);
+ color: #555555;
+}
+.lines .annotation.diffModified {
+ background-image: none;
+ background-color: rgba(85, 181, 219, 0.67);
+ color: #555555;
+}
+.annotationHTML {
+ cursor: pointer;
+ width: 16px;
+ height: 16px;
+ display: inline-block;
+ vertical-align: middle;
+ background-position: center;
+ background-repeat: no-repeat;
+}
+.annotationHTML.error {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjNGNTlDOUMxMUVDNDExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjNGNTlDOUMyMUVDNDExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6M0Y1OUM5QkYxRUM0MTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6M0Y1OUM5QzAxRUM0MTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4Be44kAAAAqklEQVR42mL8//8/AyWAiYFCQLEBLNgEX+aURgGpAiA2gAqdB+KJ4lO6l6GrZUQPA6DmqUAqC4eF04CGZOP0AtRmkOZ/QHwLSeoWVCwLqgZnGORD6TtA7ArEp6DYFSqGrAZrGBhCaTUgXg3EoVD+aqgYshraRON5JD+HQm2GueQWmhqsBkyE0ipAvBuIzaB4N1QMWQ11opERW16ARlU+UoARn5CGXmYCCDAAPz09iI0KJ9QAAAAASUVORK5CYII=");
+}
+.annotationHTML.warning {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkREMTE1OUNDMUVDMjExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkREMTE1OUNEMUVDMjExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6REQxMTU5Q0ExRUMyMTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6REQxMTU5Q0IxRUMyMTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4Kzt/qAAAA0ElEQVR42mL8//8/AyWAiYFCQLEBLLgkfl8obARSZUD8HYiLWQ3652NTx4gtDICao4HUbCDeBRVyBmI3oCHHCRoA1MwOpO4A8V+gBgWo2AMg9QaITYFi/wl5IRaIZYD4K1AjI8gSIBYBYnkg9gLirYQCMRdKc0M1KUDZIFCM1wtAG02B1Ckk+WlQSzKQxLSA3riOywUpaHxHILZHE8vA54VQNL4XFCODaHyB+B6IBZH4s7CE0Ud8LvCHhsFfKN8VihmgYqegavAnpKGVmQACDACxJDv3vmRk+gAAAABJRU5ErkJggg==");
+}
+.annotationHTML.task {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjdEMjg0RkI2MUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjdEMjg0RkI3MUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6N0QyODRGQjQxRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6N0QyODRGQjUxRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6Utm8RAAAAl0lEQVR42mL8//8/AyWAiYFCQLEBLMicqtVRRPmnLXQZIzkuuEuJF04BsTEQ15JjAEizGxB/AmJpYgz4DsTLoewrQOwJ9PNHID0ViDPwBiIURAPxBqjm2UDN74CB2wFkZxKMBSioAOJ9QI1t0JgBaS4nKhqhwAyIdwE1ugLpLHyacRkAM+QcECtTkhKViYlfxqGfmQACDAAjXCa0hW/NdQAAAABJRU5ErkJggg==");
+}
+.annotationHTML.bookmark {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjdEMjg0RkIyMUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjdEMjg0RkIzMUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6N0QyODRGQjAxRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6N0QyODRGQjExRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz54SgjJAAAAuUlEQVR42mL8//8/AyWAiYFCQFsDWrdcMAViY3xqWAhYEADEv4H4LLle8IVinIARORaAzpUHiUG5qkC8C8p2AOKHQPwDhKt9DD7gcoEREJ8H4vtImkHgAFTsKhB743QB1BWyQGo+EDujGb4JiNOBtr/AawDUEH0gdQFNWBGo+QGxgRgEpV8C8SsoO4KUWAAZsAeIDYBYB4g3A3EUwViAOl8Falsb0Mn/kMRTQYYCxe4TDIOhlZkAAgwAunFAhB2QB2cAAAAASUVORK5CYII=");
+}
+.annotationHTML.breakpoint {
+
+ background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAFheoFxkoFxnpmt0pmZxpnF7rYyWwmJwpnaFs3aDrWt8rXGBrYycwmZ3mXuNs42cu77F03GIs3aJrYGVu2J5oKCuxeDj6LK/03GLrYieu3aIoIygu6m4zcLN3MTM1m6Rs2aLriRgkSZilXGXtoGcs7LD0QBLhSZikihol3ScubrO2Yaqu5q4xpO0wpm7yabF0ZO9yaXI0r3X3tHj6P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADQALAAAAAAQABAAAAafQJpwSCwWLYZBIDAwWIw0A+FFpW6aRUPCxe1yE4ahhdCCxWSzmSwGgxGeUceKpUqhUCkVa7UK0wgkJCUjJoUmIyWBBEIEGhoeJ4YmJx6OAUIADQ0QIZIhEJoAQgEUFBUgkiAVpZdRCxIPFx8iIh8XDw4FfhYHDhgZHB0dHBkYEwdwUQoTEc3OEwp+QwYHCBMMDBMIB9JESAJLAk5Q5EVBADs=");
+}
+.annotationHTML.collapsed {
+
+ width: 14px;
+ height: 14px;
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAWBJREFUeNpi/P//PwMlgImBQkCxASzoAp++fo+6de+Z+fXbD/Jev/nAICoiwKCpqrBBTUlqNR835zJ09YzIYfDxy7eo/cevLmXlYGNQUJAEahZieP3mHcODB08Zfv/4w+BoqR3Nz8O1DKcXzt94HPqXmZlBU1+LgZNfkMHazIOBA0hr6uswgMTP33gYijcMLlx/EMAnLs7w7sc/hg9AG0HgPZB+B8S84hJA+UcBeMPg+at3DJIMnAxZzt5wsUhnXzDdsmIVWB6vAcLCfAys3z4wzN64huEfkJ/uH8IwexOQDQymD2/fgeXxekFLRWHD51evGDhZGRi4WSFSnCwgNjB2Xr1m0AbK4zXAQkdhNdPf3wx3r91g+PruLcOqnasYvn54x3Dv2k0G5r+/GMyB8nijEQTefvoadeH6w9Cbtx8GvH//kUFQkJ9BQ1V+g76m/GphPu5lBA0YenmBYgMAAgwA34GIKjmLxOUAAAAASUVORK5CYII=");
+}
+.annotationHTML.expanded {
+
+ width: 14px;
+ height: 14px;
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAT5JREFUeNrUksFKw0AURW+mTWw67SSEiG209U90r4jddFO34l+5U0HdZCHiFwiCOz9AlMSmGEpMOqk1TWJSFGyFbATR2dyZd+Dw3mOENE3xkyP8PYHrBT3OX7uW43ZefA6FUaw1dJPSyrmu1k8KBYOh37Od4XFZLEPXFdRrFMGIw3U9TKMYqw1tb0VjcxLy9eEF425CCIxWE5JcxSQGxCyNloG87gXhwWIHc4J767lTZQw8ShFGSZbxRyaQmZJxd3NRUJ6ffwQNEi6PzG/L2tjdmvFCgcKqKL2F2Olu43MzggDka+IjPuOFI7Sbujn2fUglYKkkzFIi+R0I/QDrGS8UqDX5QkhiOHYfE84hkhSTkGNgOyDJFCzjhYLTq+vDtrG8r1LZtB6fcHtzB+uhD5VWzLx+lvF/8JV/XfAuwADsrJbMGG4l4AAAAABJRU5ErkJggg==");
+}
+.annotationHTML.multiple {
+
+ background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAOdpa+yJiuFYXOFYXeBYXONwded8f+NwdmhwkHB4iPr7/ezx+fP2+2h4kOzy+Wh4iPr8/gCBwTaczjaXyjaYyjaXyTaYyfr8/QCMzQCMzACHxzao2jal2Dak1zag03iAgI/Ckn64fZrHmX+4fZLCianPopPCiarOoqbLlafLlbnXq7nWq6fLlMTcsoCIeJCQcIiIeKCYaJiQcO16ee16evGVlfGWlfahn/ahoPWhn/WhoPe1tP///////wAAAAAAACH5BAEAAD0ALAAAAAAQABAAAAaRwJ5wSCwaj8WYcslcDmObaDTGq1Zjzw4mk+FQIRcFTzaUeTRoj4zHaI+HL0lkLnnxFgsH7zWEWSoTFBMwVlUwQy6JMDCJjYwuQx8tk5MfOzk4OjcfkSssKCkqHzY0MzQ1nEIJJSYkJCcJAQCzAQlDDyIjISMiCQYEAgMGD0MNIMfHDQUHBc3EQgjR0tPSSNY9QQA7");
+}
+.annotationHTML.overlay {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJEAQvB2JVdrAAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAAD1JREFUCNdtjkESADAEAzemf69f66HMqGlOIhYiFRFRtSQBWAY7mzx+EDTL6sSgb1jTk7Q87rxyqe37fXsAa78gLyZnRgEAAAAASUVORK5CYII=");
+ background-position: right bottom;
+ position: relative;
+ top: -16px;
+}
+.annotationHTML.currentBracket {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gobFRYVQuAvZwAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAABnSURBVDjLtVJBDsAgCCuNT/L/L9if2GUHthUTRUlItEmBUoAtccFXqawWYXUSDuR4SAjMAaD9CnTY8zLR0MYTdEk668I3Ms3Zv347rEpmdV8taFN2+QsTy2YgxITApc3zEpZvJdnFDZs2IdfwZr8PAAAAAElFTkSuQmCC");
+}
+.annotationHTML.matchingBracket {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gobFRYVQuAvZwAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAABnSURBVDjLtVJBDsAgCCuNT/L/L9if2GUHthUTRUlItEmBUoAtccFXqawWYXUSDuR4SAjMAaD9CnTY8zLR0MYTdEk668I3Ms3Zv347rEpmdV8taFN2+QsTy2YgxITApc3zEpZvJdnFDZs2IdfwZr8PAAAAAElFTkSuQmCC");
+}
+.annotationHTML.currentLine {
+
+ background-image: url("data:image/gif;base64,R0lGODlhEAAQAMQAALxe0bNWzbdZzrlb0KpPx61RybBTy6VLxadNxZGctIeUroyYsG92hHyMqIKRq2l9nmyAoHGDonaIpStXj6q80k1aXf///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABYALAAAAAAQABAAAAVCoCWOZGmeKDql5ppOMGXBk/zOoltSNO6XrlXwxIPNYiMGq8SoLC2MaNPygEQkDYdikUg6LQcEoWAICAaA5HPNLoUAADs=");
+}
+.annotationHTML.matchingSearch {
+
+ background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAALClrLu1ubOpsKqdp6eapKufqMTAw7attLSrsrGnr62jq8C7v765vaebpb22vLmyuMbCxsnGycfEx8G+wcrIysTBxUltof//yf///v70jergpPvws+nWc/npqvrpqvrpq/raffffnvXVkfTVkvXUkd+9f+SiOemvV+uyXa2OX7mYZqeIXKuNX/ClO7KQYqiIXJ59Vp19VpFvTo9uTZBvTpNyUJNyUf///////wAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADgALAAAAAAQABAAAAZ4QJxwSCwajS2aS1U6DlunzcagcuKgG4sn5HJiLZ2QiHbEbj6hEapVTKVYr3OItG5TIhVGLF0npigUEAsPAjV9Q24pEhMBCAoybEUmGRcrDgcAAzNGkxcYNzAJBQSbRJ0YqBc2DaVEHJ6pGTStRBqfGBcZILRWvThBADs=");
+}
+.annotationHTML.currentSearch {
+
+ background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAALClrLu1ubOpsKqdp6eapKufqMTAw7attLSrsrGnr62jq8C7v765vaebpb22vLmyuMbCxsnGycfEx8G+wcrIysTBxUltof//yf///v70jergpPvws+nWc/npqvrpqvrpq/raffffnvXVkfTVkvXUkd+9f+SiOemvV+uyXa2OX7mYZqeIXKuNX/ClO7KQYqiIXJ59Vp19VpFvTo9uTZBvTpNyUJNyUf///////wAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADgALAAAAAAQABAAAAZ4QJxwSCwajS2aS1U6DlunzcagcuKgG4sn5HJiLZ2QiHbEbj6hEapVTKVYr3OItG5TIhVGLF0npigUEAsPAjV9Q24pEhMBCAoybEUmGRcrDgcAAzNGkxcYNzAJBQSbRJ0YqBc2DaVEHJ6pGTStRBqfGBcZILRWvThBADs=");
+}
+.annotationHTML.readOccurrence {
+
+ background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAP3ykf3zn/7lIv7kI/fbI/7nRf7scLe0oMXDtfXXHsG4gaKdgOXBF+rIJqKdhaijjNWxHeLBL6GafLuYJpmQcvvdg5OHZpyRcJ+UdLavm4+BXqGWeYZ1TYx7VZ6QcJ2NbI+Ebv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACEALAAAAAAQABAAAAZewJBwSCwaj0KMBFlULphDJwIakh6gGckCcXgyLxjuYol0PA6YMQbZqFAOhw/Gc2wHABaJhAMy2gEGBRoSHRtFf4ECDRpGERV3iQ0TRwyQBQSSRAmbAwEMnxAQClRQQQA7");
+}
+.annotationHTML.writeOccurrence {
+
+ background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAP3ykf3zn/7lIv7kI/fbI/7nRf7scLe0oMXDtfXXHsG4gaKdgOXBF+rIJqKdhaijjNWxHeLBL6GafLuYJpmQcvvdg5OHZpyRcJ+UdLavm4+BXqGWeYZ1TYx7VZ6QcJ2NbI+Ebv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACEALAAAAAAQABAAAAZewJBwSCwaj0KMBFlULphDJwIakh6gGckCcXgyLxjuYol0PA6YMQbZqFAOhw/Gc2wHABaJhAMy2gEGBRoSHRtFf4ECDRpGERV3iQ0TRwyQBQSSRAmbAwEMnxAQClRQQQA7");
+}
+.annotationHTML.blame {
+ float: left;
+}
+.annotationHTML.currentBlame {
+ float: left;
+}
+.annotationHTML.blame.single {
+ width: 32px;
+ height: 32px;
+}
+.annotationHTML.currentBlame.single {
+ width: 32px;
+ height: 32px;
+}
+.annotationHTML.diffAdded {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAaSURBVBhXY5x/KoyBgSHBdCUTkIIAGIuBAQBMsAMD4UOAtwAAAABJRU5ErkJggg==);
+ background-repeat: repeat-y;
+ background-position: left top;
+}
+.annotationHTML.diffDeleted {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAVSURBVBhXY3growJBDP9hAMb6/x8ADgMVdmD2Og4AAAAASUVORK5CYII=);
+ background-repeat: repeat-x;
+ background-position: left top;
+}
+.annotationHTML.diffModified {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAYAAABWKLW/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAcSURBVBhXYwzdevs/AxCs8lJhYAIxYACJw8AAAIlKBAKlNXzqAAAAAElFTkSuQmCC);
+ background-repeat: repeat-y;
+ background-position: left top;
+}
+.annotationOverview {
+ cursor: pointer;
+ border-radius: 2px;
+ left: 2px;
+ width: 8px;
+}
+.annotationOverview.task {
+ background-color: #93bb7a;
+ border: 1px solid #79aa59;
+}
+.annotationOverview.breakpoint {
+ background-color: lightblue;
+ border: 1px solid blue;
+}
+.annotationOverview.bookmark {
+ background-color: #84b3cf;
+ border: 1px solid #9cc2d8;
+}
+.annotationOverview.error {
+ background-color: #EFA1A7;
+ border: 1px solid #ec8a91;
+}
+.annotationOverview.warning {
+ background-color: #fce1a9;
+ border: 1px solid #face70;
+}
+.annotationOverview.currentBracket {
+ background-color: #00cc00;
+ border: 1px solid #00aa00;
+}
+.annotationOverview.matchingBracket {
+ background-color: #00cc00;
+ border: 1px solid #00aa00;
+}
+.annotationOverview.currentLine {
+ background-color: #EAF2FE;
+ border: 1px solid black;
+}
+.annotationOverview.matchingSearch {
+ background-color: #C3E1FF;
+ border: 1px solid #afcae5;
+}
+.annotationOverview.currentSearch {
+ background-color: #53D1FF;
+ border: 1px solid #42a7cc;
+}
+.annotationOverview.readOccurrence {
+ background-color: lightgray;
+ border: 1px solid black;
+}
+.annotationOverview.writeOccurrence {
+ background-color: Gold;
+ border: 1px solid darkred;
+}
+.annotationOverview.currentBlame {
+ background-color: rgb(184, 103, 163);
+ border: 1px solid black;
+}
+.annotationOverview.diffAdded {
+ background-color: rgba(159, 202, 86, 0.52);
+ border: 1px solid black;
+}
+.annotationOverview.diffDeleted {
+}
+.annotationOverview.diffModified {
+ background-color: rgba(85, 181, 219, 0.61);
+ border: 1px solid black;
+}
+.annotationRange {
+ background-repeat: repeat-x;
+ background-position: left bottom;
+}
+.annotationRange.task {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sLDhEoIrb7JmcAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAGUlEQVQI12NggIH/DGdhDCM45z/DfyiBAADgdQjGhI/4DAAAAABJRU5ErkJggg==");
+}
+.annotationRange.breakpoint {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sLDhEqHTKradgAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAIklEQVQI11XJMQ0AMAzAMGMafwrFlD19+sUKIJTFo9k+B/kQ+Qr2bIVKOgAAAABJRU5ErkJggg==");
+}
+.annotationRange.bookmark {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=");
+}
+.annotationRange.error {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==");
+}
+.annotationRange.warning {
+
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=");
+}
+.annotationRange.currentBracket {
+ background-color: #00FE00;
+}
+.annotationRange.matchingBracket {
+ background-color: #00FE00;
+}
+.annotationRange.readOccurrence {
+ background-color: lightgray;
+}
+.annotationRange.writeOccurrence {
+ background-color: yellow;
+}
+.annotationRange.matchingSearch {
+ background-color: #C3E1FF;
+}
+.annotationRange.currentSearch {
+ background-color: #53D1FF;
+}
+.annotationRange.linkedGroup {
+ outline: 1px solid grey;
+}
+.annotationRange.currentLinkedGroup {
+ background-color: #C3E1FF;
+}
+.annotationRange.selectedLinkedGroup {
+ background-color: #53D1FF;
+}
+.annotationLine {
+}
+.annotationLine.currentLine {
+ background-color: #EAF2FE;
+}
+
+.headerLayout {
+ height: 50px;
+}
+.toolbarLayout {
+ height: 50px;
+
+ display: -webkit-box;
+ display: -moz-box;
+ display: -ms-flexbox;
+ display: -webkit-flex;
+ display: flex;
+ flex-direction: row;
+ -ms-flex-direction: row;
+ -webkit-flex-direction: row;
+ -webkit-align-items: center;
+ align-items: center;
+}
+.fsToolbarLayout {
+ height: 30px;
+}
+.bannerLeftArea{
+
+ -ms-flex: 1 6 20%;
+ -moz-box-ordinal-group: 1;
+ -webkit-order: 1;
+ -ms-flex-order: 1;
+ order: 1;
+ -moz-box-flex: 1;
+ -webkit-box-flex:1;
+ -webkit-box-ordinal-group: 1;
+
+ width: 20%;
+
+ padding-left:5px;
+}
+.bannerMiddleArea{
+ -ms-flex: 3 1 60%;
+
+ -webkit-order: 2;
+ -ms-flex-order: 2;
+ order: 2;
+ -moz-box-flex: 1;
+ -moz-box-ordinal-group: 2;
+
+ -webkit-box-flex:1;
+ -webkit-box-ordinal-group: 2;
+ width: 60%;
+}
+@media only screen and (device-width: 768px) {
+
+
+ .bannerMiddleArea{
+ -ms-flex: 3 1 60%;
+
+ -webkit-order: 2;
+ -ms-flex-order: 2;
+ order: 2;
+ -moz-box-flex: 1;
+ -moz-box-ordinal-group: 2;
+
+ -webkit-box-flex:1;
+ -webkit-box-ordinal-group: 2;
+ width: 59%;
+}
+
+}
+.bannerRightArea{
+ -ms-flex: 1 6 20%;
+ -moz-box-ordinal-group: 3;
+ -webkit-order: 3;
+ -ms-flex-order: 3;
+ order: 3;
+ -moz-box-flex: 1;
+
+ -webkit-box-flex:1;
+ -webkit-box-ordinal-group: 3;
+ width: 20%;
+ padding-right:5px;
+}
+.content-fixedHeight {
+ clear: both;
+ overflow: hidden;
+ position: absolute;
+ top: 0;
+
+ bottom: 0;
+ left: 50px;
+ right: 0;
+ background: #3b4b54;
+
+}
+.content-fixedHeight-animation {
+ transition: left 0.3s ease;
+}
+.content-fixedHeight-maximized {
+ top: 0;
+ bottom: 0;
+}
+.content-sideMenu-closed {
+ left: 0;
+}
+.content-fluid {
+}
+.footer-fixed-bottom {
+ position: fixed;
+ bottom: 0;
+ z-index: 50;
+ right: 0;
+ left: 0;
+
+ height: 0;
+ background:#ededed;
+}
+.layoutBlock {
+ clear: both;
+ margin: 0;
+
+ padding: 4px 4px 0 4px;
+ vertical-align: baseline;
+}
+.layoutLeft {
+ float: left;
+ margin: 0;
+}
+.layoutRight {
+ float: right;
+ margin: 0;
+}
+.layoutFlexStretch {
+ flex: 1 1;
+ -ms-flex: 1 1;
+ -webkit-flex: 1 1;
+}
+.spacingLeft {
+ margin-left: 5px;
+}
+.spacingRight {
+ margin-right: 5px;
+}
+.clear {
+ clear: both;
+}
+.hidden {
+ visibility: hidden;
+}
+.sidePanelLayout {
+ display: block;
+ position: absolute;
+ left: 0;
+ width: 33%;
+ height: 100%;
+}
+.generalAnimation {
+ -webkit-transition: all 0.5s ease;
+ -moz-transition: all 0.5s ease;
+ -o-transition: all 0.5s ease;
+ transition: all 0.5s ease;
+ z-index: 50;
+ overflow: auto;
+}
+.sidePanelLayoutAnimation {
+ -webkit-transition: width 0.5s ease;
+ -moz-transition: width 0.5s ease;
+ -o-transition: width 0.5s ease;
+ transition: width 0.5s ease;
+ z-index: 50;
+ overflow: auto;
+}
+.sidePanelVerticalLayout {
+ display: block;
+ position: absolute;
+ top: 0;
+ height: 33%;
+ width: 100%;
+}
+.sidePanelVerticalLayoutAnimation {
+ -webkit-transition: height 0.5s ease;
+ -moz-transition: height 0.5s ease;
+ -o-transition: height 0.5s ease;
+ transition: height 0.5s ease;
+ z-index: 50;
+ overflow: auto;
+}
+.sidePanelMargins {
+ margin-left: 8px;
+ margin-top: 2px;
+ margin-bottom: 8px;
+ width: auto;
+}
+.mainPanelLayout {
+ display: block;
+ position: absolute;
+ right: 0;
+ height: 100%;
+}
+.mainPanelLayoutAnimation {
+ -webkit-transition: left 0.5s ease;
+ -moz-transition: left 0.5s ease;
+ -o-transition: left 0.5s ease;
+ transition: left 0.5s ease;
+}
+.mainPanelVerticalLayout {
+ display: block;
+ position: absolute;
+ bottom: 0;
+ width: 100%;
+}
+.mainPanelVerticalLayoutAnimation {
+ -webkit-transition: top 0.5s ease;
+ -moz-transition: top 0.5s ease;
+ -o-transition: top 0.5s ease;
+ transition: top 0.5s ease;
+}
+.fixedToolbarHolder {
+ position: relative;
+ left: 0;
+ top: 0;
+ height: 100%;
+ width: 100%;
+ min-width:140px;
+ background:#3b4b54;
+}
+.sidebarWrapper {
+ overflow-x: auto;
+ overflow-y: hidden;
+ min-width: 0;
+}
+.sidebarWrapper > .sidebar {
+ position: relative;
+ left: 0;
+ top: 0;
+ height: calc(100% - 29px);
+ overflow-x: visible;
+}
+.projectNavSidebarWrapper > .sidebar {
+ height: calc(100% - 0px);
+}
+.workingTarget {
+ position: absolute;
+ top: 0;
+ width: 100%;
+ bottom: 0;
+ overflow-y: auto;
+ background:white;
+}
+.toolbarTarget {
+ position: absolute;
+ top: 50px;
+ width: 100%;
+ overflow-y: auto;
+}
+.toolbarTarget-toolbarHidden {
+ top: 0;
+}
+.pageLayoutTarget {
+ position: absolute;
+ width: calc( 100% - 60px );
+ bottom: 0;
+ overflow-y: auto;
+ box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.33);
+ margin: 20px;
+ margin-right: 0;
+ padding-top: 10px;
+ padding-bottom: 5px;
+ background: white;
+}
+.hasSplit {
+ display: none;
+}
+.editorViewerFrame {
+ width: 100%;
+ height: 100%;
+}
+.editorViewerHeader {
+ display:flex;
+ background: #3B4B54;
+ color: white;
+ flex-direction:row;
+ align-items:center;
+ line-height:26px;
+ border-bottom: 1px solid #263238;
+}
+.editorViewerHeaderDirtyIndicator {
+ padding-left: 5px;
+}
+.editorViewerHeaderTitle {
+ padding-left: 5px;
+}
+.editorViewerContent {
+ position: absolute;
+ width: 100%;
+ top: 27px;
+ bottom: 0;
+ overflow: auto
+}
+.editorViewerPicInPic {
+ position: absolute;
+ border: 1px solid #ccc;
+ background-color: white;
+ z-index: 100;
+ bottom: 35px;
+ right: 35px;
+ width: 40%;
+ height: 40%;
+}
+.splitLayout {
+ position: absolute;
+ left: 33%;
+ height: 100%;
+ z-index: 51;
+ width: 3px;
+ cursor: e-resize;
+ visibility: hidden;
+}
+.splitVerticalLayout {
+ position: absolute;
+ top: 33%;
+ width: 100%;
+ z-index: 51;
+ height: 3px;
+ cursor: n-resize;
+ visibility: hidden;
+}
+@media only screen
+and (min-device-width : 768px)
+and (max-device-width : 1024px) {
+
+ .splitLayout {
+ position: absolute;
+ left: 33%;
+ height: 100%;
+ z-index: 50;
+ width: 20px;
+ cursor: e-resize;
+ visibility: hidden;
+ }
+
+
+ .splitVerticalLayout {
+ position: absolute;
+ top: 33%;
+ width: 100%;
+ z-index: 50;
+ height: 20px;
+ cursor: n-resize;
+ visibility: hidden;
+ }
+
+}
+.splitThumbLeftLayout {
+ position: absolute;
+ left: 100%;
+ height: 4em;
+ width: 4px;
+ top: calc(50% - 2em);
+ margin-left: -1px;
+ cursor: pointer;
+ border-top-right-radius: 5px;
+ border-bottom-right-radius: 5px;
+}
+.splitThumbRightLayout {
+ position: absolute;
+ right: 100%;
+ height: 4em;
+ width: 4px;
+ top: calc(50% - 2em);
+ margin-right: -1px;
+ cursor: pointer;
+ border-top-left-radius: 5px;
+ border-bottom-left-radius: 5px;
+}
+.splitVerticalThumbUpLayout {
+ position: absolute;
+ top: 100%;
+ width: 4em;
+ height: 4px;
+ left: calc(50% - 2em);
+ margin-top: -1px;
+ cursor: pointer;
+ border-bottom-left-radius: 5px;
+ border-bottom-right-radius: 5px;
+}
+.splitVerticalThumbDownLayout {
+ position: absolute;
+ bottom: 100%;
+ width: 4em;
+ height: 4px;
+ left: calc(50% - 2em);
+ cursor: pointer;
+ border-top-left-radius: 5px;
+ border-top-right-radius: 5px;
+}
+.splitLayoutAnimation {
+ -webkit-transition: left 0.5s ease;
+ -moz-transition: left 0.5s ease;
+ -o-transition: left 0.5s ease;
+ transition: left 0.5s ease;
+}
+.splitVerticalLayoutAnimation {
+ -webkit-transition: top 0.5s ease;
+ -moz-transition: top 0.5s ease;
+ -o-transition: top 0.5s ease;
+ transition: top 0.5s ease;
+}
+.panelTracking {
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ overflow: auto;
+}
+.commandList {
+ padding: 0;
+ margin-left: 0;
+ margin-right: 0;
+ list-style-type: none;
+ vertical-align: baseline;
+}
+.commandList > li {
+ float: left;
+ margin-left: 4px;
+ margin-right: 4px;
+}
+.commandMargins {
+ margin-left: 4px !important;
+ margin-right: 4px !important;
+}
+.commandMargins:last-child {
+ margin-right: 0 !important;
+}
+.sideMenu{
+ width: 50px;
+ background: #26343F;
+ float: left;
+ position: absolute;
+ top: 0;
+
+ bottom: 0;
+ -webkit-animation: slide 0.5s forwards;
+ -webkit-animation-delay: 2s;
+ animation: slide 0.5s forwards;
+ animation-delay: 2s;
+ display:block;
+ margin:0;
+ font-family: sans-serif;
+ font-size:10px;
+ text-decoration:none !important;
+ user-select: none;
+ -webkit-user-select: none;
+ -moz-user-select: -moz-none;
+}
+.sideMenu.animating {
+ z-index: 0;
+}
+.sideMenu-maximized {
+ top: 0;
+ bottom: 0;
+}
+.sideMenu-closed {
+ width: 0;
+ display: none;
+}
+.sideMenuHome{
+ width: 100%;
+ height: 50px;
+}
+.sideMenuList{
+ display:inline-block !important;
+ height: calc(100% - 64px);
+ margin: 0;
+ overflow-y: hidden;
+ padding: 0;
+ text-align: center;
+ width: 100%;
+}
+.sideMenuItem{
+ list-style-type: none;
+ font-size:16px !important;
+ padding: 0;
+ margin: 3px;
+}
+.sideMenuItem:hover, .sideMenuItem.expanded {
+ text-decoration:none;
+ color:#F47D64 !important;
+}
+.sideMenu:hover > .sideMenuScrollButton {
+ opacity: 1;
+}
+.sideMenuScrollButton {
+ background-color: rgba(0,0,0,0.5) !important;
+ color: white !important;
+ cursor: pointer;
+ display: none;
+ height: 19px;
+ opacity: 0.5;
+ position: absolute;
+ width: 100%;
+ z-index: 100;
+}
+.sideMenuScrollButton.visible {
+ display: block;
+}
+.sideMenuTopScrollButton {
+ -webkit-transform: rotate(180deg);
+ transform: rotate(180deg);
+}
+.sideMenuBottomScrollButton {
+ bottom: 0;
+ left: 0;
+}
+.sideMenuItem > .submenu-trigger {
+ color: #6D8B93 !important;
+ font-size:16px;
+ text-decoration:none !important;
+ width: 100%;
+ display: inline-block;
+ padding: 9px 0px 12px 0px;
+}
+.sideMenuItem>.submenu-trigger:hover, .sideMenuItem.expanded>.submenu-trigger{
+ text-decoration:none;
+ color:white !important;
+}
+.sideMenuItemActive {
+}
+.sideMenuItemActive > .submenu-trigger {
+ color: white !important;
+}
+.sideMenuToggle {
+ display: none;
+}
+.sideMenu-notification {
+ position: relative;
+}
+.sideMenu-notification[level=info] {
+ background-image: radial-gradient(#1EB3DC, #1EB3DC 2px, transparent 3px);
+ background-size: 6px 6px;
+ background-repeat: no-repeat;
+ background-position: 30px 29px;
+}
+.sideMenu-notification[level=warn] {
+ background-image: radial-gradient(#FFFF66, #FFFF66 2px, transparent 3px);
+ background-size: 6px 6px;
+ background-repeat: no-repeat;
+ background-position: 30px 29px;
+}
+.sideMenu-notification[level=error] {
+ background-image: radial-gradient(#FF0000, #FF0000 2px, transparent 3px);
+ background-size: 6px 6px;
+ background-repeat: no-repeat;
+ background-position: 30px 29px;
+}
+.sideMenuSubMenu{
+ display: none;
+ list-style-type:none;
+ position:absolute;
+ font-family:sans-serif;
+ padding-left: 0;
+ z-index:100;
+ text-align: left;
+ left: 40px;
+}
+.sideMenuSubMenuItem{
+ display: inline-block;
+ width: 100%;
+ white-space: nowrap;
+ font-size: 12px;
+ background: white;
+ border-right:1px solid #ddd;
+}
+.sideMenuSubMenuItem:before {
+ width: 0;
+ height: 0;
+ top: 13px;
+ content: "";
+ left: -8px;
+ position: absolute;
+ z-index: 200;
+ border-top: 8px solid transparent;
+ border-bottom: 8px solid transparent;
+ border-right: 8px solid white;
+}
+.sideMenuSubMenuItem:first-child{
+ border-top:1px solid #ddd;
+ border-top-right-radius: 4px;
+}
+.sideMenuSubMenuItem:last-child{
+ border-bottom:1px solid #ddd;
+ border-bottom-right-radius: 4px;
+}
+.sideMenuSubMenuItem a {
+ display: inline-block;
+ color: #444;
+ padding: 12px 30px 12px 10px;
+ width: calc(100% - 30px - 10px + 8px);
+}
+.sideMenuSubMenuItem a:hover{
+ text-decoration:none;
+ color: black !important;
+}
+
+.sideMenuSubMenuItem:hover {
+ background-color: #fde7cf;
+}
+.sideMenuSubMenuItem:only-child:hover {
+
+}
+.sideMenuSubMenuItem:only-child:hover a {
+ color: #333;
+}
+.sideMenuSubMenuItem a span {
+ display: inline-block;
+}
+.sideMenuItem:hover .sideMenuSubMenu, .sideMenuSubMenu.expanded {
+ display:inline-block;
+}
+.sidebar-decorate-active {
+ position: relative;
+ background:
+ radial-gradient(#1EB3DC, #1EB3DC 2px, #47575F 3px) no-repeat,
+ #47575F;
+ background-position:
+ 30px 29px,
+ 0 0;
+ background-size:
+ 8px 8px;
+}
+.mainContent{
+ position:absolute;
+ left:50px;
+}
+.innerPanels{
+ position:absolute;
+ width:100%;
+ top:50px;
+ bottom:0;
+}
+.userMenu {
+}
+.splash {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ background-color: rgb(57,75,84);
+ z-index: 149;
+ display: block;
+ box-shadow: 0 3px 7pt 0 rgba(0,0,0,0.3) inset;
+}
+.splashSeeThroughX {
+ -webkit-animation-name: splashSeeThrough;
+ animation-name: splashSeeThrough;
+ animation-duration: 0.7s;
+ background-color: rgba(38,52,63, 0.7);
+}
+@-webkit-keyframes splashSeeThrough {
+ from {background-color: rgb(38,52,63);}
+ to {background-color: rgba(38,52,63, 0.7);}
+}
+@keyframes splashSeeThrough {
+ from {background-color: rgb(38,52,63);}
+ to {background-color: rgba(38,52,63, 0.7);}
+}
+.splashContainer {
+ display: flex;
+ display: -webkit-flex;
+ align-items: center;
+ -webkit-align-items: center;
+ justify-content: center;
+ -webkit-justify-content: center;
+ height:100%;
+ flex-direction: column;
+ -webkit-flex-direction: column;
+ font-family: sans-serif;
+ font-size: 14px;
+}
+.splashLoader {
+ display: flex;
+ display: -webkit-flex;
+ height:300px;
+ width:400px;
+ flex-direction: column;
+ -webkit-flex-direction: column;
+ align-items: center;
+ -webkit-align-items: center;
+ background-color: rgb(57,75,84);
+ padding: 20px;
+ padding-top: 60px;
+ padding-bottom: 0px;
+ border-radius: 4px;
+ Xbox-shadow: 5px 5px 5px 0 rgba(0,0,0,0.2);
+ Xborder-bottom: 1px solid rgb(59,222,255);
+}
+.splashAbout {
+ text-align: center;
+ color: #FFFFFF;
+ font-size:16px;
+ font-family: 'helvetica';
+ font-weight: bold;
+ margin-bottom: 10px;
+}
+.splashSteps {
+ margin:20px;
+ max-width: 300px;
+}
+.splashStep {
+ display: flex;
+ display: -webkit-flex;
+ flex-direction: row;
+ -webkit-flex-direction: row;
+ padding-top: 10px;
+ padding-bottom:10px;
+ height:24px;
+}
+.splashMessage {
+ color: white;
+ font-size: 12px;
+}
+.splashDetailedMessage {
+ color: white;
+ font-size: 12px;
+}
+.splashVisual {
+ width: 24px;
+}
+.splashVerbal {
+ margin-left:20px;
+ color: #3BDEFF;
+ font-family: 'helvetica';
+ font-weight: bold;
+ margin-top: 3px;
+}
+.splashVerbalwaiting {
+ color:grey;
+}
+.splashLoadingImage {
+ background: url(../../images/loading_24.gif) no-repeat top left;
+ vertical-align: middle;
+ display: inline-block;
+ border: none;
+ height:24px;
+ width:24px;
+}
+.splashSuccessImage {
+ background: url(../../images/message_success_24.png) no-repeat top left;
+ vertical-align: middle;
+ display: inline-block;
+ border: none;
+ height:24px;
+ width:24px;
+}
+.orionPage {
+ background-color: #26343F;
+ width: 100%;
+ height: 100%;
+}
+.topRowBanner {
+ margin: 0;
+ border: 0;
+ display: -moz-box;
+ display: -ms-flexbox;
+ display: -webkit-flex;
+ display: flex;
+ border-top-width: 0px;
+ border-right-width: 0px;
+ border-left-width: 0px;
+ border-bottom-style: none;
+ background-color: white;
+ height: 16px;
+ padding: 8px 2px 7px 6px !important;
+ box-shadow: rgba(0, 0, 0, 0.0980392) 0px 2px 2px 0px, rgba(0, 0, 0, 0.0980392) 0px 1px 0px 0px;
+ z-index: 100;
+ display: none;
+}
+a {
+ text-decoration: none;
+ color: #00AED1;
+}
+a:hover {
+ cursor: pointer;
+ text-decoration: underline;
+}
+.primaryNav {
+ font-size: 8pt;
+ font-weight: normal;
+ color: #BFBFBF;
+ vertical-align: baseline;
+}
+.primaryNav > div {
+ padding-top: 6px;
+}
+.primaryNav > nav {
+ padding-top: 6px;
+}
+.primaryNav > nav > a {
+ color: #BFBFBF;
+ margin-right: 6px;
+ margin-left: 6px;
+ text-decoration: none;
+}
+.primaryNav > nav > a:hover, .primaryNav span.dropdownTrigger:hover {
+ cursor: pointer;
+ color: white;
+}
+.titleArea {
+ margin: 0;
+ padding-top: 3px;
+ border: 0;
+ background: #EFEFEF;
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#EFEFEF), color-stop(100%,#EFEFEF));
+ border-bottom: 1px solid #DEDEDE;
+ min-height: 20px;
+}
+.checkedRow {
+ color: white !important;
+ background-color: #1bb199 !important;
+}
+.checkedRow.disabledRow {
+ background-color: #dadada !important;
+}
+.checkedRow > td > span
+{
+ color:white !important;
+}
+.checkedRow > td > span > a
+{
+ color:white !important;
+}
+.checkedRow > td > span > span
+{
+ color:white !important;
+}
+.checkedRow > td > span > a > span
+{
+ color:white !important;
+}
+.checkedRow > td > a > span > span
+{
+ color:white !important;
+}
+.checkedRow .secondaryColumn {
+ color: white;
+}
+.checkedRow .navColumnNoIcon {
+ color: white;
+}
+.checkedRow .secondaryColumn > a:hover {
+ color: white !important;
+ font-weight:bold;
+ text-decoration: none;
+}
+.checkedRow .sectionTableItem {
+ color: white !important;
+}
+.checkedRow a {
+ color: white;
+}
+.checkedRow .jazz-description {
+ color: white;
+}
+.checkedRow .commandButton {
+ color: white;
+ border-color: white;
+}
+.checkedRow .commandImage {
+ color: white;
+}
+.navRow > td:first-child {
+
+}
+.navRow.checkedRow > td:first-child {
+ border-left-color: #d57152;
+}
+.navbar-item-selected {
+ color: #FFFFFF !important;
+ font-weight: bold;
+ position: relative;
+ background: #1bb199 !important;
+}
+.breadcrumbContainer {
+ align-items: baseline;
+ display: inline-flex;
+ justify-content: center;
+
+ -webkit-align-items: baseline;
+ display: -webkit-inline-flex;
+ -webkit-justify-content: center;
+
+ margin-right: 0;
+ overflow: hidden;
+ visibility: visible;
+ width: 100%;
+}
+.breadcrumb {
+ color: #E6E6E6;
+ -webkit-flex-grow: 0;
+ flex-grow: 0;
+ font: 9pt;
+ font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue",
+ Helvetica, Tahoma, Geneva, Arial, "Lucida Grande", sans-serif;
+ overflow: hidden;
+ text-decoration: none;
+ text-overflow: ellipsis;
+}
+a.breadcrumb:hover {
+ text-decoration: none;
+ border-bottom: 1px dotted;
+ color: #00AED1;
+ cursor: pointer;
+}
+.breadcrumbSeparator {
+ color: #E6E6E6;
+ font-size: 9pt;
+ font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue",
+ Helvetica, Tahoma, Geneva, Arial, "Lucida Grande", sans-serif;
+ font-weight: bold;
+ -webkit-flex-shrink: 0;
+ flex-shrink: 0;
+ margin: 2px;
+ text-decoration: none;
+}
+.currentLocation {
+ padding-top:1px;
+ font-weight: bold;
+ font-size: 9pt;
+ font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue",
+ Helvetica, Tahoma, Geneva, Arial, "Lucida Grande", sans-serif;
+ color: #E6E6E6;
+ text-decoration: none;
+ line-height: 10pt;
+ white-space:nowrap;
+}
+div.currentLocation {
+ width: 100%;
+}
+.breadcrumbContainer > .currentLocation {
+ margin: 0;
+}
+a.currentLocation:hover {
+ font-weight: bold;
+ color: #00AED1;
+ text-decoration: none;
+ border-bottom: 1px dotted;
+}
+a.breadcrumb.currentLocation {
+ font-weight: bold;
+ margin: 0;
+}
+.tooltipContainer .currentLocation {
+ color: white;
+}
+.tooltipContainer .breadcrumb {
+ color: white;
+}
+.tooltipContainer .breadcrumbSeparator {
+ color: white;
+}
+.tooltipContainer a.currentLocation:hover {
+ color: white;
+}
+.tooltipContainer a.breadcrumb:hover {
+ color: white;
+}
+.auxpane {
+ border: 0;
+ background: #3B4B54;
+ color: white;
+}
+.mainpane {
+ border: 0;
+ background: #3B4B54 !important;
+ padding-right:20px;
+}
+.mainToolbar {
+ color: white;
+ background: #26343f;
+ padding-left: 2px;
+ padding-right: 5px;
+ white-space: nowrap;
+}
+.fsToolbar {
+ padding: 2px 4px 2px 4px;
+ background-color: #DFE6EB;
+
+
+}
+.filesystemName {
+ display: inline-block;
+ font-weight: normal;
+ margin-left: 10px;
+ margin-top: 8px;
+ margin-bottom: 8px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+
+ max-width: calc(100% - 6px - 4px - 24px);
+ max-width: -webkit-calc(100% - 6px - 4px - 24px);
+ -moz-user-select: -moz-none;
+ -webkit-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ color: white;
+}
+.filesystemSwitcher {
+ display: inline-block;
+ margin: 0;
+}
+.filesystemSwitcherWrapper {
+ display: block;
+ max-width: 100%;
+ white-space: nowrap;
+}
+.sidebarToolbar {
+ display: inline;
+ overflow: visible;
+ padding: 0 !important;
+}
+.searchbox {
+ background-image: url(../../images/core_sprites.png);
+ background-repeat: no-repeat;
+ background-position: 4px -297px;
+ width: 12px; height: 12px;
+ background-color: #444;
+ border: 1px solid #222;
+ font-size: 11px;
+ width: 15em;
+ height: 16px;
+ border-radius: 10px;
+ color: #999;
+ padding: 0;
+ padding-left: 20px;
+ padding-right: 16px;
+ margin-left: 5px;
+ font-size: 7pt;
+}
+.searchbox:focus{
+ color: white;
+ outline: none;
+}
+
+.orionButton {
+ border: 1px solid transparent;
+ text-align: center;
+ vertical-align: baseline;
+ display: inline-block;
+ padding: 4px 6px;
+ border-radius: 1px;
+ line-height: 12px;
+ font-size: 9pt;
+ font-family: "HelveticaNeue", "Helvetica Neue", "HelveticaNeueRoman", "HelveticaNeue-Roman", "Helvetica Neue Roman",
+ 'TeXGyreHerosRegular', "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif;
+ margin: 0;
+}
+.commandButton.orionButton.dropdownTrigger {
+
+}
+.commandButton.orionButton.dropdownTrigger:hover {
+ border-color: #ccc;
+}
+.mainToolbar .commandButton.orionButton.dropdownTrigger {
+ color:white;
+}
+.commandButton {
+ color: #00AED1;
+ border: 1px solid #00AED1;
+ background-color: rgba(0, 0, 0, 0);
+
+ vertical-align: middle;
+ -webkit-transition: color 0.2s ease;
+ transition: color 0.2s ease;
+}
+.commandButton:not(.dropdownTrigger) {
+
+}
+.extraActions .commandButton {
+ text-transform: uppercase;
+}
+.commandButton.dropdownDefaultButton {
+
+}
+.commandButton:not(.primaryButton):hover, .commandButton:not(.primaryButton):focus {
+ color: white;
+ background-color: #a5b5bc;
+ box-shadow: 0 1px 2px 0 rgba(0,0,0,0.2);
+}
+.commandButton.disabled {
+ color: #cdcdcd;
+}
+.primaryButton{
+ background: #1bb199;
+ border-color: #1bb199;
+ color: white;
+}
+.primaryButton:hover, .primaryButton:focus {
+ background: #01CDB0;
+ border-color: #01CDB0;
+}
+.commandImage {
+ border: 1px solid transparent;
+ border-radius: 1px;
+ color: inherit;
+ background-color: transparent;
+ vertical-align: baseline;
+ cursor: pointer;
+ display: inline-block;
+ padding: 2px;
+ padding-top: 0;
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+.commandImage:hover, .commandImage:focus {
+ background-color: #a5b5bc;
+ border: 1px solid #ccc;
+}
+.mainToolbar .commandImage.dropdownTrigger {
+ color: white;
+}
+.orionToggleOff {
+ color: inherit;
+ border-radius: 3px;
+ vertical-align:middle;
+ -webkit-animation-duration: .2s;
+ animation-duration: .2s;
+ -webkit-animation-fill-mode: both;
+ animation-fill-mode: both;
+ -webkit-animation-timing-function: linear;
+ animation-timing-function: linear;
+}
+.orionToggleOn {
+ color: inherit;
+ background-color: whitesmoke;
+ border-radius: 3px;
+ box-shadow: inset 1px 1px 2px 1px rgba(0,0,0,0.3);
+ vertical-align:middle;
+ -webkit-animation-duration: .2s;
+ animation-duration: .2s;
+ -webkit-animation-fill-mode: both;
+ animation-fill-mode: both;
+ -webkit-animation-timing-function: linear;
+ animation-timing-function: linear;
+}
+.orionToggleOn:hover {
+ background: white;
+ box-shadow: inset 0 0 1px 1px rgba(0,0,0,0.2);
+}
+.orionToggleOff:hover {
+ background: whitesmoke;
+ box-shadow: inset 0 0 1px 1px rgba(0,0,0,0.2);
+}
+.orionToggleAnimate {
+ -webkit-animation-name: pulse;
+ animation-name: pulse;
+}
+@-webkit-keyframes pulse {
+ 0% { -webkit-transform: scale(1); }
+ 50% { -webkit-transform: scale(1.3); }
+ 100% { -webkit-transform: scale(1); }
+}
+@keyframes pulse {
+ 0% { transform: scale(1); }
+ 50% { transform: scale(1.3); }
+ 100% { transform: scale(1); }
+}
+.orionSwitch {
+ position: relative;
+ width: auto;
+}
+.orionSwitchCheck {
+ display: none;
+}
+.orionSwitchLabel {
+ display: block;
+ overflow: hidden;
+ cursor: pointer;
+ border: 1px solid #DFE6EB;
+ border-radius: 3px;
+ height: 20px;
+}
+.orionSwitchInner {
+ display: block;
+ width: 200%;
+ margin-left: -100%;
+ margin-top:-1px;
+ text-align: left;
+ -moz-transition: margin 0.2s ease-in 0s;
+ -webkit-transition: margin 0.2s ease-in 0s;
+ -o-transition: margin 0.2s ease-in 0s;
+ transition: margin 0.2s ease-in 0s;
+}
+.orionSwitchInner:before, .orionSwitchInner:after {
+ display: block;
+ float: left;
+ width: 50%;
+ padding: 0;
+ padding-bottom: 2px;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+}
+.orionSwitchInner:before {
+ padding-left: 3px;
+ padding-right: 2px;
+ background-color: #FFF;
+ color: #808080;
+}
+.orionSwitchInner:after {
+ padding-right: 3px;
+ background-color: #eee;
+ color: #808080;
+ text-align: right;
+}
+.orionSwitchSwitch {
+ display: block;
+ width: calc(50% - 2px);
+ margin: 0;
+ background: #DFE6EB;
+ border: 1px solid #DFE6EB;
+ border-radius: 3px;
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ right: calc(50% + 2px);
+ -moz-transition: all 0.2s ease-in 0s;
+ -webkit-transition: all 0.2s ease-in 0s;
+ -o-transition: all 0.2s ease-in 0s;
+ transition: all 0.2s ease-in 0s;
+}
+.orionSwitchCheck:checked + .orionSwitchLabel .orionSwitchInner {
+ margin-left: 0;
+}
+.orionSwitchCheck:checked + .orionSwitchLabel .orionSwitchSwitch {
+ right: 0px;
+}
+.commandMissingImageButton {
+ font-weight: normal;
+}
+.commandLink {
+ display: inline-block;
+ vertical-align: middle;
+ padding: 4px 0 1px;
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+.commandSeparator {
+ padding: 2px;
+}
+.commandActive {
+ background-color: #e6e6e6 !important;
+ border: 1px solid #808080 !important;
+ border-radius: 2px !important;
+}
+.commandActiveItem {
+}
+.commandInactiveItem {
+}
+.split {
+ background: #3B4B54;
+}
+.splitTracking {
+ background: #3B4B54;
+}
+.splitThumb {
+ background: #3B4B54;
+}
+.dropdown {
+}
+.dropdownArrowDown {
+ display: inline-block;
+ vertical-align: top;
+ line-height: 12px;
+ text-transform: lowercase;
+}
+.dropdownArrowRight {
+ flex-grow: 0;
+ -webkit-flex-grow: 0;
+ font-size: 12px;
+}
+.dropdownTrigger:not(.dropdownDefaultButton) {
+ font-weight: normal;
+ color: #FFFFFF;
+ border-color: transparent;
+}
+.dropdownTrigger a {
+ text-decoration: none;
+}
+.dropdownMenu {
+ box-shadow: 2px 2px 5px 3px rgba(0, 0, 0, .2);
+ color: #3b4b54;
+ background-color: white;
+ border-collapse: separate;
+ border: 1px solid #bbbbbb;
+ border-radius: 1px;
+ visibility: hidden;
+ z-index: 150;
+ position: absolute;
+ list-style-type: none;
+ display: none;
+ line-height: normal;
+ margin: 0;
+ cursor: default;
+ font-size: 12px;
+ margin: 0;
+ outline: none;
+ padding: 3px 0 3px;
+}
+.dropdownMenuOpen {
+ min-width: 120px;
+ display: block;
+ visibility: visible;
+}
+.dropdownSubMenu {
+ position: relative;
+ line-height: normal;
+}
+.dropdownSubMenu > ul {
+ top: 0;
+ left: 100%;
+}
+.dropdownMenu > li {
+ min-width: 120px;
+ display: flex;
+ display: -webkit-flex;
+}
+.dropdownMenu > li > a, .dropdownMenu > li > span {
+ width: calc( 100% - 9px );
+ margin: 0;
+}
+.dropdownMenu > li > *:focus {
+ outline: none;
+}
+.dropdownSeparator {
+ height: 1px;
+ background-color: #ddd;
+ color: #ddd;
+ padding: 0 !important;
+ margin: 0;
+}
+.dropdownMenuItem, .dropdownMenuItem a {
+ align-items: center;
+ -webkit-align-items: center;
+ align-content: stretch;
+ -webkit-align-content: stretch;
+ display: inline-flex;
+ display: -webkit-inline-flex;
+ vertical-align: middle;
+ color: #3b4b54 !important;
+ padding: 3px 3px 3px 5px;
+ cursor: pointer;
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ white-space: nowrap;
+ border-left: 4px solid transparent;
+}
+.dropdownMenu .dropdownMenuItemSelected {
+ background-color: rgba(27,177,153, 0.1);
+ border-left-color: #1BB199;
+}
+.dropdownMenuItem .check {
+ display: inline-block;
+ width: 12px;
+}
+.dropdownMenuItem .dropdownKeyBinding {
+ color: grey !important;
+ flex-grow: 0;
+ -webkit-flex-grow: 0;
+ font-size: 11px;
+ padding-left: 15px;
+ padding-right: 10px;
+}
+.dropdownMenuItem .dropdownCommandName {
+ -webkit-align-items: center;
+ align-items: center;
+ display: inline-flex;
+ display: -webkit-inline-flex;
+
+ flex-grow: 1;
+ -webkit-flex-grow: 1;
+ text-decoration: inherit;
+}
+.dropdownSelection {
+ background-color: white !important;
+ color: #3b4b54 !important;
+ border: 1px solid #bbbbbb !important;
+ border-bottom: none !important;
+ border-bottom-left-radius: 0 !important;
+ border-bottom-right-radius: 0 !important;
+ box-shadow: -1px -1px 2px 0 rgba(0, 0, 0, .2) !important;
+ margin-bottom: -1px !important;
+ position: relative !important;
+ z-index: 200 !important;
+}
+.checkedMenuItem {
+ margin: 4px 6px 2px 0;
+ vertical-align: bottom;
+}
+.tooltipContainer {
+ display: none;
+ z-index: 200;
+ background: transparent;
+ position: absolute;
+ max-width: 110em;
+}
+.tooltip .textContent {
+ max-width: 40em;
+}
+.tooltip {
+ color: white;
+ background-color: #158d7a;
+ border-radius: 3px;
+ padding: 8px;
+ clear: both;
+ float: left;
+ border: 1px solid #158d7a;
+ box-shadow: 0px 0px 10pt -2pt rgba(0, 0, 0, 0.5);
+}
+.tooltip.left {
+}
+.tooltip .navlinkonpage {
+ color: #00aed1 !important;
+}
+.tooltip h2 {
+ color: #3b4b54;
+}
+.tooltip .operationStatus {
+ color: #00aed1;
+}
+.tooltip .operationError {
+ color: #a6b5bc;
+}
+.tooltipTailFromleft {
+ position: absolute;
+ display: inline-block;
+ top: 14px;
+ content: '';
+ z-index: 201;
+}
+.tooltipTailFromleft:after, .tooltipTailFromleft:before {
+ left: -1px;
+ top: 50%;
+ border: solid transparent;
+ content: " ";
+ height: 0;
+ width: 0;
+ position: absolute;
+ pointer-events: none;
+}
+.tooltipTailFromleft:after {
+ border-color: transparent;
+ border-left-color: #158d7a;
+ border-width: 8px;
+ margin-top: -8px;
+}
+.tooltipTailFromleft:before {
+ border-color: transparent;
+ border-left-color: #158d7a;
+ border-width: 9px;
+ margin-top: -9px;
+}
+.tooltipTailBorderFromleft {
+ position: absolute;
+ display: inline-block;
+ border: 10px solid;
+ border-color: transparent transparent transparent #158d7a;
+ top: 2px;
+ right: -17px;
+ content: '';
+}
+.tooltipTailFromright {
+ position: absolute;
+ display: inline-block;
+ left: 0;
+ top: 14px;
+ content: '';
+ z-index: 201;
+}
+.tooltipTailFromright:after, .tooltipTailFromright:before {
+ right: -1px;
+ top: 50%;
+ border: solid transparent;
+ content: " ";
+ height: 0;
+ width: 0;
+ position: absolute;
+ pointer-events: none;
+}
+.tooltipTailFromright:after {
+ border-color: transparent;
+ border-right-color: #158d7a;
+ border-width: 8px;
+ margin-top: -8px;
+}
+.tooltipTailFromright:before {
+ border-color: transparent;
+ border-right-color: #158d7a;
+ border-width: 9px;
+ margin-top: -9px;
+}
+.tooltipTailBorderFromright {
+ position: absolute;
+ display: inline-block;
+ border: 10px solid;
+ border-color: transparent #158d7a transparent transparent;
+ left: -17px;
+ top: 2px;
+ content: '';
+}
+.tooltipTailFrombelow {
+ position: absolute;
+ display: block;
+ left: 16px;
+ top: 0;
+ content: '';
+ z-index: 201;
+}
+.tooltipTailFrombelow:after, .tooltipTailFrombelow:before {
+ bottom: -1px;
+ left: 50%;
+ border: solid transparent;
+ content: " ";
+ height: 0;
+ width: 0;
+ position: absolute;
+ pointer-events: none;
+}
+.tooltipTailFrombelow:after {
+ border-color: transparent;
+ border-bottom-color: #158d7a;
+ border-width: 8px;
+ margin-left: -8px;
+}
+.tooltipTailFrombelow:before {
+ border-color: transparent;
+ border-bottom-color: #158d7a;
+ border-width: 9px;
+ margin-left: -9px;
+}
+.tooltipTailBorderFrombelow {
+ position: absolute;
+ display: block;
+ border: 10px solid;
+ border-color: transparent transparent #158d7a transparent;
+ left: 14px;
+ top: -17px;
+ content: '';
+}
+.tooltipTailFromabove {
+ position: absolute;
+ display: block;
+ left: 16px;
+ content: '';
+ bottom: 0;
+ z-index: 201;
+}
+.tooltipTailFromabove:after, .tooltipTailFromabove:before {
+ top: -1px;
+ left: 50%;
+ border: solid transparent;
+ content: " ";
+ height: 0;
+ width: 0;
+ position: absolute;
+ pointer-events: none;
+}
+.tooltipTailFromabove:after {
+ border-color: transparent;
+ border-top-color: #158d7a;
+ border-width: 8px;
+ margin-left: -8px;
+}
+.tooltipTailFromabove:before {
+ border-color: transparent;
+ border-top-color: #158d7a;
+ border-width: 9px;
+ margin-left: -9px;
+}
+.tooltipTailBorderFromabove {
+ position: absolute;
+ display: block;
+ border: 10px solid;
+ border-color: #158d7a transparent transparent transparent;
+ left: 14px;
+ bottom: -17px;
+ content: '';
+}
+.tooltipShowing {
+ display: block;
+}
+.tooltip > .parametersDismiss > .dismissButton {
+ color: whitesmoke;
+}
+.tooltip > .parametersDismiss > .dismissButton:hover {
+ color: white;
+}
+.dialog {
+ visibility: hidden;
+ z-index: 175;
+ position: absolute;
+ background-color: #fbfbfb;
+ border-radius: 2px;
+ border: 1px solid #BBB;
+ box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
+ padding-bottom:5px;
+}
+.dialogShowing {
+ visibility: visible;
+}
+.dialogTitle {
+ display: block;
+}
+.dialogTitle {
+ padding-top: 5px;
+ display: inline-block;
+ background: #555;
+ width: 100%;
+ padding-bottom: 5px;
+ border-top-left-radius: 1px;
+ border-top-right-radius: 1px;
+}
+.dialogTitle > .dismissButton {
+ margin-right: 0;
+}
+.dialogTitleText {
+ margin: 2px 2px 0;
+ color: whitesmoke;
+ font-size: 1em;
+ height: 18px;
+ padding-left: 4px;
+ font-weight: bold;
+}
+.dialogDismiss {
+ display: block;
+ cursor: pointer;
+ padding: 2px;
+}
+.dialogContent {
+ padding: 8px;
+}
+.parameterPopup .dismissButton, .dialogTitle .dismissButton {
+ color: rgb(221, 221, 221);
+ cursor: pointer;
+}
+.parameterPopup .dismissButton:hover, .dialogTitle .dismissButton:hover {
+ color: white;
+}
+.dialogButtons {
+ -webkit-align-items: center;
+ align-items: center;
+
+ display: -webkit-flex;
+ display: flex;
+
+ -webkit-justify-content: center;
+ justify-content: center;
+ margin: 2px 4px 4px 4px;
+}
+.dialogButtons > button.commandButton {
+ min-width: 60px;
+}
+.confirmDialog {
+ min-width: 300px;
+ max-width: 450px;
+}
+.confirmDialog .checkboxWrapper {
+ margin: 10px 2px 5px 2px;
+}
+.checkboxMessage > .confirmDialogCheckbox {
+ margin: 0 5px 0 0;
+ outline: none;
+ vertical-align: top;
+}
+.modalBackdrop {
+ opacity: 0.5;
+ -webkit-transition: opacity 0.2s ease-in;
+ transition: opacity 0.2s ease-in;
+}
+.textviewTooltip {
+ background-color: #158d7a;
+}
+.textviewTooltip .commandButton {
+ border-color: white;
+ color: white;
+ margin-bottom: 2px;
+}
+.core-sprite-git-logo {
+ font-size: 20px !important;
+}
+.outlineExplorer .navlinkonpage {
+ color: #333 !important;
+}
+.outlineExplorer .treeIterationCursorRow_Dotted {
+ background-color: #1BB199;
+}
+.outlineExplorer .treeIterationCursorRow_Dotted .modelDecorationSprite {
+ color: white;
+}
+.outlineExplorer .treeIterationCursorRow_Dotted .navlinkonpage {
+ color: white !important;
+}
+.contentassist .selected {
+ background-color: #1BB199 !important;
+ background: #1BB199 !important;
+ border-radius: 0;
+ color: #FFF;
+}
diff --git a/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/orion-10.0/javascript/plugins/javascriptPlugin.html b/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/orion-10.0/javascript/plugins/javascriptPlugin.html
new file mode 100644
index 000000000..6284564b4
--- /dev/null
+++ b/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/orion-10.0/javascript/plugins/javascriptPlugin.html
@@ -0,0 +1,11 @@
+
+
+
+
+ Orion JavaScript Support
+
+
+
+ JavaScript Tools Support
+
+
\ No newline at end of file
diff --git a/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/orion-10.0/javascript/plugins/javascriptPlugin.js b/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/orion-10.0/javascript/plugins/javascriptPlugin.js
new file mode 100644
index 000000000..9641a3fd9
--- /dev/null
+++ b/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/orion-10.0/javascript/plugins/javascriptPlugin.js
@@ -0,0 +1,11 @@
+!function(e,t){"function"==typeof define&&define.amd?define([],t):(e.orion=e.orion||{},e.orion.webtools=e.orion.webtools||{},e.orion.webtools.javascript=t())}(this,function(){var e,t,n;return function(r){function i(e,t){return x.call(e,t)}function o(e,t){var n,r,i,o,a,s,l,c,u,p,f=t&&t.split("/"),d=y.map,h=d&&d["*"]||{};if(e&&"."===e.charAt(0))if(t){for(f=f.slice(0,f.length-1),e=f.concat(e.split("/")),c=0;c0&&(e.splice(c-1,2),c-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((f||h)&&d){for(n=e.split("/"),c=n.length;c>0;c-=1){if(r=n.slice(0,c).join("/"),f)for(u=f.length;u>0;u-=1)if(i=d[f.slice(0,u).join("/")],i&&(i=i[r])){o=i,a=c;break}if(o)break;!s&&h&&h[r]&&(s=h[r],l=c)}!o&&s&&(o=s,a=l),o&&(n.splice(0,a,o),e=n.join("/"))}return e}function a(e,t){return function(){return d.apply(r,S.call(arguments,0).concat([e,t]))}}function s(e){return function(t){return o(t,e)}}function l(e){return function(t){g[e]=t}}function c(e){if(i(v,e)){var t=v[e];delete v[e],b[e]=!0,f.apply(r,t)}if(!i(g,e)&&!i(b,e))throw new Error("No "+e);return g[e]}function u(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function p(e){return function(){return y&&y.config&&y.config[e]||{}}}var f,d,h,m,g={},v={},y={},b={},x=Object.prototype.hasOwnProperty,S=[].slice;h=function(e,t){var n,r=u(e),i=r[0];return e=r[1],i&&(i=o(i,t),n=c(i)),i?e=n&&n.normalize?n.normalize(e,s(t)):o(e,t):(e=o(e,t),r=u(e),i=r[0],e=r[1],i&&(n=c(i))),{f:i?i+"!"+e:e,n:e,pr:i,p:n}},m={require:function(e){return a(e)},exports:function(e){var t=g[e];return"undefined"!=typeof t?t:g[e]={}},module:function(e){return{id:e,uri:"",exports:g[e],config:p(e)}}},f=function(e,t,n,o){var s,u,p,f,d,y,x=[];if(o=o||e,"function"==typeof n){for(t=!t.length&&n.length?["require","exports","module"]:t,d=0;de-T||(T=e,r({method:"loading"}),i("heartbeat"))}function a(){var e=[];return Object.keys(S).forEach(function(t){var n=S[t];e.push({serviceId:t,names:n.names,methods:n.methods,properties:n.properties})}),{headers:d||{},services:e}}function s(e,t){if(t&&t instanceof XMLHttpRequest){var n,r;try{n=t.status,r=t.statusText}catch(i){n=0,r=""}return{status:n||0,statusText:r}}return t}function l(e){var t=e?JSON.parse(JSON.stringify(e,s)):e;return e instanceof Error&&(t.__isError=!0,t.message=t.message||e.message,t.name=t.name||e.name),t}function c(n,r){if(r=r||_,!r)return(new e).reject(new Error("plugin not connected"));n.id=String(m++);var i=new e;b[n.id]=i,i.then(null,function(e){h&&e instanceof Error&&"Cancel"===e.name&&k({requestId:n.id,method:"cancel",params:e.message?[e.message]:[]},r)});var o=Object.prototype.toString;return n.params.forEach(function(e,r){if("[object Object]"===o.call(e)&&!(e instanceof t)){var a,s;for(a in e)"[object Function]"===o.call(e[a])&&(s=s||[],s.push(a));if(s){var l=g++;x[l]=e;var c=function(){delete x[l]};i.then(c,c),n.params[r]=new t(l,s)}}}),k(n,r),i.promise}function u(e,t,n){e||0===e?k({id:e,result:null,error:t},n):console.log(t)}function p(e,t,n,r,i){r.forEach(function(e,t){if(e&&"undefined"!=typeof e.__objectId){var n={};e.__methods.forEach(function(t){n[t]=function(){return c({objectId:e.__objectId,method:t,params:Array.prototype.slice.call(arguments)},i)}}),r[t]=n}});var o="undefined"==typeof e?null:{id:e,result:null,error:null};try{var a=n.apply(t,r);if(!o)return;a&&"function"==typeof a.then?(y[e]=a,a.then(function(t){delete y[e],o.result=t,k(o,i)},function(t){y[e]&&(delete y[e],o.error=l(t),k(o,i))},function(){k({responseId:e,method:"progress",params:Array.prototype.slice.call(arguments)},i)})):(o.result=a,k(o,i))}catch(s){o&&(o.error=l(s),k(o,i))}}function f(e,t){if(w||e.source===_||"undefined"==typeof window){var n=e.data,r="string"!=typeof n?n:JSON.parse(n);try{if(r.method){var i=r.method,o=r.params||[];if("serviceId"in r){var a=S[r.serviceId];a?(a=a.implementation,i in a?p(r.id,a,a[i],o,t):u(r.id,"method not found",t)):u(r.id,"service not found",t)}else if("objectId"in r){var s=x[r.objectId];s?!i in s?p(r.id,s,s[i],o,t):u(r.id,"method not found",t):u(r.id,"object not found",t)}else if("requestId"in r){var l=y[r.requestId];l&&"cancel"===i&&l.cancel&&l.cancel.apply(l,o)}else{if(!("responseId"in r))throw new Error("Bad method: "+r.method);var c=b[r.responseId];c&&"progress"===i&&c.progress&&c.progress.apply(c,o)}}else if(r.id){var f=b[String(r.id)];f&&(delete b[String(r.id)],r.error?f.reject(r.error):f.resolve(r.result))}}catch(d){console.log("Plugin._messageHandler "+d)}}}var d=n,h=!1,m=0,g=0,v=0,y={},b={},x={},S={},E=[],w=!1,_=null;"undefined"==typeof window?self.postMessage?_=self:w=!0:window!==window.parent?_=window.parent:null!==window.opener&&(_=window.opener);var k=r,C=function(e){r({method:"error",error:l(e.error)})};addEventListener("error",C);var T,L=(new Date).getTime();o(),w&&self.addEventListener("connect",function(e){var t=e.ports[0];if(E.push(t),h){var n={method:"plugin",params:[a()]};r(n,t)}else o();t.addEventListener("message",function(e){f(e,t)}),t.start()}),this.updateHeaders=function(e){if(h)throw new Error("Cannot update headers. Plugin Provider is connected");d=e},this.registerService=function(e,t,n){if(h)throw new Error("Cannot register service. Plugin Provider is connected");"string"==typeof e?e=[e]:Array.isArray(e)||(e=[]);var r=null,i=[];for(r in t)"function"==typeof t[r]&&i.push(r);S[v++]={names:e,methods:i,implementation:t,properties:n||{},listeners:{}},o()},this.registerServiceProvider=this.registerService,this.connect=function(e,t){if(h)return void(e&&e());removeEventListener("error",C);var n={method:"plugin",params:[a()]};if(!w){if(!_)return void(t&&t("No valid plugin target"));addEventListener("message",f,!1),r(n)}E.forEach(function(e){r(n,e)}),h=!0,e&&e()},this.disconnect=function(){h&&(removeEventListener("message",f),E.forEach(function(e){e.close()}),E=null,_=null,h=!1)}}return n}),n("orion/EventTarget",[],function(){function e(){this._namedListeners={}}return e.prototype={dispatchEvent:function(e){if(!e.type)throw new Error("unspecified type");var t=this._namedListeners[e.type];return t&&t.forEach(function(t){try{"function"==typeof t?t(e):t.handleEvent(e)}catch(n){"undefined"!=typeof console&&console.log(n)}}),!e.defaultPrevented},addEventListener:function(e,t){("function"==typeof t||t.handleEvent)&&(this._namedListeners[e]=this._namedListeners[e]||[],this._namedListeners[e].push(t))},removeEventListener:function(e,t){var n=this._namedListeners[e];if(n)for(var r=0;r-1&&r[e];e--)o=r[e],n=t[o],(n===!0||1===n)&&(n=a(d+o+"/"+m)),i(y,n);s(y)})})}}})}(),n("orion/navigate/nls/messages",{root:!0}),n("orion/navigate/nls/root/messages",{Navigator:"Navigator","Strings Xtrnalizr":"Strings Xtrnalizr","Externalize strings":"Externalize strings from JavaScript files in this folder.",NotSupportFileSystem:"${0} is not supported in this file system",SrcNotSupportBinRead:"Source file service does not support binary read",TargetNotSupportBinWrite:"Target file service does not support binary write",NoFileSrv:"No matching file service for location: ${0}","Choose a Folder":"Choose a Folder","Copy of ${0}":"Copy of ${0}",EnterName:"Enter a new name for '${0}'",ChooseFolder:"Choose folder...",Rename:"Rename",RenameFilesFolders:"Rename the selected files or folders",CompareEach:"Compare with each other","Compare 2 files":"Compare the selected 2 files with each other","Compare with...":"Compare With...",CompareFolders:"Compare the selected folder with a specified folder",Delete:"Delete","Unknown item":"Unknown item","delete item msg":"Are you sure you want to delete these ${0} items?",DeleteTrg:"Are you sure you want to delete '${0}'?",Zip:"Zip",ZipDL:"Create a zip file of the folder contents and download it","New File":"File","Create a new file":"Create a new file",FailedToCreateProject:"Failed to create project: ${0}",FailedToCreateFile:"Failed to create file: ${0}",CopyFailed:"Copy operation failed",MoveFailed:"Move operation failed","Name:":"Name:","New Folder":"Folder","Folder name:":"Folder name:","Create a new folder":"Create a new folder","Creating folder":"Creating folder",Folder:"Folder","Create an empty folder":"Create an empty folder",CreateEmptyMsg:"Create an empty folder on the Orion server. You can import, upload, or create content in the editor.","Sample HTML5 Site":"Sample HTML5 Site","Generate a sample":"Generate a sample",'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.':'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.',"Creating a folder for ${0}":"Creating a folder for ${0}","SFTP Import":"SFTP Import","Import content from SFTP":"Import content from SFTP","Imported Content":"Imported Content","Upload a Zip":"Upload a Zip","Upload content from a local zip file":"Upload content from a local zip file","Uploaded Content":"Uploaded Content","Clone Git Repository":"Clone Git Repository","Clone a git repository":"Clone a git repository","Link to Server":"Link to Server",LinkContent:"Link to existing content on the server",CreateLinkedFolder:"Create a folder that links to an existing folder on the server.","Server path:":"Server path:",NameLocationNotClear:"The name and server location were not specified.","Go Up":"Go Up",GoUpToParent:"Move up to the parent folder","Go Into":"Go Into",GoSelectedFolder:"Move into the selected folder","File or zip archive":"File or Zip Archive",ImportLcFile:"Import a file or zip archive from your local file system","SFTP from...":"SFTP",CpyFrmSftp:"Copy files and folders from a specified SFTP connection","Importing from ${0}":"Importing from ${0}","SFTP to...":"SFTP",CpyToSftp:"Copy files and folders to a specified SFTP location",Exporting:"Exporting to ${0}","Pasting ${0}":"Pasting ${0}","Copy to":"Copy to","Move to":"Move to","Copying ${0}":"Copying ${0}","Moving ${0}":"Moving ${0}","Renaming ${0}":"Renaming ${0}","Deleting ${0}":"Deleting ${0}","Creating ${0}":"Creating ${0}","Linking to ${0}":"Linking to ${0}",MvToLocation:"Move files and folders to a new location",Cut:"Cut",Copy:"Copy","Fetching children of ":"Fetching children of ",Paste:"Paste","Open With":"Open With","Loading ":"Loading ",New:"New",File:"File",Actions:"Actions","Orion Content":"Orion Content","Create new content":"Create new content","Import from HTTP...":"HTTP","File URL:":"File URL:",ImportURL:"Import a file from a URL and optionally unzip it","Unzip *.zip files:":"Unzip *.zip files:","Extracted from:":"Extracted from:",FolderDropNotSupported:"Did not drop ${0}. Folder drop is not supported in this browser.",CreateFolderErr:"You cannot copy files directly into the workspace. Create a folder first.","Unzip ${0}?":"Unzip ${0}?","Upload progress: ":"Upload progress: ","Uploading ":"Uploading ","Cancel upload":"Cancel upload",UploadingFileErr:"Uploading the following file failed: ","Enter project name:":"Enter project name:","Create new project":"Create new project","Creating project ${0}":"Creating project ${0}",NoFile:"Use the ${0} menu to create new files and folders. Click a file to start coding.",Download:"Download",Download_tooltips:"Download the file contents as the displayed name","Downloading...":"Reading file contents...","Download not supported":"Contents download is not supported in this browser.",gettingContentFrom:"Getting content from ",confirmLaunchDelete:'Delete Launch Configuration "${0}" ?',deletingLaunchConfiguration:"Deleting launch configuration...",deployTo:"Deploy to ",deploy:"Deploy ",connect:"Connect",fetchContent:"Fetch content",fetchContentOf:"Fetch content of ",disconnectFromProject:"Disconnect from project",doNotTreatThisFolder:"Do not treat this folder as a part of the project",checkStatus:"Check status",checkApplicationStatus:"Check application status",checkApplicationState:"Check application state",stop:"Stop",start:"Start",stopApplication:"Stop the App",startApplication:"Start the application",manage:"Manage",manageThisApplicationOnRemote:"Manage this application on remote server",deleteLaunchConfiguration:"Delete this launch configuration",editLaunchConfiguration:"Edit this launch configuration",deployThisApplication:"Deploy the App from the Workspace",associatedFolder:"Associated Folder",associateAFolderFromThe:"Associate a folder from the workspace with this project.",convertToProject:"Convert to project",convertThisFolderIntoA:"Convert this folder into a project",thisFolderIsAProject:"This folder is a project already.",basic:"Basic","createAnEmptyProject.":"Create an empty project.",sFTP:"SFTP",createAProjectFromAn:"Create a project from an SFTP site.",readMeCommandName:"Readme File",readMeCommandTooltip:"Create a README.md file in this project",zipArchiveCommandName:"Zip Archive",zipArchiveCommandTooltip:"Create a project from a local zip archive.","Url:":"Url:",notZip:"The following files are not zip files: ${0}. Would you like to continue the import?",notZipMultiple:"There are multiple non-zip files being uploaded. Would you like to continue the import?",Cancel:"Cancel",Ok:"Ok",missingCredentials:"Enter the ${0} authentication credentials associated with ${1} to check its status.",deploying:"deploying",starting:"restarting",stopping:"stopping",checkingStateShortMessage:"checking status"}),n("orion/i18nUtil",[],function(){function e(e){var t=/\$\{([^\}]+)\}/g,n=arguments;return 2===n.length&&n[1]&&"object"==typeof n[1]?e.replace(t,function(e,t){return n[1][t]}):e.replace(t,function(e,t){return n[(t<<0)+1]})}return{formatMessage:e}}),n("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(e,t,n){function r(t,r,i){if(!t[r])throw new Error(n.formatMessage(e.NotSupportFileSystem,r));return t[r].apply(t,i)}function i(n,o,a,s){if(!n.readBlob)throw new Error(e.SrcNotSupportBinRead);if(!a.writeBlob)throw new Error(e.TargetNotSupportBinWrite);if("/"!==o[o.length-1])return r(n,"readBlob",[o]).then(function(e){return r(a,"writeBlob",[s,e])});var l=s.substring(0,s.length-1),c=decodeURIComponent(l.substring(l.lastIndexOf("/")+1)),u=l.substring(0,l.lastIndexOf("/")+1);return r(a,"createFolder",[u,c]).then(function(){},function(){}).then(function(){return r(n,"fetchChildren",[o]).then(function(e){for(var r=[],o=0;o=48&&57>=e}function r(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function i(e){return"01234567".indexOf(e)>=0}function o(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function a(e){return 10===e||13===e||8232===e||8233===e}function s(e){return 36===e||95===e||e>=65&&90>=e||e>=97&&122>=e||92===e||e>=128&&Fn.NonAsciiIdentifierStart.test(String.fromCharCode(e))}function l(e){return 36===e||95===e||e>=65&&90>=e||e>=97&&122>=e||e>=48&&57>=e||92===e||e>=128&&Fn.NonAsciiIdentifierPart.test(String.fromCharCode(e))}function c(e){switch(e){case"class":case"enum":case"export":case"extends":case"import":case"super":return!0;default:return!1}}function u(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}}function p(e){return"eval"===e||"arguments"===e}function f(e){if(In&&u(e))return!0;switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e||"let"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}}function d(e,n,r,i,o){var a;t("number"==typeof r,"Comment must have valid position"),zn.lastCommentStart=r,a={type:e,value:n},Jn.range&&(a.range=[r,i]),Jn.loc&&(a.loc=o),Jn.comments.push(a),Jn.attachComment&&(Jn.leadingComments.push(a),Jn.trailingComments.push(a))}function h(e){var t,n,r,i;for(t=Nn-e,n={start:{line:Rn,column:Nn-Dn-e}};Hn>Nn;)if(r=On.charCodeAt(Nn),++Nn,a(r))return Mn=!0,Jn.comments&&(i=On.slice(t+e,Nn-1),n.end={line:Rn,column:Nn-Dn-1},d("Line",i,t,Nn-1,n)),13===r&&10===On.charCodeAt(Nn)&&++Nn,++Rn,void(Dn=Nn);Jn.comments&&(i=On.slice(t+e,Nn),n.end={line:Rn,column:Nn-Dn},d("Line",i,t,Nn,n))}function m(){var e,t,n,r;for(Jn.comments&&(e=Nn-2,t={start:{line:Rn,column:Nn-Dn-2}});Hn>Nn;)if(n=On.charCodeAt(Nn),a(n))13===n&&10===On.charCodeAt(Nn+1)&&++Nn,Mn=!0,++Rn,++Nn,Dn=Nn;else if(42===n){if(47===On.charCodeAt(Nn+1))return++Nn,++Nn,void(Jn.comments&&(r=On.slice(e+2,Nn-2),t.end={line:Rn,column:Nn-Dn},d("Block",r,e,Nn,t)));++Nn}else++Nn;Nn>=Hn&&Jn.comments?(t.end={line:Rn,column:Nn-Dn},r=On.slice(e+2,Nn),d("Block",r,e,Nn,t),X()):Z()}function g(){var e,t;for(Mn=!1,t=0===Nn;Hn>Nn;)if(e=On.charCodeAt(Nn),o(e))++Nn;else if(a(e))Mn=!0,++Nn,13===e&&10===On.charCodeAt(Nn)&&++Nn,++Rn,Dn=Nn,t=!0;else if(47===e)if(e=On.charCodeAt(Nn+1),47===e)++Nn,++Nn,h(2),t=!0;else{if(42!==e)break;++Nn,++Nn,m()}else if(t&&45===e){if(45!==On.charCodeAt(Nn+1)||62!==On.charCodeAt(Nn+2))break;Nn+=3,h(3)}else{if(60!==e)break;if("!--"!==On.slice(Nn+1,Nn+4))break;
+++Nn,++Nn,++Nn,++Nn,h(4)}}function v(e){var t,n,i,o=0;for(n="u"===e?4:2,t=0;n>t;++t){if(!(Hn>Nn&&r(On[Nn])))return"";i=On[Nn++],o=16*o+"0123456789abcdef".indexOf(i.toLowerCase())}return String.fromCharCode(o)}function y(){var e,t,n,i;for(e=On[Nn],t=0,"}"===e&&Z();Hn>Nn&&(e=On[Nn++],r(e));)t=16*t+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||"}"!==e)&&Z(),65535>=t?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function b(){var e,t;for(e=On.charCodeAt(Nn++),t=String.fromCharCode(e),92===e&&(117!==On.charCodeAt(Nn)&&Z(),++Nn,e=v("u"),e&&"\\"!==e&&s(e.charCodeAt(0))||Z(),t=e);Hn>Nn&&(e=On.charCodeAt(Nn),l(e));)++Nn,t+=String.fromCharCode(e),92===e&&(t=t.substr(0,t.length-1),117!==On.charCodeAt(Nn)&&Z(),++Nn,e=v("u"),e&&"\\"!==e&&l(e.charCodeAt(0))||Z(),t+=e);return t}function x(){var e,t;for(e=Nn++;Hn>Nn;){if(t=On.charCodeAt(Nn),92===t)return Nn=e,b();if(!l(t))break;++Nn}return On.slice(e,Nn)}function S(){var e,t,n;return e=Nn,t=92===On.charCodeAt(Nn)?b():x(),n=1===t.length?kn.Identifier:f(t)?kn.Keyword:"null"===t?kn.NullLiteral:"true"===t||"false"===t?kn.BooleanLiteral:kn.Identifier,{type:n,value:t,lineNumber:Rn,lineStart:Dn,start:e,end:Nn}}function E(){var e,t,n,r,i=Nn,o=On.charCodeAt(Nn),a=On[Nn];switch(o){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++Nn,Jn.tokenize&&(40===o?Jn.openParenToken=Jn.tokens.length:123===o&&(Jn.openCurlyToken=Jn.tokens.length)),{type:kn.Punctuator,value:String.fromCharCode(o),lineNumber:Rn,lineStart:Dn,start:i,end:Nn};default:if(e=On.charCodeAt(Nn+1),61===e)switch(o){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return Nn+=2,{type:kn.Punctuator,value:String.fromCharCode(o)+String.fromCharCode(e),lineNumber:Rn,lineStart:Dn,start:i,end:Nn};case 33:case 61:return Nn+=2,61===On.charCodeAt(Nn)&&++Nn,{type:kn.Punctuator,value:On.slice(i,Nn),lineNumber:Rn,lineStart:Dn,start:i,end:Nn}}}if(r=On.substr(Nn,4),">>>="===r)return Nn+=4,{type:kn.Punctuator,value:r,lineNumber:Rn,lineStart:Dn,start:i,end:Nn};if(n=r.substr(0,3),">>>"===n||"<<="===n||">>="===n)return Nn+=3,{type:kn.Punctuator,value:n,lineNumber:Rn,lineStart:Dn,start:i,end:Nn};if(t=n.substr(0,2),a===t[1]&&"+-<>&|".indexOf(a)>=0||"=>"===t)return Nn+=2,{type:kn.Punctuator,value:t,lineNumber:Rn,lineStart:Dn,start:i,end:Nn};if("<>=!+-*%&|^/".indexOf(a)>=0)return++Nn,{type:kn.Punctuator,value:a,lineNumber:Rn,lineStart:Dn,start:i,end:Nn};++Nn;var s={type:kn.Punctuator,lineNumber:Rn,lineStart:Dn,start:i,end:Nn,value:On.slice(i,Nn)};Z(s)}function w(e){for(var t="";Hn>Nn&&r(On[Nn]);)t+=On[Nn++];return 0===t.length&&Z(),s(On.charCodeAt(Nn))&&Z(),{type:kn.NumericLiteral,value:parseInt("0x"+t,16),lineNumber:Rn,lineStart:Dn,start:e,end:Nn}}function _(e){var t,r;for(r="";Hn>Nn&&(t=On[Nn],"0"===t||"1"===t);)r+=On[Nn++];return 0===r.length&&Z(),Hn>Nn&&(t=On.charCodeAt(Nn),(s(t)||n(t))&&Z()),{type:kn.NumericLiteral,value:parseInt(r,2),lineNumber:Rn,lineStart:Dn,start:e,end:Nn}}function k(e,t){var r,o;for(i(e)?(o=!0,r="0"+On[Nn++]):(o=!1,++Nn,r="");Hn>Nn&&i(On[Nn]);)r+=On[Nn++];return o||0!==r.length||Z(),(s(On.charCodeAt(Nn))||n(On.charCodeAt(Nn)))&&Z(),{type:kn.NumericLiteral,value:parseInt(r,8),octal:o,lineNumber:Rn,lineStart:Dn,start:t,end:Nn}}function C(){var e,t;for(e=Nn+1;Hn>e;++e){if(t=On[e],"8"===t||"9"===t)return!1;if(!i(t))return!0}return!0}function T(){var e,r,o;if(o=On[Nn],t(n(o.charCodeAt(0))||"."===o,"Numeric literal must start with a decimal digit or a decimal point"),r=Nn,e="","."!==o){if(e=On[Nn++],o=On[Nn],"0"===e){if("x"===o||"X"===o)return++Nn,w(r);if("b"===o||"B"===o)return++Nn,_(r);if("o"===o||"O"===o)return k(o,r);if(i(o)&&C())return k(o,r)}for(;n(On.charCodeAt(Nn));)e+=On[Nn++];o=On[Nn]}if("."===o){for(e+=On[Nn++];n(On.charCodeAt(Nn));)e+=On[Nn++];o=On[Nn]}if("e"===o||"E"===o)if(e+=On[Nn++],o=On[Nn],("+"===o||"-"===o)&&(e+=On[Nn++]),n(On.charCodeAt(Nn)))for(;n(On.charCodeAt(Nn));)e+=On[Nn++];else Z();return s(On.charCodeAt(Nn))&&Z(),{type:kn.NumericLiteral,value:parseFloat(e),lineNumber:Rn,lineStart:Dn,start:r,end:Nn}}function L(){var e,n,r,o,s,l,c="",u=!1;for(e=On[Nn],t("'"===e||'"'===e,"String literal must starts with a quote"),n=Nn,++Nn;Hn>Nn;){if(r=On[Nn++],r===e){e="";break}if("\\"===r)if(r=On[Nn++],r&&a(r.charCodeAt(0)))++Rn,"\r"===r&&"\n"===On[Nn]&&++Nn,Dn=Nn;else switch(r){case"u":case"x":"{"===On[Nn]?(++Nn,c+=y()):(l=Nn,s=v(r),s?c+=s:(Nn=l,c+=r));break;case"n":c+="\n";break;case"r":c+="\r";break;case"t":c+=" ";break;case"b":c+="\b";break;case"f":c+="\f";break;case"v":c+="";break;default:i(r)?(o="01234567".indexOf(r),0!==o&&(u=!0),Hn>Nn&&i(On[Nn])&&(u=!0,o=8*o+"01234567".indexOf(On[Nn++]),"0123".indexOf(r)>=0&&Hn>Nn&&i(On[Nn])&&(o=8*o+"01234567".indexOf(On[Nn++]))),c+=String.fromCharCode(o)):c+=r}else{if(a(r.charCodeAt(0)))break;c+=r}}var p={type:kn.StringLiteral,value:c,octal:u,lineNumber:Gn,lineStart:Wn,start:n,end:Nn};return""!==e&&X(p),p}function A(e,t){var n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,function(e,t){return parseInt(t,16)<=1114111?"x":void Z(null,jn.InvalidRegExp)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{RegExp(n)}catch(r){Z(null,jn.InvalidRegExp)}try{return new RegExp(e,t)}catch(i){return null}}function P(){var e,n,r,i,o;for(e=On[Nn],t("/"===e,"Regular expression literal must start with a slash"),n=On[Nn++],r=!1,i=!1;Hn>Nn;)if(e=On[Nn++],n+=e,"\\"===e)e=On[Nn++],a(e.charCodeAt(0))&&Z(null,jn.UnterminatedRegExp),n+=e;else if(a(e.charCodeAt(0)))Z(null,jn.UnterminatedRegExp);else if(r)"]"===e&&(r=!1);else{if("/"===e){i=!0;break}"["===e&&(r=!0)}return i||Z(Kn,jn.UnterminatedRegExp),o=n.substr(1,n.length-2),{value:o,literal:n}}function j(){var e,t,n,r;for(t="",n="";Hn>Nn&&(e=On[Nn],l(e.charCodeAt(0)));)if(++Nn,"\\"===e&&Hn>Nn)if(e=On[Nn],"u"===e){if(++Nn,r=Nn,e=v("u"))for(n+=e,t+="\\u";Nn>r;++r)t+=On[r];else Nn=r,n+="u",t+="\\u";X()}else t+="\\",X();else n+=e,t+=e;return{value:n,literal:t}}function F(){qn=!0;var e,t,n,r;return g(),e=Nn,t=P(),n=j(),r=A(t.value,n.value),qn=!1,Jn.tokenize?{type:kn.RegularExpression,value:r,regex:{pattern:t.value,flags:n.value},lineNumber:Rn,lineStart:Dn,start:e,end:Nn}:{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:Nn}}function O(){var e,t,n,r;return g(),e=Nn,t={start:{line:Rn,column:Nn-Dn}},n=F(),t.end={line:Rn,column:Nn-Dn},Jn.tokenize||(Jn.tokens.length>0&&(r=Jn.tokens[Jn.tokens.length-1],r.range[0]===e&&"Punctuator"===r.type&&("/"===r.value||"/="===r.value)&&Jn.tokens.pop()),Jn.tokens.push({type:"RegularExpression",value:n.literal,regex:n.regex,range:[e,Nn],loc:t})),n}function I(e){return e.type===kn.Identifier||e.type===kn.Keyword||e.type===kn.BooleanLiteral||e.type===kn.NullLiteral}function N(){var e,t;if(e=Jn.tokens[Jn.tokens.length-1],!e)return O();if("Punctuator"===e.type){if("]"===e.value)return E();if(")"===e.value)return t=Jn.tokens[Jn.openParenToken-1],!t||"Keyword"!==t.type||"if"!==t.value&&"while"!==t.value&&"for"!==t.value&&"with"!==t.value?E():O();if("}"===e.value){if(Jn.tokens[Jn.openCurlyToken-3]&&"Keyword"===Jn.tokens[Jn.openCurlyToken-3].type){if(t=Jn.tokens[Jn.openCurlyToken-4],!t)return E()}else{if(!Jn.tokens[Jn.openCurlyToken-4]||"Keyword"!==Jn.tokens[Jn.openCurlyToken-4].type)return E();if(t=Jn.tokens[Jn.openCurlyToken-5],!t)return O()}return Tn.indexOf(t.value)>=0?E():O()}return O()}return"Keyword"===e.type&&"this"!==e.value?O():E()}function R(){var e;return Nn>=Hn?{type:kn.EOF,lineNumber:Rn,lineStart:Dn,start:Nn,end:Nn,range:[Nn,Nn]}:(e=On.charCodeAt(Nn),s(e)?S():40===e||41===e||59===e?E():39===e||34===e?L():46===e?n(On.charCodeAt(Nn+1))?T():E():n(e)?T():Jn.tokenize&&47===e?N():E())}function D(){var e,t,n,r;return e={start:{line:Rn,column:Nn-Dn}},t=R(),e.end={line:Rn,column:Nn-Dn},t.type!==kn.EOF&&(n=On.slice(t.start,t.end),r={type:Cn[t.type],value:n,range:[t.start,t.end],loc:e},t.regex&&(r.regex={pattern:t.regex.pattern,flags:t.regex.flags}),Jn.tokens.push(r)),t}function M(){var e;return qn=!0,Vn=Nn,$n=Rn,Un=Dn,g(),e=Kn,Bn=Nn,Gn=Rn,Wn=Dn,Kn="undefined"!=typeof Jn.tokens?D():R(),qn=!1,e}function V(){qn=!0,g(),Vn=Nn,$n=Rn,Un=Dn,Bn=Nn,Gn=Rn,Wn=Dn,Kn="undefined"!=typeof Jn.tokens?D():R(),qn=!1}function $(e){if(Jn.deps)for(var t=e.length,n=0;t>n;n++)U(e[n])}function U(e){if(Jn.deps&&e.type===Ln.Literal){for(var t=0;t1&&(r=t[1],r.type===Ln.ArrayExpression&&(Jn.envs.node=!0,$(r.elements)))}else"requirejs"===e.name?(r=t[0],r.type===Ln.ArrayExpression&&(Jn.envs.amd=!0,$(r.elements))):"define"===e.name&&n>1&&(r=t[0],r.type===Ln.Literal&&(r=t[1]),r.type===Ln.ArrayExpression&&(Jn.envs.amd=!0,$(r.elements)))}}function G(){this.line=Gn,this.column=Bn-Wn}function W(){this.start=new G,this.end=null}function q(e){this.start={line:e.lineNumber,column:e.start-e.lineStart},this.end=null}function H(){Jn.loc&&(this.loc=new W),Jn.range&&(this.range=[Bn,0]),Jn.directSourceFile&&(this.sourceFile=Jn.directSourceFile)}function K(e){Jn.loc&&(this.loc=new q(e)),Jn.range&&(this.range=[e.start,0]),Jn.directSourceFile&&(this.sourceFile=Jn.directSourceFile)}function z(e,t,n,r){var i=new Error("Line "+e+": "+n);if(i.index=t,i.lineNumber=e,i.column=t-(qn?Dn:Un)+1,i.description=n,r){var o=r;2===r.type&&Jn&&Array.isArray(Jn.tokens)&&Jn.tokens.length>0&&(o=Jn.tokens[Jn.tokens.length-1]),i.index="number"==typeof o.start?o.start:o.range[0],i.token=o.value,i.end="number"==typeof o.end?o.end:o.range[1]}return i}function J(e){var n,r;throw n=Array.prototype.slice.call(arguments,1),r=e.replace(/%(\d)/g,function(e,r){return t(r0&&(t=Jn.tokens[Jn.tokens.length-2]),X(t,jn.MissingToken,n)}else t.type!==kn.EOF&&(Jn.tokens&&Jn.tokens.length>0&&(t=Jn.tokens[Jn.tokens.length-2]),X(t,jn.MissingToken,","));else et(",")}function nt(e){var t=M();(t.type!==kn.Keyword||t.value!==e)&&Z(t)}function rt(e){return Kn.type===kn.Punctuator&&Kn.value===e}function it(e){return Kn.type===kn.Keyword&&Kn.value===e}function ot(){var e;return Kn.type!==kn.Punctuator?!1:(e=Kn.value,"="===e||"*="===e||"/="===e||"%="===e||"+="===e||"-="===e||"<<="===e||">>="===e||">>>="===e||"&="===e||"^="===e||"|="===e)}function at(){try{if(59===On.charCodeAt(Bn)||rt(";"))return void M();if(Mn)return;if(Vn=Bn,$n=Gn,Un=Wn,Kn.type!==kn.EOF&&!rt("}")){var e=Kn;Jn.errors&&xn(Wn),Z(e)}}catch(t){if(Jn.errors)return void vn(t);throw t}}function st(e){return e.type===Ln.Identifier||e.type===Ln.MemberExpression}function lt(){var e=[],t=new H;for(et("[");!rt("]");)rt(",")?(M(),e.push(null)):(e.push(Pt()),rt("]")||et(","));return M(),t.finishArrayExpression(e)}function ct(e,t){var n,r,i=new H;return n=In,r=rn(),t&&In&&p(e[0].name)&&X(t,jn.StrictParamName),In=n,i.finishFunctionExpression(null,e,[],r)}function ut(){var e,t=new H;return e=M(),e.type===kn.StringLiteral||e.type===kn.NumericLiteral?(In&&e.octal&&X(e,jn.StrictOctalLiteral),t.finishLiteral(e)):t.finishIdentifier(e.value)}function pt(){var e,t,n,r,i,o=new H;return e=Kn,e.type===kn.Identifier?(n=ut(),"get"!==e.value||rt(":")||rt("(")?"set"!==e.value||rt(":")||rt("(")?_n(e,n,o):(t=ut(),et("("),e=Kn,e.type!==kn.Identifier?(et(")"),X(e),r=ct([])):(i=[It()],et(")"),r=ct(i,e)),o.finishProperty("set",t,r,!1,!1)):(t=ut(),et("("),et(")"),r=ct([]),o.finishProperty("get",t,r,!1,!1))):e.type!==kn.EOF&&e.type!==kn.Punctuator?_n(e,ut(),o):void Z(e)}function ft(){var e,t,n,r,i=[],o={},a=String,s=new H;for(et("{");!rt("}");)e=pt(),null!=e&&"undefined"!=typeof e&&(t=e.key.type===Ln.Identifier?e.key.name:a(e.key.value),r="init"===e.kind?Pn.Data:"get"===e.kind?Pn.Get:Pn.Set,n="$"+t,Object.prototype.hasOwnProperty.call(o,n)?(o[n]===Pn.Data?In&&r===Pn.Data?Q(jn.StrictDuplicateProperty):r!==Pn.Data&&Q(jn.AccessorDataProperty):r===Pn.Data?Q(jn.AccessorDataProperty):o[n]&r&&Q(jn.AccessorGetSet),o[n]|=r):o[n]=r,i.push(e),rt("}")||tt("}"));return et("}"),s.finishObjectExpression(i)}function dt(){var e;return et("("),rt(")")?(M(),An.ArrowParameterPlaceHolder):(++zn.parenthesisCount,e=jt(),et(")"),e)}function ht(){var e,t,n,r;if(rt("("))return dt();if(rt("["))return lt();if(rt("{"))return ft();if(e=Kn.type,r=new H,e===kn.Identifier)n=r.finishIdentifier(M().value);else if(e===kn.StringLiteral||e===kn.NumericLiteral)In&&Kn.octal&&X(Kn,jn.StrictOctalLiteral),n=r.finishLiteral(M());else if(e===kn.Keyword){if(it("function"))return cn();it("this")?(M(),n=r.finishThisExpression()):Z(M())}else e===kn.BooleanLiteral?(t=M(),t.value="true"===t.value,n=r.finishLiteral(t)):e===kn.NullLiteral?(t=M(),t.value=null,n=r.finishLiteral(t)):rt("/")||rt("/=")?(Nn=Bn,t="undefined"!=typeof Jn.tokens?O():F(),M(),n=r.finishLiteral(t)):Z(M());return n}function mt(){var e=[];if(et("("),!rt(")"))for(;Hn>Bn&&(e.push(Pt()),!rt(")"));)tt(")");return gn(")"),e}function gt(){var e,t=new H;try{e=M(),I(e)||(Jn.errors&&En(e),Z(e))}catch(n){if(Jn.errors)return vn(n),wn(t,Ln.Identifier);throw n}return t.finishIdentifier(e.value)}function vt(){return et("."),gt()}function yt(){var e;return et("["),e=jt(),et("]"),e}function bt(){var e,t,n=new H;return nt("new"),e=St(),t=rt("(")?mt():[],n.finishNewExpression(e,t)}function xt(){var e,t,n,r,i=zn.allowIn;for(r=Kn,zn.allowIn=!0,e=it("new")?bt():ht();;)if(rt("."))n=vt(),e=new K(r).finishMemberExpression(".",e,n);else if(rt("("))t=mt(),e=new K(r).finishCallExpression(e,t);else{if(!rt("["))break;n=yt(),e=new K(r).finishMemberExpression("[",e,n)}return zn.allowIn=i,e}function St(){var e,n,r;for(t(zn.allowIn,"callee of new expression always allow in keyword."),r=Kn,e=it("new")?bt():ht();;)if(rt("["))n=yt(),e=new K(r).finishMemberExpression("[",e,n);else{if(!rt("."))break;n=vt(),e=new K(r).finishMemberExpression(".",e,n)}return e}function Et(){var e,t,n=Kn;return e=xt(),Mn||Kn.type!==kn.Punctuator||(rt("++")||rt("--"))&&(In&&e.type===Ln.Identifier&&p(e.name)&&Q(jn.StrictLHSPostfix),st(e)||Q(jn.InvalidLHSInAssignment),t=M(),e=new K(n).finishPostfixExpression(t.value,e)),e}function wt(){var e,t,n;return Kn.type!==kn.Punctuator&&Kn.type!==kn.Keyword?t=Et():rt("++")||rt("--")?(n=Kn,e=M(),t=wt(),In&&t.type===Ln.Identifier&&p(t.name)&&Q(jn.StrictLHSPrefix),st(t)||Q(jn.InvalidLHSInAssignment),t=new K(n).finishUnaryExpression(e.value,t)):rt("+")||rt("-")||rt("~")||rt("!")?(n=Kn,e=M(),t=wt(),t=new K(n).finishUnaryExpression(e.value,t)):it("delete")||it("void")||it("typeof")?(n=Kn,e=M(),t=wt(),t=new K(n).finishUnaryExpression(e.value,t),In&&"delete"===t.operator&&t.argument.type===Ln.Identifier&&Q(jn.StrictDelete)):t=Et(),t}function _t(e,t){var n=0;if(e.type!==kn.Punctuator&&e.type!==kn.Keyword)return 0;switch(e.value){case"||":n=1;break;case"&&":n=2;break;case"|":n=3;break;case"^":n=4;break;case"&":n=5;break;case"==":case"!=":case"===":case"!==":n=6;break;case"<":case">":case"<=":case">=":case"instanceof":n=7;break;case"in":n=t?7:0;break;case"<<":case">>":case">>>":n=8;break;case"+":case"-":n=9;break;case"*":case"/":case"%":n=11}return n}function kt(){var e,t,n,r,i,o,a,s,l,c;if(e=Kn,l=wt(),l===An.ArrowParameterPlaceHolder)return l;if(r=Kn,i=_t(r,zn.allowIn),0===i)return l;for(r.prec=i,M(),t=[e,Kn],a=wt(),o=[l,r,a];(i=_t(Kn,zn.allowIn))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,l=o.pop(),t.pop(),n=new K(t[t.length-1]).finishBinaryExpression(s,l,a),o.push(n);r=M(),r.prec=i,o.push(r),t.push(Kn),n=wt(),o.push(n)}for(c=o.length-1,n=o[c],t.pop();c>1;)n=new K(t.pop()).finishBinaryExpression(o[c-1].value,o[c-2],n),c-=2;return n}function Ct(){var e,t,n,r,i;return i=Kn,e=kt(),e===An.ArrowParameterPlaceHolder?e:(rt("?")&&(M(),t=zn.allowIn,zn.allowIn=!0,n=Pt(),zn.allowIn=t,et(":"),r=Pt(),e=new K(i).finishConditionalExpression(e,n,r)),e)}function Tt(){return rt("{")?rn():Pt()}function Lt(e){var t,n,r,i,o,a,s,l,c;for(i=[],o=[],a=0,l=null,s={paramSet:{}},t=0,n=e.length;n>t;t+=1)if(r=e[t],r.type===Ln.Identifier)i.push(r),o.push(null),on(s,r,r.name);else{if(r.type!==Ln.AssignmentExpression)return null;i.push(r.left),o.push(r.right),++a,on(s,r.left,r.left.name)}return s.message===jn.StrictParamDupe&&(c=In?s.stricted:s.firstRestricted,Z(c,s.message)),0===a&&(o=[]),{params:i,defaults:o,rest:l,stricted:s.stricted,firstRestricted:s.firstRestricted,message:s.message}}function At(e,t){var n,r;return et("=>"),n=In,r=Tt(),In&&e.firstRestricted&&Z(e.firstRestricted,e.message),In&&e.stricted&&X(e.stricted,e.message),In=n,t.finishArrowFunctionExpression(e.params,e.defaults,r,r.type!==Ln.BlockStatement)}function Pt(){var e,t,n,r,i,o;return e=zn.parenthesisCount,o=Kn,t=Kn,n=Ct(),n!==An.ArrowParameterPlaceHolder&&!rt("=>")||zn.parenthesisCount!==e&&zn.parenthesisCount!==e+1||(n.type===Ln.Identifier?i=Lt([n]):n.type===Ln.AssignmentExpression?i=Lt([n]):n.type===Ln.SequenceExpression?i=Lt(n.expressions):n===An.ArrowParameterPlaceHolder&&(i=Lt([])),!i)?(ot()&&(st(n)||Q(jn.InvalidLHSInAssignment),In&&n.type===Ln.Identifier&&p(n.name)&&X(t,jn.StrictLHSAssignment),t=M(),r=Pt(),n=new K(o).finishAssignmentExpression(t.value,n,r)),n):At(i,new K(o))}function jt(){var e,t,n=Kn;if(e=Pt(),rt(",")){for(t=[e];Hn>Bn&&rt(",");)M(),t.push(Pt());e=new K(n).finishSequenceExpression(t)}return e}function Ft(){for(var e,t=[],n=Nn;Hn>Bn&&!rt("}")&&(e=un(),"undefined"!=typeof e&&n!==Nn);)t.push(e),n=Nn;return t}function Ot(){var e,t=new H;return et("{"),e=Ft(),gn("}"),t.finishBlockStatement(e)}function It(){var e,t=new H;return e=M(),e.type!==kn.Identifier&&(In&&e.type===kn.Keyword&&u(e.value)?X(e,jn.StrictReservedWord):Z(e)),t.finishIdentifier(e.value)}function Nt(e){var t,n=null,r=new H;return t=It(),In&&p(t.name)&&Q(jn.StrictVarName),"const"===e?(et("="),n=Pt()):rt("=")&&(M(),n=Pt()),r.finishVariableDeclarator(t,n)}function Rt(e){var t=[];do{if(t.push(Nt(e)),!rt(","))break;M()}while(Hn>Bn);return t}function Dt(e){var t;return nt("var"),t=Rt(),at(),e.finishVariableDeclaration(t,"var")}function Mt(e){var t,n=new H;return nt(e),t=Rt(e),at(),n.finishVariableDeclaration(t,e)}function Vt(){var e=new H;return et(";"),e.finishEmptyStatement()}function $t(e){var t=jt();return at(),t||(t=wn(e)),e.finishExpressionStatement(t)}function Ut(e){var t,n,r;return nt("if"),et("("),t=jt(),gn(")","{"),n=nn(),it("else")?(M(),r=nn()):r=null,e.finishIfStatement(t,n,r)}function Bt(e){var t,n,r;return nt("do"),r=zn.inIteration,zn.inIteration=!0,t=nn(),zn.inIteration=r,nt("while"),et("("),n=jt(),gn(")","{"),rt(";")&&M(),e.finishDoWhileStatement(t,n)}function Gt(e){var t,n,r;return nt("while"),et("("),t=jt(),gn(")","{"),r=zn.inIteration,zn.inIteration=!0,n=nn(),zn.inIteration=r,e.finishWhileStatement(t,n)}function Wt(){var e,t,n=new H;return e=M(),t=Rt(),n.finishVariableDeclaration(t,e.value)}function qt(e){var t,n,r,i,o,a,s,l=zn.allowIn;return t=n=r=null,nt("for"),et("("),rt(";")?M():(it("var")||it("let")?(zn.allowIn=!1,t=Wt(),zn.allowIn=l,1===t.declarations.length&&it("in")&&(M(),i=t,o=jt(),t=null)):(zn.allowIn=!1,t=jt(),zn.allowIn=l,it("in")&&(st(t)||Q(jn.InvalidLHSInForIn),M(),i=t,o=jt(),t=null)),"undefined"==typeof i&&et(";")),"undefined"==typeof i&&(rt(";")||(n=jt()),et(";"),rt(")")||(r=jt())),gn(")","{"),s=zn.inIteration,zn.inIteration=!0,a=nn(),zn.inIteration=s,"undefined"==typeof i?e.finishForStatement(t,n,r,a):e.finishForInStatement(i,o,a)}function Ht(e){var t,n=null;if(nt("continue"),59===On.charCodeAt(Bn))return M(),zn.inIteration||J(jn.IllegalContinue),e.finishContinueStatement(null);if(Mn)return zn.inIteration||J(jn.IllegalContinue),e.finishContinueStatement(null);if(Kn.type===kn.Identifier){var r=Kn;n=It(),t="$"+n.name,Object.prototype.hasOwnProperty.call(zn.labelSet,t)||X(r,jn.UnknownLabel,n.name)}return at(),null!==n||zn.inIteration||J(jn.IllegalContinue),e.finishContinueStatement(n)}function Kt(e){var t,n=null;return nt("break"),59===On.charCodeAt(Vn)?(M(),zn.inIteration||zn.inSwitch||J(jn.IllegalBreak),e.finishBreakStatement(null)):Mn?(zn.inIteration||zn.inSwitch||J(jn.IllegalBreak),e.finishBreakStatement(null)):(Kn.type===kn.Identifier&&(n=It(),t="$"+n.name,Object.prototype.hasOwnProperty.call(zn.labelSet,t)||J(jn.UnknownLabel,n.name)),at(),null!==n||zn.inIteration||zn.inSwitch||J(jn.IllegalBreak),e.finishBreakStatement(n))}function zt(e){var t=null,n=Kn;return nt("return"),zn.inFunctionBody||X(n,jn.IllegalReturn,n.value),32===On.charCodeAt(Vn)&&s(On.charCodeAt(Vn+1))?(t=jt(),at(),e.finishReturnStatement(t)):Mn?e.finishReturnStatement(null):(rt(";")||rt("}")||Kn.type===kn.EOF||(t=jt()),at(),e.finishReturnStatement(t))}function Jt(e){var t,n;return In&&Q(jn.StrictModeWith),nt("with"),et("("),t=jt(),gn(")","{"),n=nn(),e.finishWithStatement(t,n)}function Qt(){var e,t,n=[],r=new H;it("default")?(M(),e=null):(nt("case"),e=jt()),rt(":")&&M();for(var i=Nn;Hn>Bn&&!(rt("}")||it("default")||it("case"))&&(t=nn(),"undefined"!=typeof t&&null!==t)&&(n.push(t),i!==Nn);)i=Nn;return r.finishSwitchCase(e,n)}function Yt(e){var t,n,r,i,o;if(nt("switch"),et("("),t=jt(),et(")"),et("{"),n=[],rt("}"))return M(),e.finishSwitchStatement(t,n);for(i=zn.inSwitch,zn.inSwitch=!0,o=!1;Hn>Bn&&!rt("}");)r=Qt(),null===r.test&&(o&&J(jn.MultipleDefaultsInSwitch),o=!0),n.push(r);return zn.inSwitch=i,et("}"),e.finishSwitchStatement(t,n)}function Zt(e){var t;return nt("throw"),Mn&&J(jn.NewlineAfterThrow),t=jt(),at(),e.finishThrowStatement(t)}function Xt(){var e,t,n=new H;return nt("catch"),et("("),rt(")")&&Z(Kn),e=It(),In&&p(e.name)&&Q(jn.StrictCatchVariable),et(")"),t=Ot(),n.finishCatchClause(e,t)}function en(e){var t,n=[],r=null;return nt("try"),t=Ot(),it("catch")&&n.push(Xt()),it("finally")&&(M(),r=Ot()),0!==n.length||r||J(jn.NoCatchOrFinally),e.finishTryStatement(t,[],n,r)}function tn(e){return nt("debugger"),at(),e.finishDebuggerStatement()}function nn(){var e,t,n,r,i=Kn.type;if(i===kn.EOF&&Z(Kn),i===kn.Punctuator&&"{"===Kn.value)return Ot();if(r=new H,i===kn.Punctuator)switch(Kn.value){case";":return Vt(r);case"(":return $t(r)}else if(i===kn.Keyword)switch(Kn.value){case"break":return Kt(r);case"continue":return Ht(r);case"debugger":return tn(r);case"do":return Bt(r);case"for":return qt(r);case"function":return ln(r);case"if":return Ut(r);case"return":return zt(r);case"switch":return Yt(r);case"throw":return Zt(r);case"try":return en(r);case"var":return Dt(r);case"while":return Gt(r);case"with":return Jt(r)}return e=jt(),e&&e.type===Ln.Identifier&&rt(":")?(M(),n="$"+e.name,Object.prototype.hasOwnProperty.call(zn.labelSet,n)&&J(jn.Redeclaration,"Label",e.name),zn.labelSet[n]=!0,t=nn(),delete zn.labelSet[n],r.finishLabeledStatement(e,t)):(at(),e||(e=wn(r)),r.finishExpressionStatement(e))}function rn(){var e,t,n,r,i,o,a,s,l,c=[],u=new H;for(et("{");Hn>Bn&&Kn.type===kn.StringLiteral&&(t=Kn,e=un(),c.push(e),e.expression.type===Ln.Literal);)n=On.slice(t.start+1,t.end-1),"use strict"===n?(In=!0,r&&X(r,jn.StrictOctalLiteral)):!r&&t.octal&&(r=t);i=zn.labelSet,o=zn.inIteration,a=zn.inSwitch,s=zn.inFunctionBody,l=zn.parenthesizedCount,zn.labelSet={},zn.inIteration=!1,zn.inSwitch=!1,zn.inFunctionBody=!0,zn.parenthesizedCount=0;for(var p=Nn;Hn>Nn&&!rt("}")&&(e=un(),"undefined"!=typeof e&&null!=e)&&(c.push(e),p!==Nn);)p=Nn;return gn("}"),zn.labelSet=i,zn.inIteration=o,zn.inSwitch=a,zn.inFunctionBody=s,zn.parenthesizedCount=l,u.finishBlockStatement(c)}function on(e,t,n){var r="$"+n;In?(p(n)&&(e.stricted=t,e.message=jn.StrictParamName),Object.prototype.hasOwnProperty.call(e.paramSet,r)&&(e.stricted=t,e.message=jn.StrictParamDupe)):e.firstRestricted||(p(n)?(e.firstRestricted=t,e.message=jn.StrictParamName):u(n)?(e.firstRestricted=t,e.message=jn.StrictReservedWord):Object.prototype.hasOwnProperty.call(e.paramSet,r)&&(e.firstRestricted=t,e.message=jn.StrictParamDupe)),e.paramSet[r]=!0}function an(e){var t,n,r;return t=Kn,n=It(),on(e,t,t.value),rt("=")&&(M(),r=Pt(),++e.defaultCount),e.params.push(n),e.defaults.push(r),!rt(")")}function sn(e){var t;if(t={params:[],defaultCount:0,defaults:[],firstRestricted:e},et("("),!rt(")"))for(t.paramSet={};Hn>Bn&&an(t);)et(",");return et(")"),0===t.defaultCount&&(t.defaults=[]),{params:t.params,defaults:t.defaults,stricted:t.stricted,firstRestricted:t.firstRestricted,message:t.message}}function ln(){var e,t,n,r,i,o,a,s,l=[],c=[],f=new H;return nt("function"),n=Kn,e=It(),In?p(n.value)&&X(n,jn.StrictFunctionName):p(n.value)?(o=n,a=jn.StrictFunctionName):u(n.value)&&(o=n,a=jn.StrictReservedWord),i=sn(o),l=i.params,c=i.defaults,r=i.stricted,o=i.firstRestricted,i.message&&(a=i.message),s=In,t=rn(),In&&o&&Z(o,a),In&&r&&X(r,a),In=s,f.finishFunctionDeclaration(e,l,c,t)}function cn(){var e,t,n,r,i,o,a,s=null,l=[],c=[],f=new H;return nt("function"),rt("(")||(e=Kn,s=It(),In?p(e.value)&&X(e,jn.StrictFunctionName):p(e.value)?(n=e,r=jn.StrictFunctionName):u(e.value)&&(n=e,r=jn.StrictReservedWord)),i=sn(n),l=i.params,c=i.defaults,t=i.stricted,n=i.firstRestricted,i.message&&(r=i.message),a=In,o=rn(),In&&n&&Z(n,r),In&&t&&X(t,r),In=a,f.finishFunctionExpression(s,l,c,o)}function un(){if(Kn.type===kn.Keyword)switch(Kn.value){case"const":case"let":return Mt(Kn.value);case"function":return ln();default:return nn()}return Kn.type!==kn.EOF?nn():void 0}function pn(){for(var e,t,n,r,i=[];Hn>Bn&&(t=Kn,t.type===kn.StringLiteral)&&(e=un(),i.push(e),e.expression.type===Ln.Literal);)n=On.slice(t.start+1,t.end-1),"use strict"===n?(In=!0,r&&X(r,jn.StrictOctalLiteral)):!r&&t.octal&&(r=t);for(var o=Nn;Hn>Bn&&(e=un(),"undefined"!=typeof e&&null!==e)&&(i.push(e),o!==Nn);)o=Nn;return i}function fn(){var e,t;return V(),t=new H,In=!1,e=pn(),t.finishProgram(e)}function dn(){var e,t,n,r=[];for(e=0;e0?1:0,Dn=0,Bn=Nn,Gn=Rn,Wn=Dn,Hn=On.length,Kn=null,zn={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},Jn={},t=t||{},t.tokens=!0,Jn.tokens=[],Jn.tokenize=!0,Jn.openParenToken=-1,Jn.openCurlyToken=-1,Jn.range="boolean"==typeof t.range&&t.range,Jn.loc="boolean"==typeof t.loc&&t.loc,"boolean"==typeof t.comment&&t.comment&&(Jn.comments=[]),"boolean"==typeof t.tolerant&&t.tolerant&&(Jn.errors=[]);try{if(V(),Kn.type===kn.EOF)return Jn.tokens;for(M();Kn.type!==kn.EOF;)try{M()}catch(i){if(Jn.errors){Jn.errors.push(i);break}throw i}dn(),r=Jn.tokens,"undefined"!=typeof Jn.comments&&(r.comments=Jn.comments),"undefined"!=typeof Jn.errors&&(r.errors=Jn.errors)}catch(o){throw o}finally{Jn={}}return r}function mn(e,t){var n,r;r=String,"string"==typeof e||e instanceof String||(e=r(e)),On=e,Nn=0,Rn=On.length>0?1:0,Dn=0,Bn=Nn,Gn=Rn,Wn=Dn,Hn=On.length,Kn=null,zn={allowIn:!0,labelSet:{},parenthesisCount:0,inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},Jn={},"undefined"!=typeof t&&("boolean"==typeof t.deps&&t.deps&&(Jn.deps=[],Jn.envs=Object.create(null)),Jn.range="boolean"==typeof t.range&&t.range,Jn.loc="boolean"==typeof t.loc&&t.loc,Jn.attachComment="boolean"==typeof t.attachComment&&t.attachComment,Jn.loc&&null!==t.source&&void 0!==t.source&&(Jn.source=r(t.source)),"boolean"==typeof t.tokens&&t.tokens&&(Jn.tokens=[]),"boolean"==typeof t.comment&&t.comment&&(Jn.comments=[]),"boolean"==typeof t.tolerant&&t.tolerant&&(Jn.errors=[],Jn.parseStatement=nn,Jn.parseExpression=jt,nn=bn(nn),jt=yn(jt)),Jn.attachComment&&(Jn.range=!0,Jn.comments=[],Jn.bottomRightStack=[],Jn.trailingComments=[],Jn.leadingComments=[]),Jn.directSourceFile=t.directSourceFile);try{n=fn(),"undefined"!=typeof Jn.comments&&(n.comments=Jn.comments),"undefined"!=typeof Jn.tokens&&(dn(),n.tokens=Jn.tokens),"undefined"!=typeof Jn.errors&&(n.errors=Jn.errors),"undefined"!=typeof Jn.deps&&(n.dependencies=Jn.deps,n.environments=Jn.envs)}catch(i){throw i}finally{"undefined"!=typeof Jn.errors&&(nn=Jn.parseStatement,jt=Jn.parseExpression),Jn={}}return n}function gn(e,t){try{et(e)}catch(n){if(!Jn.errors)throw n;vn(n),t&&On[n.index]===t&&(Nn=n.index,V())}}function vn(e){for(var t=Jn.errors.length,n=0;t>n;n++){var r=Jn.errors[n];if(r.index===e.index&&r.message===e.message)return}Jn.errors.push(e)}function yn(e){return function(){try{return e.apply(null,arguments)}catch(t){vn(t)}}}function bn(e){return function(){Jn.statementStart=Nn;try{return e.apply(null,arguments)}catch(t){vn(t)}}}function xn(e){for(var t=e;t>-1&&";"!==On[t]&&"\n"!==On[t];)t--;if(!(t<=Jn.statementStart)){var n=!1;Jn.lastRewindLocation?n=!0:Jn.lastRewindLocation!==t&&(n=!0),n&&(Nn=t,Sn(e),V(),Jn.lastRewindLocation=Nn)}}function Sn(e,t){for(var n=Jn.tokens.length-1;n>-1;){var r=Jn.tokens[n];if(r.range[0]",Cn[kn.Identifier]="Identifier",Cn[kn.Keyword]="Keyword",Cn[kn.NullLiteral]="Null",Cn[kn.NumericLiteral]="Numeric",Cn[kn.Punctuator]="Punctuator",Cn[kn.StringLiteral]="String",Cn[kn.RegularExpression]="RegularExpression",Tn=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="],Ln={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",ArrowFunctionExpression:"ArrowFunctionExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},An={ArrowParameterPlaceHolder:{type:"ArrowParameterPlaceHolder"}},Pn={Data:1,Get:2,Set:4},jn={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",MissingToken:"Missing expected '%0'"},Fn={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢲऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԯԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠ-ࢲࣤ-ॣ०-९ॱ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఀ-ఃఅ-ఌఎ-ఐఒ-నప-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಁ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲഁ-ഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟ෦-෯ෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤞᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧ᪰-᪽ᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶ᳸᳹ᴀ-᷵᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚝꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꧠ-ꧾꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︭︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},K.prototype=H.prototype={processComment:function(){var e,t,n,r,i,o=Jn.bottomRightStack,a=o[o.length-1];
+if(!(this.type===Ln.Program&&this.body.length>0)){if(Jn.trailingComments.length>0){for(n=[],r=Jn.trailingComments.length-1;r>=0;--r)i=Jn.trailingComments[r],i.range[0]>=this.range[1]&&(n.unshift(i),Jn.trailingComments.splice(r,1));Jn.trailingComments=[]}else a&&a.trailingComments&&a.trailingComments[0].range[0]>=this.range[1]&&(n=a.trailingComments,delete a.trailingComments);if(a)for(;a&&a.range[0]>=this.range[0];)e=a,a=o.pop();if(e)e.leadingComments&&e.leadingComments[e.leadingComments.length-1].range[1]<=this.range[0]&&(this.leadingComments=e.leadingComments,e.leadingComments=void 0);else if(Jn.leadingComments.length>0)for(t=[],r=Jn.leadingComments.length-1;r>=0;--r)i=Jn.leadingComments[r],i.range[1]<=this.range[0]&&(t.unshift(i),Jn.leadingComments.splice(r,1));t&&t.length>0&&(this.leadingComments=t),n&&n.length>0&&(this.trailingComments=n),o.push(this)}},finish:function(){Jn.loc&&(this.loc.end={line:$n,column:Vn-Un},Jn.source&&(this.loc.source=Jn.source)),Jn.range&&(this.range[1]=Vn,this.start=this.range[0],this.end=Vn),Jn.attachComment&&this.processComment()},finishArrayExpression:function(e){return this.type=Ln.ArrayExpression,this.elements=e,this.finish(),this},finishArrowFunctionExpression:function(e,t,n,r){return this.type=Ln.ArrowFunctionExpression,this.id=null,this.params=e,this.defaults=t,this.body=n,this.rest=null,this.generator=!1,this.expression=r,this.finish(),this},finishAssignmentExpression:function(e,t,n){return this.type=Ln.AssignmentExpression,this.operator=e,this.left=t,this.right=n,this.finish(),this},finishBinaryExpression:function(e,t,n){return this.type="||"===e||"&&"===e?Ln.LogicalExpression:Ln.BinaryExpression,this.operator=e,this.left=t,this.right=n,this.finish(),this},finishBlockStatement:function(e){return this.type=Ln.BlockStatement,this.body=e,this.finish(),this},finishBreakStatement:function(e){return this.type=Ln.BreakStatement,this.label=e,this.finish(),this},finishCallExpression:function(e,t){return this.type=Ln.CallExpression,this.callee=e,this.arguments=t,B(e,t),this.finish(),this},finishCatchClause:function(e,t){return this.type=Ln.CatchClause,this.param=e,this.body=t,this.finish(),this},finishConditionalExpression:function(e,t,n){return this.type=Ln.ConditionalExpression,this.test=e,this.consequent=t,this.alternate=n,this.finish(),this},finishContinueStatement:function(e){return this.type=Ln.ContinueStatement,this.label=e,this.finish(),this},finishDebuggerStatement:function(){return this.type=Ln.DebuggerStatement,this.finish(),this},finishDoWhileStatement:function(e,t){return this.type=Ln.DoWhileStatement,this.body=e,this.test=t,this.finish(),this},finishEmptyStatement:function(){return this.type=Ln.EmptyStatement,this.finish(),this},finishExpressionStatement:function(e){return this.type=Ln.ExpressionStatement,this.expression=e,this.finish(),this},finishForStatement:function(e,t,n,r){return this.type=Ln.ForStatement,this.init=e,this.test=t,this.update=n,this.body=r,this.finish(),this},finishForInStatement:function(e,t,n){return this.type=Ln.ForInStatement,this.left=e,this.right=t,this.body=n?n:wn(this,"Statement"),this.each=!1,this.finish(),this},finishFunctionDeclaration:function(e,t,n,r){return this.type=Ln.FunctionDeclaration,this.id=e,this.params=t,this.defaults=n,this.body=r,this.rest=null,this.generator=!1,this.expression=!1,this.finish(),this},finishFunctionExpression:function(e,t,n,r){return this.type=Ln.FunctionExpression,this.id=e,this.params=t,this.defaults=n,this.body=r,this.rest=null,this.generator=!1,this.expression=!1,this.finish(),this},finishIdentifier:function(e){return this.type=Ln.Identifier,this.name=e,this.finish(),this},finishIfStatement:function(e,t,n){return this.type=Ln.IfStatement,this.test=e,this.consequent=t?t:wn(this,"Statement"),this.alternate=n,this.finish(),this},finishLabeledStatement:function(e,t){return this.type=Ln.LabeledStatement,this.label=e,this.body=t,this.finish(),this},finishLiteral:function(e){return this.type=Ln.Literal,this.value=e.value,this.raw=On.slice(e.start,e.end),e.regex&&(this.regex=e.regex),this.finish(),this},finishMemberExpression:function(e,t,n){return this.type=Ln.MemberExpression,this.computed="["===e,this.object=t,this.property=n,this.finish(),this},finishNewExpression:function(e,t){return this.type=Ln.NewExpression,this.callee=e,this.arguments=t,B(e,t),this.finish(),this},finishObjectExpression:function(e){return this.type=Ln.ObjectExpression,this.properties=e,this.finish(),this},finishPostfixExpression:function(e,t){return this.type=Ln.UpdateExpression,this.operator=e,this.argument=t,this.prefix=!1,this.finish(),this},finishProgram:function(e){return this.type=Ln.Program,this.body=e,this.finish(),this},finishProperty:function(e,t,n,r,i){return this.type=Ln.Property,this.key=t,this.value=n,this.kind=e,this.method=r,this.shorthand=i,this.finish(),this},finishReturnStatement:function(e){return this.type=Ln.ReturnStatement,this.argument=e,this.finish(),this},finishSequenceExpression:function(e){return this.type=Ln.SequenceExpression,this.expressions=e,this.finish(),this},finishSwitchCase:function(e,t){return this.type=Ln.SwitchCase,this.test=e,this.consequent=t,this.finish(),this},finishSwitchStatement:function(e,t){return this.type=Ln.SwitchStatement,this.discriminant=e,this.cases=t,this.finish(),this},finishThisExpression:function(){return this.type=Ln.ThisExpression,this.finish(),this},finishThrowStatement:function(e){return this.type=Ln.ThrowStatement,this.argument=e,this.finish(),this},finishTryStatement:function(e,t,n,r){return this.type=Ln.TryStatement,this.block=e,this.guardedHandlers=t,this.handlers=n,this.finalizer=r,this.finish(),this},finishUnaryExpression:function(e,t){return this.type="++"===e||"--"===e?Ln.UpdateExpression:Ln.UnaryExpression,this.operator=e,this.argument=t,this.prefix=!0,this.finish(),this},finishVariableDeclaration:function(e,t){return this.type=Ln.VariableDeclaration,this.declarations=e,this.kind=t,this.finish(),this},finishVariableDeclarator:function(e,t){return this.type=Ln.VariableDeclarator,this.id=e,this.init=t,this.finish(),this},finishWhileStatement:function(e,t){return this.type=Ln.WhileStatement,this.test=e,this.body=t?t:wn(this,"Statement"),this.finish(),this},finishWithStatement:function(e,t){return this.type=Ln.WithStatement,this.object=e,this.body=t?t:wn(this,"Statement"),this.finish(),this}},e.version="2.0.0",e.tokenize=hn,e.parse=mn,e.isIdentifierPart=l,e.isIdentifierStart=s,e.isIdentifierChar=l,e.Syntax=function(){var e,t={};"function"==typeof Object.create&&(t=Object.create(null));for(e in Ln)Ln.hasOwnProperty(e)&&(t[e]=Ln[e]);return"function"==typeof Object.freeze&&Object.freeze(t),t}()}),function(e,t){"use strict";"function"==typeof n&&n.amd?n("estraverse/estraverse",["exports"],t):t("undefined"!=typeof exports?exports:e.estraverse={})}(this,function(e){"use strict";function t(){}function n(e){var t,r,i={};for(t in e)e.hasOwnProperty(t)&&(r=e[t],i[t]="object"==typeof r&&null!==r?n(r):r);return i}function r(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function i(e,t){var n,r,i,o;for(r=e.length,i=0;r;)n=r>>>1,o=i+n,t(e[o])?r=n:(i=o+1,r-=n+1);return i}function o(e,t){var n,r,i,o;for(r=e.length,i=0;r;)n=r>>>1,o=i+n,t(e[o])?(i=o+1,r-=n+1):r=n;return i}function a(e,t){return S(t).forEach(function(n){e[n]=t[n]}),e}function s(e,t){this.parent=e,this.key=t}function l(e,t,n,r){this.node=e,this.path=t,this.wrap=n,this.ref=r}function c(){}function u(e){return null==e?!1:"object"==typeof e&&"string"==typeof e.type}function p(e,t){return(e===g.ObjectExpression||e===g.ObjectPattern)&&"properties"===t}function f(e,t){var n=new c;return n.traverse(e,t)}function d(e,t){var n=new c;return n.replace(e,t)}function h(e,t){var n;return n=i(t,function(t){return t.range[0]>e.range[0]}),e.extendedRange=[e.range[0],e.range[1]],n!==t.length&&(e.extendedRange[1]=t[n].range[0]),n-=1,n>=0&&(e.extendedRange[0]=t[n].range[1]),e}function m(e,t,r){var i,o,a,s,l=[];if(!e.range)throw new Error("attachComments needs range information");if(!r.length){if(t.length){for(a=0,o=t.length;o>a;a+=1)i=n(t[a]),i.extendedRange=[0,e.range[0]],l.push(i);e.leadingComments=l}return e}for(a=0,o=t.length;o>a;a+=1)l.push(h(n(t[a]),r));return s=0,f(e,{enter:function(e){for(var t;se.range[0]));)t.extendedRange[1]===e.range[0]?(e.leadingComments||(e.leadingComments=[]),e.leadingComments.push(t),l.splice(s,1)):s+=1;return s===l.length?y.Break:l[s].extendedRange[0]>e.range[1]?y.Skip:void 0}}),s=0,f(e,{leave:function(e){for(var t;se.range[1]?y.Skip:void 0}}),e}var g,v,y,b,x,S,E,w,_;v=Array.isArray,v||(v=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t(r),t(o),x=Object.create||function(){function e(){}return function(t){return e.prototype=t,new e}}(),S=Object.keys||function(e){var t,n=[];for(t in e)n.push(t);return n},g={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportBatchSpecifier:"ExportBatchSpecifier",ExportDeclaration:"ExportDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},b={AssignmentExpression:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","defaults","rest","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","body","superClass"],ClassExpression:["id","body","superClass"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportBatchSpecifier:[],ExportDeclaration:["declaration","specifiers","source"],ExportSpecifier:["id","name"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","defaults","rest","body"],FunctionExpression:["id","params","defaults","rest","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["id"],ImportNamespaceSpecifier:["id"],ImportSpecifier:["id","name"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],Program:["body"],Property:["key","value"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handlers","handler","guardedHandlers","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},E={},w={},_={},y={Break:E,Skip:w,Remove:_},s.prototype.replace=function(e){this.parent[this.key]=e},s.prototype.remove=function(){return v(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},c.prototype.path=function(){function e(e,t){if(v(t))for(r=0,i=t.length;i>r;++r)e.push(t[r]);else e.push(t)}var t,n,r,i,o,a;if(!this.__current.path)return null;for(o=[],t=2,n=this.__leavelist.length;n>t;++t)a=this.__leavelist[t],e(o,a.path);return e(o,this.__current.path),o},c.prototype.type=function(){var e=this.current();return e.type||this.__current.wrap},c.prototype.parents=function(){var e,t,n;for(n=[],e=1,t=this.__leavelist.length;t>e;++e)n.push(this.__leavelist[e].node);return n},c.prototype.current=function(){return this.__current.node},c.prototype.__execute=function(e,t){var n,r;return r=void 0,n=this.__current,this.__current=t,this.__state=null,e&&(r=e.call(this,t.node,this.__leavelist[this.__leavelist.length-1].node)),this.__current=n,r},c.prototype.notify=function(e){this.__state=e},c.prototype.skip=function(){this.notify(w)},c.prototype["break"]=function(){this.notify(E)},c.prototype.remove=function(){this.notify(_)},c.prototype.__initialize=function(e,t){this.visitor=t,this.root=e,this.__worklist=[],this.__leavelist=[],this.__current=null,this.__state=null,this.__fallback="iteration"===t.fallback,this.__keys=b,t.keys&&(this.__keys=a(x(this.__keys),t.keys))},c.prototype.traverse=function(e,t){var n,r,i,o,a,s,c,f,d,h,m,g;for(this.__initialize(e,t),g={},n=this.__worklist,r=this.__leavelist,n.push(new l(e,null,null,null)),r.push(new l(null,null,null,null));n.length;)if(i=n.pop(),i!==g){if(i.node){if(s=this.__execute(t.enter,i),this.__state===E||s===E)return;if(n.push(g),r.push(i),this.__state===w||s===w)continue;if(o=i.node,a=i.wrap||o.type,h=this.__keys[a],!h){if(!this.__fallback)throw new Error("Unknown node type "+a+".");h=S(o)}for(f=h.length;(f-=1)>=0;)if(c=h[f],m=o[c])if(v(m)){for(d=m.length;(d-=1)>=0;)if(m[d]){if(p(a,h[f]))i=new l(m[d],[c,d],"Property",null);else{if(!u(m[d]))continue;i=new l(m[d],[c,d],null,null)}n.push(i)}}else u(m)&&n.push(new l(m,c,null,null))}}else if(i=r.pop(),s=this.__execute(t.leave,i),this.__state===E||s===E)return},c.prototype.replace=function(e,t){function n(e){var t,n,i,o;if(e.ref.remove())for(n=e.ref.key,o=e.ref.parent,t=r.length;t--;)if(i=r[t],i.ref&&i.ref.parent===o){if(i.ref.key=0;)if(x=m[d],g=o[x])if(v(g)){for(h=g.length;(h-=1)>=0;)if(g[h]){if(p(a,m[d]))f=new l(g[h],[x,h],"Property",new s(g,h));else{if(!u(g[h]))continue;f=new l(g[h],[x,h],null,new s(g,h))}r.push(f)}}else u(g)&&r.push(new l(g,x,null,new s(o,x)))}}else if(f=i.pop(),c=this.__execute(t.leave,f),void 0!==c&&c!==E&&c!==w&&c!==_&&f.ref.replace(c),(this.__state===_||c===_)&&n(f),this.__state===E||c===E)return b.root;return b.root},e.version="1.8.1-dev",e.Syntax=g,e.traverse=f,e.replace=d,e.attachComments=m,e.VisitorKeys=b,e.VisitorOption=y,e.Controller=c}),n("orion/objects",[],function(){function e(e){for(var t=Object.prototype.hasOwnProperty,n=1,r=arguments.length;r>n;n++){var i=arguments[n];for(var o in i)t.call(i,o)&&(e[o]=i[o])}return e}return{clone:function(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var n=Object.create(Object.getPrototypeOf(t));return e(n,t),n},mixin:e,toArray:function(e){return Array.isArray(e)?e:[e]}}}),n("javascript/lru",[],function(){function e(e,t){var n=Object.create(null);return n._p=null,n._n=null,n._v={key:e,value:t},n}function t(e){this._max="undefined"==typeof e?-1:e,this._start=this._end=null,this._size=0,this._cache=Object.create(null)}return t.prototype.clear=function(){this._cache=Object.create(null),this._start=null,this._end=null,this._size=0},t.prototype.size=function(){return this._size},t.prototype.containsKey=function(e){return"undefined"!=typeof this._cache[e]},t.prototype.put=function(t,n){-1!==this._max&&this._size+1>this._max&&this.remove(this._end._v.key),this.remove(t);var r=e(t,n);this._start?(r=e(t,n),r._n=this._start,this._start._p=r,this._start=r):this._start=this._end=r,this._cache[t]=r,this._size++},t.prototype.get=function(e){if(this._size>0){var t=this._cache[e];if(t&&t._v)return t._v.value}return null},t.prototype.remove=function(e){if(0===this._size)return null;var t=this._cache[e];if(t){var n=t._p;this._end===t&&(this._end=n);var r=t._n;return this._start===t&&(this._start=t._n),n&&(n._n=r),r&&(r._p=n),delete this._cache[e],this._size--,t._v.value}return null},t.prototype.keys=function n(){var n=[];if(this._end)for(var e=this._end;e;)n.push(e._v.key),e=e._p;return n},t}),n("javascript/scriptResolver",["orion/objects","orion/Deferred","javascript/lru"],function(e,t,n){function r(e){this.fileclient=e,this.cache=new n(10)}return e.mixin(r.prototype,{getWorkspaceFile:function(e,n){return e?this._getFile(e,n):(new t).resolve(null)},setSearchLocation:function(e){this.searchLocation=e},getSearchLocation:function(){return this.searchLocation||this.fileclient.fileServiceRootURL()},_getFile:function(e,n){var r=this.cache.get(e);if(r)return(new t).resolve(r);var i=this,o=n?n:Object.create(null),a=o.ext?o.ext:"js",s=o.icon?o.icon:"../javascript/images/javascript.png",l=o.type?o.type:"JavaScript",c="."+a,u=this._removePrefix(e),p=u.length>1?u[1]:u[0],f=p.lastIndexOf("/"),d=p.slice(f+1);return this.fileclient.search({resource:i.searchLocation||this.fileclient.fileServiceRootURL(),keyword:d,sort:"Name asc",nameSearch:!0,fileType:a,start:0,rows:30}).then(function(e){var t=e.response,n=t.docs.length;if(t.numFound>0){r=[];var o=p.replace(/(?:\.?\.\/)*/,"");o=o.replace(new RegExp("\\"+c+"$"),""),o=o.replace(/\//g,"\\/");for(var a=0;n>a;a++){var u=t.docs[a],f=".*(?:"+o+")$";new RegExp(f).test(u.Location.slice(0,u.Location.length-c.length))&&r.push(i._newFileObj(u.Name,u.Location,i._trimName(u.Path),s,l))}if(r.length>0)return i.cache.put(p,r),r}return null})},_removePrefix:function(e){var t=e.indexOf("!");return t>-1?e.split("!"):[e]},resolveRelativeFiles:function(e,t,n){if(t&&t.length>0&&n){var r=n.location,i=[],o=this._removePrefix(e),a=o.length>1?o[1]:o[0];r=r.slice(0,r.lastIndexOf("/"));var s=!1;if("."!==a.charAt(0))r=this._appendPath(r,a);else{s=!0;var l=/^\.\.\//.exec(a);if(l){for(;null!=l;)r=r.slice(0,r.lastIndexOf("/")),a=a.slice(3),l=/^\.\.\//.exec(a);r=this._appendPath(r,a)}else{for(;/^\.\//.test(a);)a=a.slice(2);r=this._appendPath(r,a)}}for(var c=0;c-1&&(d=p.slice(0,f));var h=a.replace(/[/?|{}()*.#$^]/g,"\\$&"),m=new RegExp(h+"$");m.test(d)&&i.push(u)}}return i}return[]},_samePaths:function(e,t,n){if(null==e)return null==t;if("undefined"==typeof e)return"undefined"==typeof t;if(null==t)return null==e;if("undefined"==typeof t)return"undefined"==typeof e;if(e.contentType&&n.contentType&&e.contentType.name===n.contentType.name){var r=e.location?e.location:e.Location;if(!r)return!1;var i=r.lastIndexOf("."),o=r;if(i>-1&&(o=r.slice(0,i)),t===o)return!0;i=t.lastIndexOf(".");var a=t;return i>-1&&(a=t.slice(0,i)),o===a?!0:o===decodeURIComponent(a)?!0:!1}},_appendPath:function(e,t){if("string"==typeof e&&"string"==typeof t){var n=e;return"/"!==n.charAt(n.length-1)&&(n+="/"),n+="/"===t.charAt(0)?t.slice(1):t}return null},_trimName:function(e){return e.replace(/^(?:org\.eclipse\.orion\.client)?(?:\/)?bundles\//,"")},_newFileObj:function(e,t,n,r,i,o){var a=Object.create(null);return a.name=e,a.location=t?t:o.getServiceRootURL()+"/"+n,a.path=n,a.contentType=Object.create(null),r&&(a.contentType.icon=r),i&&(a.contentType.name=i),a}}),{ScriptResolver:r}}),n("orion/serialize",[],function(){function e(e){var t=e?JSON.parse(JSON.stringify(e)):e;return e instanceof Error&&(t.__isError=!0,t.lineNumber="number"==typeof t.lineNumber?t.lineNumber:e.lineNumber,t.message=t.message||e.message,t.name=t.name||e.name,t.stack=t.stack||e.stack),t}return{serializeError:e}}),n("javascript/astManager",["orion/Deferred","orion/objects","orion/serialize","javascript/lru","orion/metrics"],function(e,t,n,r,i){function o(e){if(this.parser=e,this.cache=new r(10),!this.parser)throw new Error("Missing parser")}var a={Unexpected:1,EndOfInput:2},s=Object.create(null);return s.type="Program",s.body=[],s.comments=[],s.tokens=[],s.range=[0,0],t.mixin(o.prototype,{getAST:function(t){var n=this;return t.getFileMetadata().then(function(r){var i=n._getKey(r),o=n.cache.get(i);return o?(new e).resolve(o):t.getText().then(function(e){return o=n.parse(e,r?r.location:"unknown"),n.cache.put(i,o),o})})},_getKey:function(e){return e&&e.location?e.location:"unknown"},parse:function(e,t){var r=Date.now();try{var o=this.parser.parse(e,{range:!0,loc:!0,tolerant:!0,tokens:!0,attachComment:!0,directSourceFile:t,deps:!0})}catch(a){o=s,o.range[1]=e&&"number"==typeof e.length?e.length:0,o.errors=[a]}var l=Date.now()-r;return i.logTiming("language tools","parse",l,"application/javascript"),o.errors&&(this._computeErrorTypes(o.errors),o.errors=o.errors.map(n.serializeError)),o.fileLocation=t,o.source=e,o},_computeErrorTypes:function(e){e&&Array.isArray(e)&&e.forEach(function(e){var t=e.message;e.message=t=t.replace(/^Line \d+: /,""),/^Unexpected/.test(t)&&(e.type=a.Unexpected,/end of input$/.test(t)&&(e.type=a.EndOfInput))})},onModelChanging:function(e){this.inputChanged?this.inputChanged=null:this.cache.remove(this._getKey(e.file))},onInputChanged:function(e){this.inputChanged=e}}),{ASTManager:o,ErrorTypes:a}}),n("orion/editor/eventTarget",[],function(){function e(){}return e.addMixin=function(t){var n=e.prototype;for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])},e.prototype={addEventListener:function(e,t,n){this._eventTypes||(this._eventTypes={});var r=this._eventTypes[e];r||(r=this._eventTypes[e]={level:0,listeners:[]});var i=r.listeners;i.push({listener:t,useCapture:n})},dispatchEvent:function(e){var t=e.type;this._dispatchEvent("pre"+t,e),this._dispatchEvent(t,e),this._dispatchEvent("post"+t,e)},_dispatchEvent:function(e,t){var n=this._eventTypes?this._eventTypes[e]:null;if(n){var r=n.listeners;try{if(n.level++,r)for(var i=0,o=r.length;o>i;i++)if(r[i]){var a=r[i].listener;"function"==typeof a?a.call(this,t):a.handleEvent&&"function"==typeof a.handleEvent&&a.handleEvent(t)}}finally{if(n.level--,n.compact&&0===n.level){for(var s=r.length-1;s>=0;s--)r[s]||r.splice(s,1);0===r.length&&delete this._eventTypes[e],n.compact=!1}}}},isListening:function(e){return this._eventTypes?void 0!==this._eventTypes[e]:!1},removeEventListener:function(e,t,n){if(this._eventTypes){var r=this._eventTypes[e];if(r){for(var i=r.listeners,o=0,a=i.length;a>o;o++){var s=i[o];if(s&&s.listener===t&&s.useCapture===n){0!==r.level?(i[o]=null,r.compact=!0):i.splice(o,1);break}}0===i.length&&delete this._eventTypes[e]}}}},{EventTarget:e}}),n("orion/regex",[],function(){function e(e){return e.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")}function t(e){var t=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(e);return t?{pattern:t[1],flags:t[2]}:null}return{escape:e,parse:t}}),n("orion/util",[],function(){function e(e){var t=arguments;return e.replace(/\$\{([^\}]+)\}/g,function(e,n){return t[(n<<0)+1]})}function t(e,t){return e.createElementNS?e.createElementNS(y,t):e.createElement(t)}var n=navigator.userAgent,r=-1!==n.indexOf("MSIE")||-1!==n.indexOf("Trident")?document.documentMode:void 0,i=parseFloat(n.split("Firefox/")[1]||n.split("Minefield/")[1])||void 0,o=-1!==n.indexOf("Opera")?parseFloat(n.split("Version/")[1]):void 0,a=parseFloat(n.split("Chrome/")[1])||void 0,s=-1!==n.indexOf("Safari")&&!a,l=parseFloat(n.split("WebKit/")[1])||void 0,c=-1!==n.indexOf("Android"),u=-1!==n.indexOf("iPad"),p=-1!==n.indexOf("iPhone"),f=u||p,d=-1!==navigator.platform.indexOf("Mac"),h=-1!==navigator.platform.indexOf("Win"),m=-1!==navigator.platform.indexOf("Linux"),g="undefined"!=typeof document&&"ontouchstart"in document.createElement("input"),v=h?"\r\n":"\n",y="http://www.w3.org/1999/xhtml";return{formatMessage:e,createElement:t,isIE:r,isFirefox:i,isOpera:o,isChrome:a,isSafari:s,isWebkit:l,isAndroid:c,isIPad:u,isIPhone:p,isIOS:f,isMac:d,isWindows:h,isLinux:m,isTouch:g,platformDelimiter:v}}),n("orion/editor/textModel",["orion/editor/eventTarget","orion/regex","orion/util"],function(e,t,n){function r(e,t){this._lastLineIndex=-1,this._text=[""],this._lineOffsets=[0],this.setText(e),this.setLineDelimiter(t)}return r.prototype={destroy:function(){},find:function(e){this._text.length>1&&(this._text=[this._text.join("")]);var n=e.string,r=e.regex,i=n,o="",a=e.caseInsensitive;if(i)if(r){var s=t.parse(i);s&&(i=s.pattern,o=s.flags)}else i=n.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&"),a&&(i=i.replace(/[iI\u0130\u0131]/g,"[Iiİı]"));var l,c=null;if(i){var u=e.reverse,p=e.wrap,f=e.wholeWord,d=e.start||0,h=e.end,m=null!==h&&void 0!==h;-1===o.indexOf("g")&&(o+="g"),-1===o.indexOf("m")&&(o+="m"),a&&-1===o.indexOf("i")&&(o+="i"),f&&(i="\\b"+i+"\\b");var g,v,y=this._text[0],b=0;if(m){var x=h>d?d:h,S=h>d?h:d;y=y.substring(x,S),b=x}var E=new RegExp(i,o);u?l=function(){var e=null;for(E.lastIndex=0;;){if(v=E.lastIndex,g=E.exec(y),v===E.lastIndex)return null;if(!g)break;if(g.index+b=0&&n>e))return null;var r=this._lineOffsets[e];if(n>e+1){var i=this.getText(r,this._lineOffsets[e+1]);if(t)return i;for(var o,a=i.length;10===(o=i.charCodeAt(a-1))||13===o;)a--;return i.substring(0,a)}return this.getText(r)},getLineAtOffset:function(e){var t=this.getCharCount();if(!(e>=0&&t>=e))return-1;var n=this.getLineCount();if(e===t)return n-1;var r,i,o=this._lastLineIndex;if(o>=0&&n>o&&(r=this._lineOffsets[o],i=n>o+1?this._lineOffsets[o+1]:t,e>=r&&i>e))return o;for(var a=n,s=-1;a-s>1;)if(o=Math.floor((a+s)/2),r=this._lineOffsets[o],i=n>o+1?this._lineOffsets[o+1]:t,r>=e)a=o;else{if(i>e){a=o;break}s=o}return this._lastLineIndex=a,a},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(e,t){var n=this.getLineCount();if(!(e>=0&&n>e))return-1;if(n>e+1){var r=this._lineOffsets[e+1];if(t)return r;for(var i,o=this.getText(Math.max(this._lineOffsets[e],r-2),r),a=o.length;10===(i=o.charCodeAt(a-1))||13===i;)a--;return r-(o.length-a)}return this.getCharCount()},getLineStart:function(e){return e>=0&&e=e));)r+=n,i++;for(var o=r,a=i;i=t));)r+=n,i++;var s=r,l=i;if(a===l)return this._text[a].substring(e-o,t-s);var c=this._text[a].substring(e-o),u=this._text[l].substring(0,t-s);return c+this._text.slice(a+1,l).join("")+u},onChanging:function(e){return this.dispatchEvent(e)},onChanged:function(e){return this.dispatchEvent(e)},setLineDelimiter:function(e,t){if("auto"===e&&(e=void 0,this.getLineCount()>1&&(e=this.getText(this.getLineEnd(0),this.getLineEnd(0,!0)))),this._lineDelimiter=e?e:n.platformDelimiter,t){var r=this.getLineCount();if(r>1){for(var i=new Array(r),o=0;r>o;o++)i[o]=this.getLine(o);this.setText(i.join(this._lineDelimiter))}}},setText:function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=0),void 0===n&&(n=this.getCharCount()),t!==n||""!==e){for(var r=this.getLineAtOffset(t),i=this.getLineAtOffset(n),o=t,a=n-t,s=i-r,l=e.length,c=0,u=this.getLineCount(),p=0,f=0,d=0,h=[];;){if(-1!==p&&d>=p&&(p=e.indexOf("\r",d)),-1!==f&&d>=f&&(f=e.indexOf("\n",d)),-1===f&&-1===p)break;d=-1!==p&&-1!==f?p+1===f?f+1:(f>p?p:f)+1:-1!==p?p+1:f+1,h.push(t+d),c++}var m={type:"Changing",text:e,start:o,removedCharCount:a,addedCharCount:l,removedLineCount:s,addedLineCount:c};if(this.onChanging(m),0===h.length){var g,v=this.getLineStart(r);g=u>i+1?this.getLineStart(i+1):this.getCharCount(),t!==v&&(e=this.getText(v,t)+e,t=v),n!==g&&(e+=this.getText(n,g),n=g)}for(var y=l-a,b=r+s+1;u>b;b++)this._lineOffsets[b]+=y;var x,S=5e4,E=S;if(h.length=t));)k+=_,C++;for(var T=k,L=C;C=n));)k+=_,C++;var A=k,P=C,j=this._text[L],F=this._text[P],O=j.substring(0,t-T),I=F.substring(n-A),N=[L,P-L+1];O&&N.push(O),e&&N.push(e),I&&N.push(I),Array.prototype.splice.apply(this._text,N),0===this._text.length&&(this._text=[""]);var R={type:"Changed",start:o,removedCharCount:a,addedCharCount:l,removedLineCount:s,addedLineCount:c};this.onChanged(R)}}},e.EventTarget.addMixin(r.prototype),{TextModel:r}}),n("eslint/conf/globals",[],function(){return{builtin:{Array:!1,ArrayBuffer:!1,Boolean:!1,constructor:!1,Date:!1,DataView:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,eval:!1,EvalError:!1,Float32Array:!1,Float64Array:!1,Function:!1,hasOwnProperty:!1,Infinity:!1,Int16Array:!1,Int32Array:!1,Int8Array:!1,isFinite:!1,isNaN:!1,isPrototypeOf:!1,JSON:!1,Map:!1,Math:!1,NaN:!1,Number:!1,Object:!1,parseFloat:!1,parseInt:!1,Promise:!1,propertyIsEnumerable:!1,Proxy:!1,RangeError:!1,ReferenceError:!1,Reflect:!1,RegExp:!1,Set:!1,String:!1,Symbol:!1,SyntaxError:!1,System:!1,toLocaleString:!1,toString:!1,TypeError:!1,Uint16Array:!1,Uint32Array:!1,Uint8Array:!1,Uint8ClampedArray:!1,undefined:!1,URIError:!1,valueOf:!1,WeakMap:!1,WeakSet:!1},nonstandard:{escape:!1,unescape:!1},browser:{addEventListener:!1,alert:!1,applicationCache:!1,atob:!1,Audio:!1,AudioProcessingEvent:!1,BeforeUnloadEvent:!1,Blob:!1,blur:!1,btoa:!1,cancelAnimationFrame:!1,CanvasGradient:!1,CanvasPattern:!1,CanvasRenderingContext2D:!1,clearInterval:!1,clearTimeout:!1,close:!1,closed:!1,CloseEvent:!1,Comment:!1,CompositionEvent:!1,confirm:!1,console:!1,crypto:!1,CSS:!1,CustomEvent:!1,DataView:!1,Debug:!1,defaultStatus:!1,devicePixelRatio:!1,dispatchEvent:!1,document:!1,Document:!1,DocumentFragment:!1,DOMParser:!1,DragEvent:!1,Element:!1,ElementTimeControl:!1,ErrorEvent:!1,event:!1,Event:!1,FileReader:!1,find:!1,focus:!1,FocusEvent:!1,FormData:!1,frameElement:!1,frames:!1,GamepadEvent:!1,getComputedStyle:!1,getSelection:!1,HashChangeEvent:!1,history:!1,HTMLAnchorElement:!1,HTMLBaseElement:!1,HTMLBlockquoteElement:!1,HTMLBodyElement:!1,HTMLBRElement:!1,HTMLButtonElement:!1,HTMLCanvasElement:!1,HTMLDirectoryElement:!1,HTMLDivElement:!1,HTMLDListElement:!1,HTMLElement:!1,HTMLFieldSetElement:!1,HTMLFontElement:!1,HTMLFormElement:!1,HTMLFrameElement:!1,HTMLFrameSetElement:!1,HTMLHeadElement:!1,HTMLHeadingElement:!1,HTMLHRElement:!1,HTMLHtmlElement:!1,HTMLIFrameElement:!1,HTMLImageElement:!1,HTMLInputElement:!1,HTMLIsIndexElement:!1,HTMLLabelElement:!1,HTMLLayerElement:!1,HTMLLegendElement:!1,HTMLLIElement:!1,HTMLLinkElement:!1,HTMLMapElement:!1,HTMLMenuElement:!1,HTMLMetaElement:!1,HTMLModElement:!1,HTMLObjectElement:!1,HTMLOListElement:!1,HTMLOptGroupElement:!1,HTMLOptionElement:!1,HTMLParagraphElement:!1,HTMLParamElement:!1,HTMLPreElement:!1,HTMLQuoteElement:!1,HTMLScriptElement:!1,HTMLSelectElement:!1,HTMLStyleElement:!1,HTMLTableCaptionElement:!1,HTMLTableCellElement:!1,HTMLTableColElement:!1,HTMLTableElement:!1,HTMLTableRowElement:!1,HTMLTableSectionElement:!1,HTMLTextAreaElement:!1,HTMLTitleElement:!1,HTMLUListElement:!1,HTMLVideoElement:!1,IDBCursor:!1,IDBCursorWithValue:!1,IDBDatabase:!1,IDBEnvironment:!1,IDBFactory:!1,IDBIndex:!1,IDBKeyRange:!1,IDBObjectStore:!1,IDBOpenDBRequest:!1,IDBRequest:!1,IDBTransaction:!1,IDBVersionChangeEvent:!1,Image:!1,indexedDB:!1,innerHeight:!1,innerWidth:!1,InputEvent:!1,Intl:!1,KeyboardEvent:!1,length:!1,localStorage:!1,location:!1,matchMedia:!1,MessageChannel:!1,MessageEvent:!1,MessagePort:!1,MouseEvent:!1,moveBy:!1,moveTo:!1,MutationObserver:!1,name:!1,navigator:!1,Node:!1,NodeFilter:!1,NodeList:!1,Notification:!1,OfflineAudioCompletionEvent:!1,onbeforeunload:!0,onblur:!0,onerror:!0,onfocus:!0,onload:!0,onresize:!0,onunload:!0,open:!1,openDatabase:!1,opener:!1,opera:!1,Option:!1,outerHeight:!1,outerWidth:!1,PageTransitionEvent:!1,pageXOffset:!1,pageYOffset:!1,parent:!1,PopStateEvent:!1,postMessage:!1,print:!1,ProgressEvent:!1,prompt:!1,Range:!1,removeEventListener:!1,requestAnimationFrame:!1,resizeBy:!1,resizeTo:!1,screen:!1,screenX:!1,screenY:!1,scroll:!1,scrollbars:!1,scrollBy:!1,scrollTo:!1,scrollX:!1,scrollY:!1,self:!1,sessionStorage:!1,setInterval:!1,setTimeout:!1,SharedWorker:!1,showModalDialog:!1,status:!1,stop:!1,StorageEvent:!1,SVGAElement:!1,SVGAltGlyphDefElement:!1,SVGAltGlyphElement:!1,SVGAltGlyphItemElement:!1,SVGAngle:!1,SVGAnimateColorElement:!1,SVGAnimatedAngle:!1,SVGAnimatedBoolean:!1,SVGAnimatedEnumeration:!1,SVGAnimatedInteger:!1,SVGAnimatedLength:!1,SVGAnimatedLengthList:!1,SVGAnimatedNumber:!1,SVGAnimatedNumberList:!1,SVGAnimatedPathData:!1,SVGAnimatedPoints:!1,SVGAnimatedPreserveAspectRatio:!1,SVGAnimatedRect:!1,SVGAnimatedString:!1,SVGAnimatedTransformList:!1,SVGAnimateElement:!1,SVGAnimateMotionElement:!1,SVGAnimateTransformElement:!1,SVGAnimationElement:!1,SVGCircleElement:!1,SVGClipPathElement:!1,SVGColor:!1,SVGColorProfileElement:!1,SVGColorProfileRule:!1,SVGComponentTransferFunctionElement:!1,SVGCSSRule:!1,SVGCursorElement:!1,SVGDefsElement:!1,SVGDescElement:!1,SVGDocument:!1,SVGElement:!1,SVGElementInstance:!1,SVGElementInstanceList:!1,SVGEllipseElement:!1,SVGEvent:!1,SVGExternalResourcesRequired:!1,SVGFEBlendElement:!1,SVGFEColorMatrixElement:!1,SVGFEComponentTransferElement:!1,SVGFECompositeElement:!1,SVGFEConvolveMatrixElement:!1,SVGFEDiffuseLightingElement:!1,SVGFEDisplacementMapElement:!1,SVGFEDistantLightElement:!1,SVGFEFloodElement:!1,SVGFEFuncAElement:!1,SVGFEFuncBElement:!1,SVGFEFuncGElement:!1,SVGFEFuncRElement:!1,SVGFEGaussianBlurElement:!1,SVGFEImageElement:!1,SVGFEMergeElement:!1,SVGFEMergeNodeElement:!1,SVGFEMorphologyElement:!1,SVGFEOffsetElement:!1,SVGFEPointLightElement:!1,SVGFESpecularLightingElement:!1,SVGFESpotLightElement:!1,SVGFETileElement:!1,SVGFETurbulenceElement:!1,SVGFilterElement:!1,SVGFilterPrimitiveStandardAttributes:!1,SVGFitToViewBox:!1,SVGFontElement:!1,SVGFontFaceElement:!1,SVGFontFaceFormatElement:!1,SVGFontFaceNameElement:!1,SVGFontFaceSrcElement:!1,SVGFontFaceUriElement:!1,SVGForeignObjectElement:!1,SVGGElement:!1,SVGGlyphElement:!1,SVGGlyphRefElement:!1,SVGGradientElement:!1,SVGHKernElement:!1,SVGICCColor:!1,SVGImageElement:!1,SVGLangSpace:!1,SVGLength:!1,SVGLengthList:!1,SVGLinearGradientElement:!1,SVGLineElement:!1,SVGLocatable:!1,SVGMarkerElement:!1,SVGMaskElement:!1,SVGMatrix:!1,SVGMetadataElement:!1,SVGMissingGlyphElement:!1,SVGMPathElement:!1,SVGNumber:!1,SVGNumberList:!1,SVGPaint:!1,SVGPathElement:!1,SVGPathSeg:!1,SVGPathSegArcAbs:!1,SVGPathSegArcRel:!1,SVGPathSegClosePath:!1,SVGPathSegCurvetoCubicAbs:!1,SVGPathSegCurvetoCubicRel:!1,SVGPathSegCurvetoCubicSmoothAbs:!1,SVGPathSegCurvetoCubicSmoothRel:!1,SVGPathSegCurvetoQuadraticAbs:!1,SVGPathSegCurvetoQuadraticRel:!1,SVGPathSegCurvetoQuadraticSmoothAbs:!1,SVGPathSegCurvetoQuadraticSmoothRel:!1,SVGPathSegLinetoAbs:!1,SVGPathSegLinetoHorizontalAbs:!1,SVGPathSegLinetoHorizontalRel:!1,SVGPathSegLinetoRel:!1,SVGPathSegLinetoVerticalAbs:!1,SVGPathSegLinetoVerticalRel:!1,SVGPathSegList:!1,SVGPathSegMovetoAbs:!1,SVGPathSegMovetoRel:!1,SVGPatternElement:!1,SVGPoint:!1,SVGPointList:!1,SVGPolygonElement:!1,SVGPolylineElement:!1,SVGPreserveAspectRatio:!1,SVGRadialGradientElement:!1,SVGRect:!1,SVGRectElement:!1,SVGRenderingIntent:!1,SVGScriptElement:!1,SVGSetElement:!1,SVGStopElement:!1,SVGStringList:!1,SVGStylable:!1,SVGStyleElement:!1,SVGSVGElement:!1,SVGSwitchElement:!1,SVGSymbolElement:!1,SVGTests:!1,SVGTextContentElement:!1,SVGTextElement:!1,SVGTextPathElement:!1,SVGTextPositioningElement:!1,SVGTitleElement:!1,SVGTransform:!1,SVGTransformable:!1,SVGTransformList:!1,SVGTRefElement:!1,SVGTSpanElement:!1,SVGUnitTypes:!1,SVGURIReference:!1,SVGUseElement:!1,SVGViewElement:!1,SVGViewSpec:!1,SVGVKernElement:!1,SVGZoomAndPan:!1,Text:!1,TextDecoder:!1,TextEncoder:!1,TimeEvent:!1,top:!1,TouchEvent:!1,UIEvent:!1,URL:!1,WebGLActiveInfo:!1,WebGLBuffer:!1,WebGLContextEvent:!1,WebGLFramebuffer:!1,WebGLProgram:!1,WebGLRenderbuffer:!1,WebGLRenderingContext:!1,WebGLShader:!1,WebGLShaderPrecisionFormat:!1,WebGLTexture:!1,WebGLUniformLocation:!1,WebSocket:!1,WheelEvent:!1,window:!1,Window:!1,Worker:!1,XDomainRequest:!1,XMLHttpRequest:!1,XMLSerializer:!1,XPathEvaluator:!1,XPathException:!1,XPathExpression:!1,XPathNamespace:!1,XPathNSResolver:!1,XPathResult:!1},worker:{importScripts:!0,postMessage:!0,self:!0},node:{__dirname:!1,__filename:!1,arguments:!1,Buffer:!1,clearImmediate:!1,clearInterval:!1,clearTimeout:!1,console:!1,DataView:!1,exports:!0,GLOBAL:!1,global:!1,module:!1,process:!1,require:!1,setImmediate:!1,setInterval:!1,setTimeout:!1},amd:{define:!1,require:!1},mocha:{after:!1,afterEach:!1,before:!1,beforeEach:!1,context:!1,describe:!1,it:!1,setup:!1,specify:!1,suite:!1,suiteSetup:!1,suiteTeardown:!1,teardown:!1,test:!1,xcontext:!1,xdescribe:!1,xit:!1,xspecify:!1},jasmine:{afterAll:!1,afterEach:!1,beforeAll:!1,beforeEach:!1,describe:!1,expect:!1,fail:!1,fdescribe:!1,fit:!1,it:!1,jasmine:!1,pending:!1,runs:!1,spyOn:!1,waits:!1,waitsFor:!1,xdescribe:!1,xit:!1},qunit:{asyncTest:!1,deepEqual:!1,equal:!1,expect:!1,module:!1,notDeepEqual:!1,notEqual:!1,notPropEqual:!1,notStrictEqual:!1,ok:!1,propEqual:!1,QUnit:!1,raises:!1,start:!1,stop:!1,strictEqual:!1,test:!1,"throws":!1},phantomjs:{console:!0,exports:!0,phantom:!0,require:!0,WebPage:!0},couch:{emit:!1,exports:!1,getRow:!1,log:!1,module:!1,provides:!1,require:!1,respond:!1,send:!1,start:!1,sum:!1},rhino:{defineClass:!1,deserialize:!1,gc:!1,help:!1,importClass:!1,importPackage:!1,java:!1,load:!1,loadClass:!1,Packages:!1,print:!1,quit:!1,readFile:!1,readUrl:!1,runCommand:!1,seal:!1,serialize:!1,spawn:!1,sync:!1,toint32:!1,version:!1},wsh:{ActiveXObject:!0,Enumerator:!0,GetObject:!0,ScriptEngine:!0,ScriptEngineBuildVersion:!0,ScriptEngineMajorVersion:!0,ScriptEngineMinorVersion:!0,VBArray:!0,WScript:!0,WSH:!0,XDomainRequest:!0},jquery:{$:!1,jQuery:!1},yui:{Y:!1,YUI:!1,YUI_config:!1},shelljs:{cat:!1,cd:!1,chmod:!1,config:!1,cp:!1,dirs:!1,echo:!1,env:!1,error:!1,exec:!1,exit:!1,find:!1,grep:!1,ls:!1,mkdir:!1,mv:!1,popd:!1,pushd:!1,pwd:!1,rm:!1,sed:!1,target:!1,tempdir:!1,test:!1,which:!1},prototypejs:{$:!1,$$:!1,$A:!1,$break:!1,$continue:!1,$F:!1,$H:!1,$R:!1,$w:!1,Abstract:!1,Ajax:!1,Autocompleter:!1,Builder:!1,Class:!1,Control:!1,Draggable:!1,Draggables:!1,Droppables:!1,Effect:!1,Element:!1,Enumerable:!1,Event:!1,Field:!1,Form:!1,Hash:!1,Insertion:!1,ObjectRange:!1,PeriodicalExecuter:!1,Position:!1,Prototype:!1,Scriptaculous:!1,Selector:!1,Sortable:!1,SortableObserver:!1,Sound:!1,Template:!1,Toggle:!1,Try:!1},meteor:{$:!1,_:!1,Accounts:!1,App:!1,Assets:!1,Blaze:!1,check:!1,Cordova:!1,DDP:!1,DDPServer:!1,Deps:!1,EJSON:!1,Email:!1,HTTP:!1,Log:!1,Match:!1,Meteor:!1,Mongo:!1,MongoInternals:!1,Npm:!1,Package:!1,Plugin:!1,process:!1,Random:!1,ReactiveDict:!1,ReactiveVar:!1,Router:!1,Session:!1,share:!1,Spacebars:!1,Template:!1,Tinytest:!1,Tracker:!1,UI:!1,Utils:!1,WebApp:!1,WebAppInternals:!1},mongo:{_isWindows:!1,_rand:!1,BulkWriteResult:!1,cat:!1,cd:!1,connect:!1,db:!1,getHostName:!1,getMemInfo:!1,hostname:!1,listFiles:!1,load:!1,ls:!1,md5sumFile:!1,mkdir:!1,Mongo:!1,ObjectId:!1,PlanCache:!1,pwd:!1,quit:!1,removeFile:!1,rs:!1,sh:!1,UUID:!1,version:!1,WriteResult:!1}}
+}),n("eslint/conf/environments",["./globals"],function(e){var t={builtin:e.builtin,browser:{globals:e.browser},node:{globals:e.node,ecmaFeatures:{globalReturn:!0}},amd:{globals:e.amd},mocha:{globals:e.mocha},jasmine:{globals:e.jasmine},phantomjs:{globals:e.phantom},jquery:{globals:e.jquery},prototypejs:{globals:e.prototypejs},shelljs:{globals:e.shelljs},meteor:{globals:e.meteor}};return t}),n("javascript/finder",["estraverse/estraverse","eslint/conf/environments"],function(e,t){e.VisitorKeys.RecoveredNode||(e.VisitorKeys.RecoveredNode=[]);var n={visitor:null,punc:"\n \r (){}[]:;,.+=-*^&@!%~`'\"/\\",findWord:function(e,t){if(e&&t>-1){for(var n=this.punc.indexOf(e.charAt(t))>-1,r=n&&t>0?t-1:t;r>=0&&!(this.punc.indexOf(e.charAt(r))>-1);)r--;var i=r;for(r=t;r<=e.length&&!(this.punc.indexOf(e.charAt(r))>-1);)r++;return(i===t||n&&i===t-1)&&r===t?null:i===t?e.substring(i,r):e.substring(i+1,r)}return null},findNode:function(t,n,r){var i=null,o=r&&r.parents?[]:null,a=r&&r.next?r.next:!1;if(null!=t&&t>-1&&n&&e.traverse(n,{enter:function(n){if(n.type&&n.range){if(!a&&n.type===e.Syntax.Program&&te.range[1]&&o.pop()}}),i&&o&&o.length>0){var s=o[o.length-1];"Program"!==s.type&&s.range[0]===i.range[0]&&s.range[1]===i.range[1]&&o.pop(),i.parents=o}return i},findNodeAfterComment:function(t,n){var r=null,i=[];if(Array.isArray(t.range)&&n){var o=t.range[1];e.traverse(n,{enter:function(t,n){if(t.type&&t.range)if(n&&i.push(n),o>t.range[0])r=t;else if(r=t,t.type!==e.Syntax.Program)return e.VisitorOption.Break}})}return r&&(r.parents=i),r},findToken:function(e,t){if(null!=e&&e>-1&&t&&t.length>0){var n,r=0,i=t.length-1,o=0;if(n=t[0],e>=n.range[0]&&e=n.range[0])return n.index=i,n;for(n=null;i>=r;){if(o=Math.floor((r+i)/2),n=t[o],en.range[1])r=o+1;else if(e===n.range[1]){var a=t[o+1];if(a.range[0]!==n.range[1])return n.index=o,n;r=o+1}else if(e>=n.range[0]&&e=n.range[0]&&e<=n.range[1]?(n.index=r,n):null}}return null},findComment:function(e,t){if(t.comments){for(var n=t.comments,r=n.length,i=0;r>i;i++){var o=n[i];if(o.range[0]=e)return o;if(e===t.range[1]&&e===o.range[1])return o;if(e>t.range[1]&&e<=o.range[1])return o;if(o.range[0]>e)return null}return null}},findScriptBlocks:function(e,t){var n=[],r=null,i=/<\s*script([^>]*)(?:\/>|>((?:.|\r?\n)*?)<\s*\/script[^<>]*>)/gi,o=/(type|language)\s*=\s*"([^"]*)"/i,a=/src\s*=\s*"([^"]*)"/i,s=this.findHtmlCommentBlocks(e,t);e:for(;null!=(r=i.exec(e));){var l=r[1],c=r[2],u=null;if(l){var p=o.exec(l);if(p&&p[2]){var f=p[2];if("language"===p[1]&&(f="text/"+f),!/^(application|text)\/(ecmascript|javascript(\d.\d)?|livescript|jscript|x\-ecmascript|x\-javascript)$/gi.test(f))continue}var d=a.exec(l);d&&(u=d[1])}if(c||!u){var h=r.index+r[0].indexOf(">")+1;if(null==t||t>=h&&h+c.length>=t){for(var m=0;m=h)continue e;n.push({text:c,offset:h,dependencies:u})}}else n.push({text:"",offset:0,dependencies:u})}var g={blur:!0,change:!0,click:!0,dblclick:!0,focus:!0,keydown:!0,keypress:!0,keyup:!0,load:!0,mousedown:!0,mousemove:!0,mouseout:!0,mouseover:!0,mouseup:!0,reset:!0,select:!0,submit:!0,unload:!0},v=/\s+on(\w*)(\s*=\s*")([^"]*)"/gi,y=0;e:for(;null!=(r=v.exec(e));){y++;var b=r[1],x=r[2];if(c=r[3],b&&b in g){if(!c||!x)continue;if(h=r.index+2+b.length+x.length,null==t||t>=h&&h+c.length>=t){for(var S=0;S=h)continue e;n.push({text:c,offset:h,isWrappedFunctionCall:!0})}}}return n},findHtmlCommentBlocks:function(e,t){for(var n=[],r=null,i=//gi;null!=(r=i.exec(e));){var o=r[1];o.length<1||(null==t||r.index<=t&&r.index+o.length>=r.index)&&n.push({text:o,start:r.index,end:r.index+o.length})}return n},findESLintEnvForMember:function(e){var n=Object.keys(t);if(n)for(var r=n.length,i=0;r>i;i++){var o=t[n[i]];if("undefined"!=typeof o[e])return n[i];var a=o.globals;if(a&&"undefined"!=typeof a[e])return n[i]}return null},findDirective:function(e,t){if(e&&"undefined"!=typeof t)for(var n=e.comments.length,r=0;n>r;r++){var i=/^\s*(eslint-\w+|eslint|globals?)(\s|$)/.exec(e.comments[r].value);if(null!=i&&"undefined"!=typeof i&&i[1]===t)return e.comments[r]}return null},findCommentForNode:function r(e){var t=e.leadingComments,n=null;if(t&&t.length>0){if(n=t[t.length-1],"Block"===n.type)return n.node=e,n}else if("Property"===e.type){if(n=r(e.key))return n.node=e,n}else if("FunctionDeclaration"===e.type&&(n=r(e.id)))return n.node=e,n;return n=Object.create(null),n.node=e,n.value="",n},findParentFunction:function(e){if(e)if(e.parents)for(var t=e.parents,n=t.pop();n;){if("FunctionDeclaration"===n.type||"FunctionExpression"===n.type)return n;n=t.pop()}else if(e.parent)for(var n=e.parent;n;){if("FunctionDeclaration"===n.type||"FunctionExpression"===n.type)return n;n=n.parent}return null}};return n}),n("javascript/compilationUnit",["orion/Deferred"],function(e){function t(e,t,n){this._blocks=e,this._metadata=t,this._ec=n,this._deps=[]}return t.prototype._init=function(){var e="this.",t=0;this._source="",this._blocks.sort(function(e,t){var n=e.offset?e.offset:0,r=t.offset?t.offset:0;return n-r});for(var n=0;n0;)this._source+=" ",i--;this._source+=e,this._source+=r.text,r.text&&";"!==r.text.charAt(r.text.length-1)&&(this._source+=";")}else{for(;i>0;)this._source+=" ",i--;this._source+=r.text}t=this._source.length}},t.prototype.getSource=function(){return this._source||this._init(),this._source},t.prototype.validOffset=function(e){if(!this._blocks||this._blocks.length<1||0>e)return!1;for(var t=0;t=r&&e<=r+n.text.length)return!0}return!1},t.prototype.getEditorContext=function(){var t=Object.create(null),n=this;return t.getText=function(){return(new e).resolve(n.getSource())},t.getFileMetadata=function(){return(new e).resolve(n._metadata)},t.setText=function(t,r,i){return n._ec?n._ec.setText(t,r,i):(new e).resolve(null)},t},t.prototype.getDependencies=function(){return this._deps},t}),n("javascript/quickFixes",["orion/objects","orion/Deferred","orion/editor/textModel","javascript/finder","javascript/compilationUnit","orion/metrics"],function(e,t,n,r,i,o){function a(e){this.astManager=e}function s(e,t){if(!e)return 0;if(0>t)return 0;for(var n=t,r=e[n];n>-1&&!/[\r\n]/.test(r);)r=e[--n];return n+1}function l(e,t){if(!e)return 0;if(0>t)return 0;for(var n=t,r=e[n];nt)return"";for(var r=t,i=e[r],o=n?" ":"";" "===i||" "===i;)o+=i,i=e[++r];return o}function u(e,t,n){if(!e||!t)return"";for(var r=t.start,i=e[r],o="",a=!1;r>=t.start&&r<=t.end;){if("\n"===i){a=!0;break}i=e[r++]}return a||(o+="\n"),"undefined"!=typeof n&&(o+=n),o}function p(e,t){return"*"===e.charAt(t+1)?"*"===e.charAt(t+2)?3:2:0}function f(e,t,n,r){return r&&""!==e.slice(t.length).trim()?e.trim()+", "+n:e.trim()+" "+n}function d(e,t){if(e&&e.length)for(var n=0;nt||t>e.length)){var r=e[t];return 1===e.length?n.setText("",r.range[0],r.range[1]):t===e.length-1?n.setText("",e[t-1].range[1],r.range[1]):r?n.setText("",r.range[0],e[t+1].range[0]):null}}function m(e,t,n,r){if(e.leadingComments&&e.leadingComments.length>0)for(var i=e.leadingComments.length-1;i>-1;i--){var o=e.leadingComments[i],a=new RegExp("(\\s*[*]+\\s*(?:@param)\\s*(?:\\{.*\\})?\\s*(?:"+r+")+.*)").exec(o.value);if(a){var s=o.range[0]+a.index+p(t,o.range[0]);return n.setText("",s,s+a[1].length)}}return null}function g(e,t){if(t.leadingComments)for(var n=0;n-1)return!0}return!1}function v(e){if("Program"===e.type&&e.body&&e.body.length>0){var t=e.body[0],n=-1;switch(t.type){case"FunctionDeclaration":if(n=y(t),n>-1)return n;if(n=y(t.id),n>-1)return n;break;case"ExpressionStatement":if(t.expression&&t.expression.right&&"FunctionExpression"===t.expression.right.type){if(n=y(t),n>-1)return n;if(n=y(t.expression.left),n>-1)return n}}}return e.range[0]}function y(e){if(e.leadingComments&&e.leadingComments.length>0){var t=e.leadingComments[e.leadingComments.length-1];if(/(?:@param|@return|@returns|@type|@constructor|@name|@description)/gi.test(t.value))return t.range[0]}return-1}return e.mixin(a.prototype,{execute:function(e,t){var n=t.annotation.fixid?t.annotation.fixid:t.annotation.id;delete t.annotation.fixid,o.logEvent("language tools","quickfix",n,"application/javascript");var a=this[n];if(a){var s=this;return e.getFileMetadata().then(function(n){return"text/html"===n.contentType.id?e.getText().then(function(o){var l=r.findScriptBlocks(o);if(l&&l.length>0){var c=new i(l,n,e);return a(c.getEditorContext(),t.annotation,s.astManager)}}):a(e,t.annotation,s.astManager)})}return null},eqeqeq:function(e,t){var n=/^.*\'(\!==|===)\'/.exec(t.title);return e.setText(n[1],t.start,t.end)},"no-comma-dangle":function(e,t){return e.setText("",t.start,t.end)},"no-empty-block":function(e,t){return e.getText().then(function(n){var r=s(n,t.start),i="//TODO empty block",o=c(n,r,!0);return i="\n"+o+i,i+=u(n,t),e.setText(i,t.start+1,t.start+1)})},"no-extra-semi":function(e,t){return e.setText("",t.start,t.end)},"no-fallthrough":function(e,t){return e.getText().then(function(n){var r=s(n,t.start),i="//$FALLTHROUGH$",o=c(n,r);return i+=u(n,t,o),e.setText(i,t.start,t.start)})},"no-fallthrough-break":function(e,t){return e.getText().then(function(n){var r=s(n,t.start),i="break;",o=c(n,r);return i+=u(n,t,o),e.setText(i,t.start,t.start)})},"no-new-array":function(e,t,n){return n.getAST(e).then(function(n){var i=r.findNode(t.start,n,{parents:!0});if(i&&i.parents){var o=i.parents[i.parents.length-1];if("CallExpression"===o.type||"NewExpression"===o.type){var a="";if(o.arguments.length>0){var s=o.arguments[0].range[0],l=o.arguments[o.arguments.length-1].range[1];a+="["+n.source.substring(s,l)+"]"}else a+="[]";return e.setText(a,o.start,o.end)}}})},"no-reserved-keys":function(e,t,n){return n.getAST(e).then(function(n){var i=r.findNode(t.start,n,{parents:!0});return i&&"Identifier"===i.type?e.setText('"'+i.name+'"',i.range[0],i.range[1]):void 0})},"no-sparse-arrays":function(e,t,i){return i.getAST(e).then(function(i){var o=r.findNode(t.start,i,{parents:!0});if(o&&"ArrayExpression"===o.type){var a=new n.TextModel(i.source.slice(t.start,t.end)),s=o.elements.length,l=s-1,c=o.elements[l];if(null===c){var u=r.findToken(o.range[1],i.tokens);for("]"!==u.value&&(u=i.tokens[u.index-1]);l>-1&&(c=o.elements[l],null===c);l--);if(null===c)return e.setText(a.getText(),t.start+1,t.end-1);a.setText("",c.range[1]-t.start,u.range[0]-t.start)}for(var p=c;l>-1;l--)c=o.elements[l],null!==c&&c.range[0]!==p.range[0]&&(a.setText(", ",c.range[1]-t.start,p.range[0]-t.start),p=c);return null===c&&null!==p&&a.setText("",o.range[0]+1-t.start,p.range[0]-t.start),e.setText(a.getText(),t.start,t.end)}return null})},"no-throw-literal":function(e,t,n){return n.getAST(e).then(function(n){var i=r.findNode(t.start,n,{parents:!0}),o=i.raw||n.source.slice(i.range[0],i.range[1]);return e.setText("new Error("+o+")",t.start,t.end)})},"no-undef-defined":function(e,t,n){function i(e){if(e&&e.parents&&e.parents.length>0&&"Identifier"===e.type){var t=e.parents.pop();return t&&("AssignmentExpression"===t.type||"UpdateExpression"===t.type)}return!1}var o=/^'(.*)'/.exec(t.title);return null!=o&&"undefined"!=typeof o?n.getAST(e).then(function(n){var a=null,s=0,l=o[1],c=r.findNode(t.start,n,{parents:!0});if(i(c)&&(l+=":true"),a=r.findDirective(n,"globals"))return s=a.range[0]+2,e.setText(f(a.value,"globals",l),s,s+a.value.length);var u=v(n);return e.setText("/*globals "+l+" */\n",u,u)}):null},"no-undef-defined-inenv":function(e,t,n){var i=/^'(.*)'/.exec(t.title);return null!=i&&"undefined"!=typeof i?n.getAST(e).then(function(t){var n=null,o=0;if("console"===i[1])var a="node";else a=r.findESLintEnvForMember(i[1]);if(a){if(n=r.findDirective(t,"eslint-env"))return o=p(t.source,n.range[0])+n.range[0],e.setText(f(n.value,"eslint-env",a,!0),o,o+n.value.length);var s=v(t);return e.setText("/*eslint-env "+a+" */\n",s,s)}}):null},"no-unreachable":function(e,t){return e.setText("",t.start,t.end)},"no-unused-params":function(e,n,i){return i.getAST(e).then(function(i){var o=r.findNode(n.start,i,{parents:!0});if(o){for(var a=[],s=o.parents.pop(),l=-1,c=0;c0&&(p=m(f,i.source,e,s.params[l].name),p&&a.push(p));else{var d=f.arguments;for(c=0;c0){var o=i.parents.pop();if("VariableDeclarator"===o.type){var a=i.parents.pop();if("VariableDeclaration"===a.type){if(1===a.declarations.length)return e.setText("",a.range[0],a.range[1]);var s=d(a.declarations,o);if(s>-1)return h(a.declarations,s,e)}}}return null})},"no-unused-vars-unused-funcdecl":function(e,t,n){return n.getAST(e).then(function(n){var i=r.findNode(t.start,n,{parents:!0});if(i&&i.parents&&i.parents.length>0){var o=i.parents.pop();if("FunctionDeclaration"===o.type)return e.setText("",o.range[0],o.range[1])}return null})},"no-unused-params-expr":function(e,t,n){function i(t,n,r){if(Array.isArray(r)){var i=r[r.length-1];if("Block"===i.type){var o=i.range[0]+i.value.length+p(n.source,i.range[0]),a=s(n.source,o),l=c(n.source,a),u="* @callback\n"+l;return e.setText(u,o-1,o-1)}}return a=s(n.source,t.range[0]),l=c(n.source,a),e.setText("/**\n"+l+" * @callback\n"+l+" */\n"+l,t.range[0],t.range[0])}return n.getAST(e).then(function(n){var o=r.findNode(t.start,n,{parents:!0});if(o&&o.parents&&o.parents.length>0){var a,s=o.parents.pop(),l=o.parents.pop();switch(l.type){case"Property":g("@callback",l)||g("@callback",l.key)||(a=i(l,n,l.leadingComments?l.leadingComments:l.key.leadingComments));break;case"AssignmentExpression":var c=l.left;"MemberExpression"!==c.type||g("@callback",c)?"Identifier"!==c.type||g("@callback",c)||(a=i(l.left,n,c.leadingComments)):a=i(c,n,c.leadingComments);break;case"VariableDeclarator":var u=l;l=l.parent,l.declarations[0].range[0]==u.range[0]&&l.declarations[0].range[1]===u.range[1]?a=i(l,n,u.id.leadingComments):g("@callback",u.id)||(a=i(u,n,u.id.leadingComments))}if(!a&&!g("@callback",s))return e.setText("/* @callback */ ",s.range[0],s.range[0])}return a})},"use-isnan":function(e,t,n){return n.getAST(e).then(function(n){var i=r.findNode(t.start,n,{parents:!0});if(i&&i.parents&&i.parents.length>0){var o=i.parents.pop();if("BinaryExpression"===o.type){var a;if("Identifier"===o.left.type&&"NaN"===o.left.name?a=o.right:"Identifier"===o.right.type&&"NaN"===o.right.name&&(a=o.left),a)return e.getText(a.range[0],a.range[1]).then(function(t){return e.setText("isNaN("+t+")",o.range[0],o.range[1])})}}})},semi:function(e,t){return e.setText(";",t.end,t.end)},"missing-nls":function(e,t,n){return t.data&&"number"==typeof t.data.indexOnLine?n.getAST(e).then(function(n){var r=l(n.source,t.end),i=" //$NON-NLS-"+(t.data.indexOnLine+1)+"$";return e.setText(i,r,r)}):null}}),a.prototype.contructor=a,{JavaScriptQuickfixes:a}}),n("javascript/nls/messages",{root:!0}),n("javascript/nls/root/messages",{pluginName:"Orion JavaScript Tool Support",pluginDescription:"This plug-in provides JavaScript tools support for Orion, like editing, search, navigation, validation, and code completion.",error:"Error",warning:"Warning",ignore:"Ignore",ternContentAssist:"Tern JavaScript content assist",prefCodeStyle:"Code Style",prefBestPractices:"Best Practices",prefPotentialProblems:"Potential Programming Problems",sourceOutline:"Source Outline",sourceOutlineTitle:"JavaScript source outline",contentAssist:"JavaScript content assist",eslintValidator:"JavaScript Validator",missingCurly:"Statements not enclosed in braces:",noCaller:"Discouraged 'arguments.caller' or 'arguments.callee' use:",noCommaDangle:"Trailing commas in object expressions:",noCondAssign:"Assignments in conditional expressions:",noConsole:"Discouraged console use in browser code:",noConstantCondition:"Constant as conditional expression:",noRegexSpaces:"Multiple spaces in regular expressions:",noReservedKeys:"Reserved words used as property keys:",noReservedKeysFixName:"Surround key with quotes",noEqeqeq:"Discouraged '==' use:",noDebugger:"Discouraged 'debugger' statement use:",noWith:"Discouraged 'with' statement use:",noEval:"Discouraged 'eval()' use:",noImpliedEval:"Discouraged implied 'eval()' use:",noDupeKeys:"Duplicate object keys:",noIterator:"Discouraged __iterator__ property use:",noProto:"Discouraged __proto__ property use:",noUndefInit:"Explicitly initializing variables to undefined:",useIsNaN:"NaN not compared with isNaN():",useIsNanFixName:"Use isNaN()",missingDoc:"Missing JSDoc:",noUnreachable:"Unreachable code:",noFallthrough:"Switch case fall-through:",useBeforeDefine:"Member used before definition:",noEmptyBlock:"Undocumented empty block:",newParens:"Missing parentheses in constructor call:",noNewArray:"Discouraged 'new Array()':",noNewArrayFixName:"Convert to array literal",noNewFunc:"Discouraged 'new Function()':",noNewObject:"Discouraged 'new Object()':",noNewWrappers:"Discouraged wrapper objects:",missingSemi:"Missing semicolons:",unusedVars:"Unused variables:",varRedecl:"Variable re-declarations:",varShadow:"Variable shadowing:",undefMember:"Undeclared global reference:",unnecessarySemis:"Unnecessary semicolons:",unusedParams:"Unused parameters:",unsupportedJSLint:"Unsupported environment directive:",noThrowLiteral:"Literal used in 'throw':",missingNls:"Non-externalized string literals (missing $NON-NLS$ tag):",generateDocName:"Generate Element Comment",generateDocTooltip:"Generate a JSDoc-like comment for the selected JavaScript element",renameElement:"Rename Element",renameElementTooltip:"Rename the selected JavaScript element",renameFailedTimedOut:"Could not rename element - operation timed out",openDeclName:"Open Declaration",openDeclTooltip:"Open the declaration of the selected element",openImplName:"Open Implementation",openImplTooltip:"Open the implementation of the selected element",workspaceRefsName:"Workspace",workspaceRefsTooltip:"Show all references to the selection in the workspace",projectRefsName:"Project",projectRefsTooltip:"Show all references to the selection in the current project",referencesMenuName:"References",referencesMenuTooltip:"Show different kinds of references",noDeclTimedOut:"No declaration was found - operation timed out",validTypeof:"Invalid 'typeof' comparison:",noSparseArrays:"Sparse array declarations:",javascriptValidation:"Javascript Validation",jsHover:"JavaScript Hover Provider",removeExtraSemiFixName:"Remove extra semicolon",addFallthroughCommentFixName:"Add $FALLTHROUGH$ comment",addEmptyCommentFixName:"Comment empty block",addESLintEnvFixName:"Add to eslint-env directive",addESLintGlobalFixName:"Add to globals directive",removeUnusedParamsFixName:"Remove parameter",commentCallbackFixName:"Add @callback to function",eqeqeqFixName:"Update operator",unreachableFixName:"Remove unreachable code",sparseArrayFixName:"Convert to normal array",semiFixName:"Add missing ';'",radix:"Missing radix parameter to parseInt():",unusedVarsUnusedFixName:"Remove unused variable",unusedFuncDeclFixName:"Remove unused function",noCommaDangleFixName:"Remove extra ','",addBBreakFixName:"Add break statement",noShadowGlobals:"Global shadowing:",noThrowLiteralFixName:"Change to Error",missingNlsFixName:"Add missing $NON-NLS$ tag",funcProposalDescription:" - The name of the function",funcParamProposalDescription:" - Function parameter",eslintRuleProposalDescripton:" - ESLint rule",eslintEnvProposalDescription:" - ESLint environment name",onlineDocumentationProposalEntry:"\n\n[Online documentation](${0})",keywordProposalDescription:" - Keyword",keywordHoverProposal:"ECMAScript reserved keyword",reloadPluginCmd:"Reload",reloadPluginCmdTooltip:"Reload plug-in",reloadAllPluginsCmd:"Reload All",reloadAllPluginsCmdTooltip:"Reload all plug-ins",templateHoverHeader:"Template source code:\n\n",templateAssistHeader:"Templates",keywordAssistHeader:"Keywords",ternPlugins:"Tern Plug-ins",noTernPluginsAvailable:"No Tern plug-ins are currently loaded. This may be because you have not yet activated content assist in a JavaScript file. Tern plug-ins provide type information and code templates for JavaScript.",noDeclFound:"Could not find declaration",deprecatedHoverTitle:"Deprecated.",parametersHoverTitle:"Parameters:",returnsHoverTitle:"Returns:",throwsHoverTitle:"Throws:",callbackHoverTitle:"Callback:",sinceHoverTitle:"Since:",seeAlsoHoverTitle:"See Also:",openFileForTitle:"Open file for",functionDecls:"Function Declarations",functionCalls:"Function Calls",propAccess:"Property Access",propWrite:"Property Write",varAccess:"Variable Access",varWrite:"Variable Write",varDecls:"Variable Declarations",regex:"Regular Expressions",strings:"Strings",blockComments:"Block Comments",lineComments:"Line Comments",partial:"Partial Matches",uncategorized:"Uncategorized",parseErrors:"Parse Errors",noFileContents:"Could not compute references: failed to compute file text content",noFileMeta:"Could not compute references: failed to compute file metadata",cannotComputeRefs:"Cannot compute references: ${0}",notAnIdentifier:"Cannot compute references at the selected location: Location is not an identifier"}),n("orion/editor/templates",[],function(){function e(e,t){return t.substring(e.length)}function t(e,t,n,r){this.prefix=e,this.description=t,this.template=n,this.name=r,this._parse()}function n(e,t){this._keywords=e||[],this._templates=[],this.addTemplates(t||[])}var r="${tab}",i="${delimiter}",o="${cursor}";return t.prototype={getProposal:function(e,t,n){var a,s=t-e.length,l={},c=void 0!==n.delimiter?n.delimiter:"\n";n.indentation&&(c+=n.indentation);for(var u=void 0!==n.tab?n.tab:" ",p=0,f=this.variables,d=this.segments,h=[],m=0;mt.name?1:0}),r.splice(0,0,{proposal:"",description:"Templates",style:"noemphasis_title",unselectable:!0})),r},removePrefix:function(t,n){var r=n.overwrite=n.proposal.substring(0,t.length)!==t;r||(n.proposal=e(t,n.proposal))},isValid:function(){return!0}},{Template:t,TemplateContentAssist:n}}),n("javascript/contentAssist/templates",["orion/editor/templates"],function(e){function t(t){if(t.t)return t.t;var n=new e.Template(t.prefix,t.description,t.template,t.name);return t.t=n,n}function n(e){for(var n=[],r=i.length,o=0;r>o;o++){var a=i[o];a.nodes&&a.nodes[e]&&n.push(a)}return n.map(t,this)}var r={type:"link",values:["boolean","function","number","object","string","symbol","undefined"],title:"Typeof Options",style:"emphasis"},i=[{prefix:"eslint",name:"eslint",nodes:{top:!1,member:!1,prop:!1,doc:!0},description:" - ESLint rule enable or disable",template:"eslint ${rule-id}:${0/1} ${cursor}"},{prefix:"eslint-env",name:"eslint-env",nodes:{top:!1,member:!1,prop:!1,doc:!0},description:" - ESLint environment directive",template:"eslint-env ${library}"},{prefix:"eslint-enable",name:"eslint-enable",nodes:{top:!1,member:!1,prop:!1,doc:!0},description:" - ESLint rule enablement directive",template:"eslint-enable ${rule-id} ${cursor}"},{prefix:"eslint-disable",name:"eslint-disable",nodes:{top:!1,member:!1,prop:!1,doc:!0},description:" - ESLint rule disablement directive",template:"eslint-disable ${rule-id} ${cursor}"},{prefix:"@author",name:"@author",nodes:{top:!1,member:!1,prop:!1,jsdoc:!0},description:" - Author JSDoc tag",template:"@author ${cursor}"},{prefix:"@callback",name:"@callback",nodes:{top:!1,member:!1,prop:!1,jsdoc:!0},description:" - Callback JSDoc tag",template:"@callback ${cursor}"},{prefix:"@class",name:"@class",nodes:{top:!1,member:!1,prop:!1,jsdoc:!0},description:" - Class JSDoc tag",template:"@class ${cursor}"},{prefix:"@constructor",name:"@constructor",nodes:{top:!1,member:!1,prop:!1,jsdoc:!0},description:" - Constructor JSDoc tag",template:"@constructor ${cursor}"},{prefix:"@deprecated",name:"@deprecated",nodes:{top:!1,member:!1,prop:!1,jsdoc:!0},description:" - Deprecated JSDoc tag",template:"@deprecated ${cursor}"},{prefix:"@description",name:"@description",nodes:{top:!1,member:!1,prop:!1,jsdoc:!0},description:" - Description JSDoc tag",template:"@description ${cursor}"},{prefix:"@function",name:"@function",nodes:{top:!1,member:!1,prop:!1,jsdoc:!0},description:" - Function JSDoc tag",template:"@function ${cursor}"},{prefix:"@lends",name:"@lends",nodes:{top:!1,member:!1,prop:!1,jsdoc:!0},description:" - Lends JSDoc tag",template:"@lends ${cursor}"},{prefix:"@license",name:"@license",nodes:{top:!1,member:!1,prop:!1,jsdoc:!0},description:" - License JSDoc tag",template:"@license ${cursor}"},{prefix:"@name",name:"@name",nodes:{top:!1,member:!1,prop:!1,jsdoc:!0},description:" - Name JSDoc tag",template:"@name ${cursor}"},{prefix:"@param",name:"@param",nodes:{top:!1,member:!1,prop:!1,jsdoc:!0},description:" - Param JSDoc tag",template:"@param {${type}} ${cursor}"},{prefix:"@private",name:"@private",nodes:{top:!1,member:!1,prop:!1,jsdoc:!0},description:" - Private JSDoc tag",template:"@private ${cursor}"},{prefix:"@public",name:"@public",nodes:{top:!1,member:!1,prop:!1,jsdoc:!0},description:" - Public JSDoc tag",template:"@public ${cursor}"},{prefix:"@returns",name:"@returns",nodes:{top:!1,member:!1,prop:!1,jsdoc:!0},description:" - Returns JSDoc tag",template:"@returns {${type}} ${cursor}"},{prefix:"@see",name:"@see",nodes:{top:!1,member:!1,prop:!1,jsdoc:!0},description:" - See JSDoc tag",template:"@see ${cursor}"},{prefix:"@since",name:"@since",nodes:{top:!1,member:!1,prop:!1,jsdoc:!0},description:" - Since JSDoc tag",template:"@since ${cursor}"},{prefix:"@throws",name:"@throws",nodes:{top:!1,member:!1,prop:!1,jsdoc:!0},description:" - Throws JSDoc tag",template:"@throws {${type}} ${cursor}"},{prefix:"arrow",name:"arrow",nodes:{top:!0,member:!1,prop:!1},description:" - arrow function expression",template:"${param} => {${cursor}}"},{prefix:"arrow",name:"arrow object",nodes:{top:!0,member:!1,prop:!1},description:" - arrow function expression returning an object",template:"var ${name} = () => ({ ${prop}: ${val}${cursor} });"},{prefix:"if",name:"if",nodes:{top:!0,member:!1,prop:!1},description:" - if statement",template:"if (${condition}) {\n ${cursor}\n}"},{prefix:"if",name:"if",nodes:{top:!0,member:!1,prop:!1},description:" - if else statement",template:"if (${condition}) {\n ${cursor}\n} else {\n \n}"},{prefix:"for",name:"for",nodes:{top:!0,member:!1,prop:!1},description:" - iterate over array",template:"for (var ${i}=0; ${i}<${array}.length; ${i}++) {\n ${cursor}\n}"},{prefix:"for",name:"for",nodes:{top:!0,member:!1,prop:!1},description:" - iterate over array with local var",template:"for (var ${i}=0; ${i}<${array}.length; ${i}++) {\n var ${value} = ${array}[${i}];\n ${cursor}\n}"},{prefix:"for",name:"for..in",nodes:{top:!0,member:!1,prop:!1},description:" - iterate over properties of an object",template:"for (var ${property} in ${object}) {\n if (${object}.hasOwnProperty(${property})) {\n ${cursor}\n }\n}"},{prefix:"while",name:"while",nodes:{top:!0,member:!1,prop:!1},description:" - while loop with condition",template:"while (${condition}) {\n ${cursor}\n}"},{prefix:"do",name:"do",nodes:{top:!0,member:!1,prop:!1},description:" - do while loop with condition",template:"do {\n ${cursor}\n} while (${condition});"},{prefix:"eslint",name:"eslint",nodes:{top:!0,member:!1,prop:!1,doc:!1,jsdoc:!1},description:" - ESLint rule enable / disable directive",template:"/* eslint ${rule-id}:${0/1}*/"},{prefix:"eslint-env",name:"eslint-env",nodes:{top:!0,member:!1,prop:!1,doc:!1,jsdoc:!1},description:" - ESLint environment directive",template:"/* eslint-env ${library}*/"},{prefix:"eslint-enable",name:"eslint-enable",nodes:{top:!0,member:!1,prop:!1,doc:!1,jsdoc:!1},description:" - ESLint rule enablement directive",template:"/* eslint-enable ${rule-id} */"},{prefix:"eslint-disable",name:"eslint-disable",nodes:{top:!0,member:!1,prop:!1,doc:!1,jsdoc:!1},description:" - ESLint rule disablement directive",template:"/* eslint-disable ${rule-id} */"},{prefix:"switch",name:"switch",nodes:{top:!0,member:!1,prop:!1},description:" - switch case statement",template:"switch (${expression}) {\n case ${value1}:\n ${cursor}\n break;\n default:\n}"},{prefix:"case",name:"case",nodes:{top:!0,member:!1,prop:!1,swtch:!0},description:" - case statement",template:"case ${value}:\n ${cursor}\n break;"},{prefix:"try",name:"try",nodes:{top:!0,member:!1,prop:!1},description:" - try..catch statement",template:"try {\n ${cursor}\n} catch (${err}) {\n}"},{prefix:"try",name:"try",nodes:{top:!0,member:!1,prop:!1},description:" - try..catch statement with finally block",template:"try {\n ${cursor}\n} catch (${err}) {\n} \n finally {\n}"},{prefix:"typeof",name:"typeof",nodes:{top:!0,member:!1,prop:!1},description:" - typeof statement",template:'typeof ${object} === "${type:'+JSON.stringify(r).replace("}","\\}")+'}"'},{prefix:"instanceof",name:"instanceof",nodes:{top:!0,member:!1,prop:!1},description:" - instanceof statement",template:"${object} instanceof ${type}"},{prefix:"with",name:"with",nodes:{top:!0,member:!1,prop:!1},description:" - with statement",template:"with (${object}) {\n ${cursor}\n}"},{prefix:"function",name:"function",nodes:{top:!0,member:!1,prop:!1},description:" - function declaration",template:"/**\n * @name ${name}\n * @param ${parameter}\n */\nfunction ${name} (${parameter}) {\n ${cursor}\n}"},{prefix:"function",name:"function",nodes:{top:!1,member:!1,prop:!1,obj:!0},description:" - member function expression",template:"/**\n * @name ${name}\n * @function\n * @param ${parameter}\n */\n${name}: function(${parameter}) {\n ${cursor}\n}"},{prefix:"function",name:"function",nodes:{top:!1,member:!1,prop:!0,obj:!1},description:" - member function expression",template:"function(${parameter}) {\n ${cursor}\n}"},{prefix:"define",name:"define",nodes:{top:!0,member:!1,prop:!1},description:" - define function call",template:"/* eslint-env amd */\ndefine('${name}', [\n'${import}'\n], function(${importname}) {\n ${cursor}\n});"},{prefix:"nls",name:"nls",nodes:{top:!0,member:!1,prop:!1},description:" - non NLS string",template:"${cursor} //$NON-NLS-${0}$"},{prefix:"log",name:"log",nodes:{top:!0,member:!1,prop:!1},description:" - console log",template:"console.log(${object});"},{prefix:"node",name:"node",nodes:{top:!0,member:!1,prop:!1,doc:!1,jsdoc:!1},description:" - Node require function call",template:"/* eslint-env node*/\nvar lib = require('${cursor}');"}];
+return{getTemplatesForKind:n}}),n("orion/URITemplate",[],function(){function e(e){this._text=e}function t(e){return e.replace("%25","%")}function n(e,n){if("U"===n)return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()});if("U+R"===n)return encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(p,t);if("U+R-,"===n)return encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw new Error("Unknown allowed character set: "+n)}function r(e,t,r){for(var i=[],o=0;o=5760&&" ".indexOf(e)>=0}function o(e){return"0123456789".indexOf(e)>=0}function a(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function s(e){return"01234567".indexOf(e)>=0}function l(e){return e>="a"&&"z">=e||e>="A"&&"Z">=e||e>="0"&&"9">=e}function c(e){return"$"===e||"_"===e||"\\"===e||e>="a"&&"z">=e||e>="A"&&"Z">=e||e.charCodeAt(0)>=128&&k.NonAsciiIdentifierStart.test(e)}function u(e){return"$"===e||"_"===e||"\\"===e||e>="a"&&"z">=e||e>="A"&&"Z">=e||e>="0"&&"9">=e||e.charCodeAt(0)>=128&&k.NonAsciiIdentifierPart.test(e)}function p(e){return-1==="><(){}[],:*|?!=".indexOf(e)&&!i(e)&&!r(e)}function f(e){return"param"===e||"argument"===e||"arg"===e}function d(e){return"property"===e||"prop"===e}function h(e){return f(e)||d(e)||"extends"===e||"augments"===e||"alias"===e||"this"===e||"mixes"===e||"requires"===e}function m(e){return h(e)||"const"===e||"constant"===e}function g(e){return d(e)||f(e)}function v(e){return f(e)||"define"===e||"enum"===e||"implements"===e||"return"===e||"this"===e||"type"===e||"typedef"===e||"returns"===e||d(e)}function y(e){return v(e)||"throws"===e||"const"===e||"constant"===e||"namespace"===e||"member"===e||"var"===e||"module"===e||"constructor"===e||"class"===e}function b(e){this.name="DoctrineError",this.message=e}function x(e){throw new b(e)}function S(){}function E(e){return e.replace(/^\s+/,"").replace(/\s+$/,"")}function w(e){var t,n,o,a,s,l=0,c=1,u=2;for(e=e.replace(/^\/\*\*?/,"").replace(/\*\/$/,""),t=0,n=e.length,o=l,a="";n>t;){switch(s=e[t],o){case l:r(s)?a+=s:"*"===s?o=c:i(s)||(a+=s,o=u);break;case c:i(s)||(a+=s),o=r(s)?l:u;break;case u:a+=s,r(s)&&(o=l)}t+=1}return a}var _,k,C,T,L,A,P;_="0.5.1",k={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},C=void 0!==typeof"doctrine"[0],A=Array.isArray,A||(A=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),P=function(){var e=Object.prototype.hasOwnProperty;return function(t,n){return e.call(t,n)}}(),C||(t=function(e,t,n){return e.slice(t,n).join("")}),b.prototype=new Error,b.prototype.constructor=b,"dev"===_.slice(-3)&&(S=function(e,t){e||x(t)}),function(e){function t(e,t,n,r){this._previous=e,this._index=t,this._token=n,this._value=r}function n(){var e=U[G];return G+=1,e}function l(e){var t,r,i,o=0;for(r="u"===e?4:2,t=0;r>t;++t){if(!(B>G&&a(U[G])))return"";i=n(),o=16*o+"0123456789abcdef".indexOf(i.toLowerCase())}return String.fromCharCode(o)}function u(){var e,t,i,o,a,c="",u=!1;for(e=U[G],++G;B>G;){if(t=n(),t===e){e="";break}if("\\"===t)if(t=n(),r(t))"\r"===t&&"\n"===U[G]&&++G;else switch(t){case"n":c+="\n";break;case"r":c+="\r";break;case"t":c+=" ";break;case"u":case"x":a=G,o=l(t),o?c+=o:(G=a,c+=t);break;case"b":c+="\b";break;case"f":c+="\f";break;case"v":c+="";break;default:s(t)?(i="01234567".indexOf(t),0!==i&&(u=!0),B>G&&s(U[G])&&(u=!0,i=8*i+"01234567".indexOf(n()),"0123".indexOf(t)>=0&&B>G&&s(U[G])&&(i=8*i+"01234567".indexOf(n()))),c+=String.fromCharCode(i)):c+=t}else{if(r(t))break;c+=t}}return""!==e&&x("unexpected quote"),H=c,$.STRING}function f(){var e,t;if(e="","."!==t){if(e=n(),t=U[G],"0"===e){if("x"===t||"X"===t){for(e+=n();B>G&&(t=U[G],a(t));)e+=n();return e.length<=2&&x("unexpected token"),B>G&&(t=U[G],c(t)&&x("unexpected token")),H=parseInt(e,16),$.NUMBER}if(s(t)){for(e+=n();B>G&&(t=U[G],s(t));)e+=n();return B>G&&(t=U[G],(c(t)||o(t))&&x("unexpected token")),H=parseInt(e,8),$.NUMBER}o(t)&&x("unexpected token")}for(;B>G&&(t=U[G],o(t));)e+=n()}if("."===t)for(e+=n();B>G&&(t=U[G],o(t));)e+=n();if("e"===t||"E"===t)if(e+=n(),t=U[G],("+"===t||"-"===t)&&(e+=n()),t=U[G],o(t))for(e+=n();B>G&&(t=U[G],o(t));)e+=n();else x("unexpected token");return B>G&&(t=U[G],c(t)&&x("unexpected token")),H=parseFloat(e),$.NUMBER}function d(){var e,t;for(H=n();B>G&&p(U[G])&&(e=U[G],!("."===e&&B>G+1&&(t=U[G+1],"<"===t)));)H+=n();return $.NAME}function h(){var e;for(W=G;B>G&&i(U[G]);)n();if(G>=B)return q=$.EOF;switch(e=U[G]){case'"':return q=u();case":":return n(),q=$.COLON;case",":return n(),q=$.COMMA;case"(":return n(),q=$.LPAREN;case")":return n(),q=$.RPAREN;case"[":return n(),q=$.LBRACK;case"]":return n(),q=$.RBRACK;case"{":return n(),q=$.LBRACE;case"}":return n(),q=$.RBRACE;case".":if(n(),B>G){if(e=U[G],"<"===e)return n(),q=$.DOT_LT;if("."===e&&B>G+1&&"."===U[G+1])return n(),n(),q=$.REST;if(o(e))return q=f()}return q=$.DOT;case"<":return n(),q=$.LT;case">":return n(),q=$.GT;case"*":return n(),q=$.STAR;case"|":return n(),q=$.PIPE;case"?":return n(),q=$.QUESTION;case"!":return n(),q=$.BANG;case"=":return n(),q=$.EQUAL;default:return q=o(e)?f():p(e)?d():$.ILLEGAL}}function m(e,t){S(q===e,t||"consumed token not matched"),h()}function g(e){q!==e&&x("unexpected token"),h()}function v(){var e;if(m($.LPAREN,"UnionType should start with ("),e=[],q!==$.RPAREN)for(;;){if(e.push(F()),q===$.RPAREN)break;g($.PIPE)}return m($.RPAREN,"UnionType should end with )"),{type:V.UnionType,elements:e}}function y(){var e;for(m($.LBRACK,"ArrayType should start with ["),e=[];q!==$.RBRACK;){if(q===$.REST){m($.REST),e.push({type:V.RestType,expression:F()});break}e.push(F()),q!==$.RBRACK&&g($.COMMA)}return g($.RBRACK),{type:V.ArrayType,elements:e}}function b(){var e=H;return q===$.NAME||q===$.STRING?(h(),e):q===$.NUMBER?(m($.NUMBER),String(e)):void x("unexpected token")}function E(){var e;return e=b(),q===$.COLON?(m($.COLON),{type:V.FieldType,key:e,value:F()}):{type:V.FieldType,key:e,value:null}}function w(){var e;if(m($.LBRACE,"RecordType should start with {"),e=[],q===$.COMMA)m($.COMMA);else for(;q!==$.RBRACE;)e.push(E()),q!==$.RBRACE&&g($.COMMA);return g($.RBRACE),{type:V.RecordType,fields:e}}function _(){var e=H;return g($.NAME),{type:V.NameExpression,name:e}}function k(){var e=[];for(e.push(O());q===$.COMMA;)m($.COMMA),e.push(O());return e}function T(){var e,t;return e=_(),q===$.DOT_LT||q===$.LT?(h(),t=k(),g($.GT),{type:V.TypeApplication,expression:e,applications:t}):e}function L(){return m($.COLON,"ResultType should start with :"),q===$.NAME&&"void"===H?(m($.NAME),{type:V.VoidLiteral}):F()}function A(){for(var e,t=[],n=!0,r=!1;q!==$.RPAREN;)q===$.REST&&(m($.REST),r=!0),e=F(),e.type===V.NameExpression&&q===$.COLON&&(m($.COLON),e={type:V.ParameterType,name:e.name,expression:F()}),q===$.EQUAL?(m($.EQUAL),e={type:V.OptionalType,expression:e},n=!1):n||x("unexpected token"),r&&(e={type:V.RestType,expression:e}),t.push(e),q!==$.RPAREN&&g($.COMMA);return t}function P(){var e,t,n,r,i;return S(q===$.NAME&&"function"===H,"FunctionType should start with 'function'"),m($.NAME),g($.LPAREN),e=!1,n=[],t=null,q!==$.RPAREN&&(q!==$.NAME||"this"!==H&&"new"!==H?n=A():(e="new"===H,m($.NAME),g($.COLON),t=T(),q===$.COMMA&&(m($.COMMA),n=A()))),g($.RPAREN),r=null,q===$.COLON&&(r=L()),i={type:V.FunctionType,params:n,result:r},t&&(i["this"]=t,e&&(i["new"]=!0)),i}function j(){var e;switch(q){case $.STAR:return m($.STAR),{type:V.AllLiteral};case $.LPAREN:return v();case $.LBRACK:return y();case $.LBRACE:return w();case $.NAME:if("null"===H)return m($.NAME),{type:V.NullLiteral};if("undefined"===H)return m($.NAME),{type:V.UndefinedLiteral};if(e=t.save(),"function"===H)try{return P()}catch(n){e.restore()}return T();default:x("unexpected token")}}function F(){var e;return q===$.QUESTION?(m($.QUESTION),q===$.COMMA||q===$.EQUAL||q===$.RBRACE||q===$.RPAREN||q===$.PIPE||q===$.EOF||q===$.RBRACK?{type:V.NullableLiteral}:{type:V.NullableType,expression:j(),prefix:!0}):q===$.BANG?(m($.BANG),{type:V.NonNullableType,expression:j(),prefix:!0}):(e=j(),q===$.BANG?(m($.BANG),{type:V.NonNullableType,expression:e,prefix:!1}):q===$.QUESTION?(m($.QUESTION),{type:V.NullableType,expression:e,prefix:!1}):q===$.LBRACK?(m($.LBRACK),m($.RBRACK,"expected an array-style type declaration ("+H+"[])"),{type:V.TypeApplication,expression:{type:V.NameExpression,name:"Array"},applications:[e]}):e)}function O(){var e,t;if(e=F(),q!==$.PIPE)return e;for(t=[e],m($.PIPE);;){if(t.push(F()),q!==$.PIPE)break;m($.PIPE)}return{type:V.UnionType,elements:t}}function I(){var e;return q===$.REST?(m($.REST),{type:V.RestType,expression:O()}):(e=O(),q===$.EQUAL?(m($.EQUAL),{type:V.OptionalType,expression:e}):e)}function N(e,t){var n;return U=e,B=U.length,G=0,W=0,C||(U=U.split("")),h(),n=O(),t&&t.midstream?{expression:n,index:W}:(q!==$.EOF&&x("not reach to EOF"),n)}function R(e,t){var n;return U=e,B=U.length,G=0,W=0,C||(U=U.split("")),h(),n=I(),t&&t.midstream?{expression:n,index:W}:(q!==$.EOF&&x("not reach to EOF"),n)}function D(e,t,n){var r,i,o;switch(e.type){case V.NullableLiteral:r="?";break;case V.AllLiteral:r="*";break;case V.NullLiteral:r="null";break;case V.UndefinedLiteral:r="undefined";break;case V.VoidLiteral:r="void";break;case V.UnionType:for(r=n?"":"(",i=0,o=e.elements.length;o>i;++i)r+=D(e.elements[i],t),i+1!==o&&(r+="|");n||(r+=")");break;case V.ArrayType:for(r="[",i=0,o=e.elements.length;o>i;++i)r+=D(e.elements[i],t),i+1!==o&&(r+=t?",":", ");r+="]";break;case V.RecordType:for(r="{",i=0,o=e.fields.length;o>i;++i)r+=D(e.fields[i],t),i+1!==o&&(r+=t?",":", ");r+="}";break;case V.FieldType:r=e.value?e.key+(t?":":": ")+D(e.value,t):e.key;break;case V.FunctionType:for(r=t?"function(":"function (",e["this"]&&(r+=e["new"]?t?"new:":"new: ":t?"this:":"this: ",r+=D(e["this"],t),0!==e.params.length&&(r+=t?",":", ")),i=0,o=e.params.length;o>i;++i)r+=D(e.params[i],t),i+1!==o&&(r+=t?",":", ");r+=")",e.result&&(r+=(t?":":": ")+D(e.result,t));break;case V.ParameterType:r=e.name+(t?":":": ")+D(e.expression,t);break;case V.RestType:r="...",e.expression&&(r+=D(e.expression,t));break;case V.NonNullableType:r=e.prefix?"!"+D(e.expression,t):D(e.expression,t)+"!";break;case V.OptionalType:r=D(e.expression,t)+"=";break;case V.NullableType:r=e.prefix?"?"+D(e.expression,t):D(e.expression,t)+"?";break;case V.NameExpression:r=e.name;break;case V.TypeApplication:for(r=D(e.expression,t)+".<",i=0,o=e.applications.length;o>i;++i)r+=D(e.applications[i],t),i+1!==o&&(r+=t?",":", ");r+=">";break;default:x("Unknown type "+e.type)}return r}function M(e,t){return null==t&&(t={}),D(e,t.compact,t.topLevel)}var V,$,U,B,G,W,q,H;V={NullableLiteral:"NullableLiteral",AllLiteral:"AllLiteral",NullLiteral:"NullLiteral",UndefinedLiteral:"UndefinedLiteral",VoidLiteral:"VoidLiteral",UnionType:"UnionType",ArrayType:"ArrayType",RecordType:"RecordType",FieldType:"FieldType",FunctionType:"FunctionType",ParameterType:"ParameterType",RestType:"RestType",NonNullableType:"NonNullableType",OptionalType:"OptionalType",NullableType:"NullableType",NameExpression:"NameExpression",TypeApplication:"TypeApplication"},$={ILLEGAL:0,DOT:1,DOT_LT:2,REST:3,LT:4,GT:5,LPAREN:6,RPAREN:7,LBRACE:8,RBRACE:9,LBRACK:10,RBRACK:11,COMMA:12,COLON:13,STAR:14,PIPE:15,QUESTION:16,BANG:17,EQUAL:18,NAME:19,STRING:20,NUMBER:21,EOF:22},t.prototype.restore=function(){W=this._previous,G=this._index,q=this._token,H=this._value},t.save=function(){return new t(W,G,q,H)},e.parseType=N,e.parseParamType=R,e.stringify=M,e.Syntax=V}(T={}),function(e){function n(){var e=D[I];return I+=1,r(e)&&(N+=1),e}function o(){var e="";for(n();R>I&&l(D[I]);)e+=n();return e}function a(){var e,t,n=I;for(t=!1;R>n;){if(e=D[n],r(e))N+=1,t=!0;else if(t){if("@"===e)break;i(e)||(t=!1)}n+=1}return n}function s(e,t){for(var o,a,s,l=!1;t>I;){if(o=D[I],!i(o)){if("{"===o){n();break}l=!0;break}n()}if(!l){for(a=1,s="";t>I;)if(o=D[I],r(o))n();else{if("}"===o){if(a-=1,0===a){n();break}}else"{"===o&&(a+=1);s+=n()}if(0!==a)return x("Braces are not balanced");try{return f(e)?T.parseParamType(s):T.parseType(s)}catch(c){return}}}function p(e){var t;if(c(D[I])){for(t=n();e>I&&u(D[I]);)t+=n();return t}}function d(e){for(;e>I&&(i(D[I])||r(D[I]));)n()}function b(e,t,r){var i,o="";if(d(e),!(I>=e)&&(t&&"["===D[I]&&(i=!0,o=n()),c(D[I]))){if(o+=p(e),r)for(;"."===D[I];)o+=".",I+=1,o+=p(e);if(i){if("="===D[I])for(o+=n();e>I&&"]"!==D[I];)o+=n();if(I>=e||"]"!==D[I])return;o+=n()}return o}}function _(){for(;R>I&&"@"!==D[I];)n();return I>=R?!1:(S("@"===D[I]),!0)}function k(e,t){this._options=e,this._title=t,this._tag={title:t,description:null},this._options.lineNumbers&&(this._tag.lineNumber=N),this._last=0,this._extra={}}function L(e){var t,n;if(_())return t=o(),n=new k(e,t),n.parse()}function j(){var e,t,o="";for(t=!0;R>I&&(e=D[I],!t||"@"!==e);)r(e)?t=!0:t&&!i(e)&&(t=!1),o+=n();return E(o)}function F(e,t){var n,r,i,o,a,s=[];if(void 0===t&&(t={}),D="boolean"==typeof t.unwrap&&t.unwrap?w(e):e,t.tags)if(A(t.tags))for(i={},o=0,a=t.tags.length;a>o;o++)"string"==typeof t.tags[o]?i[t.tags[o]]=!0:x('Invalid "tags" parameter: '+t.tags);else x('Invalid "tags" parameter: '+t.tags);for(C||(D=D.split("")),R=D.length,I=0,N=0,M=t.recoverable,V=t.sloppy,$=t.strict,r=j();;){if(n=L(t),!n)break;(!i||i.hasOwnProperty(n.title))&&s.push(n)}return{description:r,tags:s}}var O,I,N,R,D,M,V,$;k.prototype.addError=function(e){var t=Array.prototype.slice.call(arguments,1),n=e.replace(/%(\d)/g,function(e,n){return S(ne;++e)if(r=n[e],!this[r]())return;return I=this._last,this._tag}},e.parse=F}(L={}),e.version=_,e.parse=L.parse,e.parseType=T.parseType,e.parseParamType=T.parseParamType,e.unwrapComment=w,e.Syntax=n(T.Syntax),e.Error=b,e.type={Syntax:e.Syntax,parseType:T.parseType,parseParamType:T.parseParamType,stringify:T.stringify}}("undefined"==typeof exports?doctrine={}:exports),n("doctrine/doctrine",function(){}),n("javascript/hover",["orion/objects","javascript/finder","orion/URITemplate","orion/Deferred","i18n!javascript/nls/messages","orion/i18nUtil","doctrine/doctrine"],function(e,t,n,r,i,o){function a(e,t){if(!e)return null;try{var n=Object.create(null);if(e){var r=doctrine.parse(e,{recoverable:!0,unwrap:!0});if(n.params=[],n["throws"]=[],n.see=[],n.desc=r.description?r.description:"",r.tags)for(var a=r.tags.length,l=0;a>l;l++){var c=r.tags[l];switch(c.title){case"name":c.name&&(n.name=c.name);break;case"description":null!==c.description&&(n.desc=""===n.desc?c.description:n.desc+"\n"+c.description);break;case"param":n.params.push(s(c.type)+(c.name?"__"+c.name+"__ ":"")+(c.description?c.description+"\n":""));break;case"returns":case"return":n.returns=s(c.type)+(c.description?c.description+"\n":"");break;case"since":c.description&&(n.since=c.description);break;case"callback":n.callback=c.description?c.description:"This function is used as a callback";break;case"throws":n["throws"].push(s(c.type)+(c.description?c.description+"\n":""));break;case"see":n.see.push(s(c.type)+(c.description?c.description+"\n":""));break;case"deprecated":n.deprecated=c.description?c.description+"\n":""}}}var u="";if("undefined"!=typeof n.deprecated&&(u+=o.formatMessage("__${0}__ ",i.deprecatedHoverTitle)+n.deprecated+"\n\n"),""!==n.desc&&(u+=n.desc+"\n\n"),n.params.length>0)for(u+=o.formatMessage("__${0}__\n\n",i.parametersHoverTitle),l=0;l"+n.params[l]+"\n\n";if(n.returns&&(u+=o.formatMessage("__${0}__\n\n>",i.returnsHoverTitle)+n.returns+"\n\n"),n["throws"].length>0)for(u+=o.formatMessage("__${0}__\n\n",i.throwsHoverTitle),l=0;l"+n["throws"][l]+"\n\n";if(n.callback&&(u+=o.formatMessage("__${0}__\n\n>",i.callbackHoverTitle)+n.callback+"\n\n"),n.since&&(u+=o.formatMessage("__${0}__\n\n>",i.sinceHoverTitle)+n.since+"\n\n"),n.see.length>0)for(u+=o.formatMessage("__${0}__\n\n",i.seeAlsoHoverTitle),l=0;l"+n.see[l],l0){var t=e.applications[0];return t.name?"*("+t.name+"[])* ":s(t.fields&&t.fields.length>0?t.fields[0]:t)}return s(e.expression);case"UnionType":case"ArrayType":if(e.elements&&e.elements.length>0)return s(e.elements[0]);break;case"FieldType":return s(e.value);default:return""}}function l(e,t,n,r){this.astManager=e,this.resolver=t,this.ternworker=n,this.cuprovider=r}var c;return e.mixin(l.prototype,{computeHoverInfo:function(e,n){if(n.proposal&&"js"===n.proposal.kind)return n.proposal.hover;var r=this;return e.getFileMetadata().then(function(i){if(!i)return null;if(Array.isArray(i.parents)){var o=0;i.parents.length>0&&(o=i.parents.length-1),r.resolver.setSearchLocation(i.parents[o].Location)}else r.resolver.setSearchLocation(null);return i&&"application/javascript"===i.contentType.id?r.astManager.getAST(e).then(function(e){return r._doHover(e,n,i)}):e.getText().then(function(e){var o=r.cuprovider.getCompilationUnit(function(){t.findScriptBlocks(e)},i);return o.validOffset(n.offset)?r.astManager.getAST(o.getEditorContext()).then(function(t){return r._doHover(t,n,i,e)}):null})})},_doHover:function(e,n,i,o){var s=t.findNode(n.offset,e,{parents:!0});if(s&&"Literal"===s.type){if(n.offset<=s.range[0]||n.offset>=s.range[1])return null;var l=s.parents,u=l.pop(),p=this;if("ArrayExpression"===u.type){if(u=l.pop(),"CallExpression"===u.type&&("define"===u.callee.name||"require"===u.callee.name)){var f=s.value;return p.resolver.getWorkspaceFile(f).then(function(e){return p._formatFilesHover(f,e)})}}else if("CallExpression"===u.type){var f=s.value;switch(u.callee.name){case"require":return p.resolver.getWorkspaceFile(f).then(function(e){/\.js$/.test(f)||(f+=".js");var t=p.resolver.resolveRelativeFiles(f,e,i);return t&&t.length>0?p._formatFilesHover(s.value,t):void 0});case"importScripts":var f=s.value;return p.resolver.getWorkspaceFile(f).then(function(e){/\.js$/.test(f)||(f+=".js");var t=p.resolver.resolveRelativeFiles(f,e,i);return t&&t.length>0?p._formatFilesHover(s.value,t):void 0})}}return null}c=new r;var d=[{type:"full",name:i.location,text:o?o:e.source}];return this.ternworker.postMessage({request:"documentation",args:{params:{offset:n.offset,docFormat:"full"},files:d,meta:{location:i.location}}},function(e){var t="";"documentation"===e.request&&(e.doc&&(t=a(e.doc.doc)),c.resolve(t))}),c},_formatFilesHover:function(e,t){if(e&&t){var r=null;t.length>1&&(r=o.formatMessage("###${0} '${1}'###",i.openFileForTitle,e));for(var a="",s=0;s|<|&|(\\|\\|))+",name:"punctuation.operator"},doc_block:{begin:{match:"/\\*\\*",literal:"/**"},end:{match:"\\*/",literal:"*/"},name:"comment.block.documentation",patterns:[{match:"@(?:(?!\\*/)\\S)*",name:"meta.documentation.annotation"},{match:"<[^\\s>]*>",name:"meta.documentation.tag"},{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]},number_decimal:{match:"\\b-?(?:\\.\\d+|\\d+\\.?\\d*)(?:[eE][+-]?\\d+)?\\b",name:"constant.numeric.number"},number_hex:{match:"\\b0[xX][0-9A-Fa-f]+\\b",name:"constant.numeric.hex"},string_doubleQuote:{match:'"(?:\\\\.|[^"])*"?',name:"string.quoted.double"},string_singleQuote:{match:"'(?:\\\\.|[^'])*'?",name:"string.quoted.single"},todo_comment_singleLine:{match:"(\\b)(TODO)(\\b)(.*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.line"}}}}},{id:"orion.c-like",repository:{comment_singleLine:{match:{match:"//.*",literal:"//"},name:"comment.line.double-slash",patterns:[{include:"orion.lib#todo_comment_singleLine"}]},comment_block:{begin:{match:"/\\*",literal:"/*"},end:{match:"\\*/",literal:"*/"},name:"comment.block",patterns:[{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]}}}],keywords:[]}
+}),n("orion/editor/stylers/application_javascript/syntax",["orion/editor/stylers/lib/syntax"],function(e){var t=["class","const","debugger","delete","enum","export","extends","function","implements","import","in","instanceof","interface","let","new","package","private","protected","public","static","super","typeof","var","void","with"],n=["break","case","catch","continue","default","do","else","finally","for","if","return","switch","throw","try","while","yield"],r=["this"],i=["false","null","true","undefined"],o=[];return o.push.apply(o,e.grammars),o.push({id:"orion.js",contentTypes:["application/javascript"],patterns:[{begin:"'(?:\\\\.|[^\\\\'])*\\\\$",end:"^(?:$|(?:\\\\.|[^\\\\'])*('|[^\\\\]$))",name:"string.quoted.single.js"},{begin:'"(?:\\\\.|[^\\\\"])*\\\\$',end:'^(?:$|(?:\\\\.|[^\\\\"])*("|[^\\\\]$))',name:"string.quoted.double.js"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_singleLine"},{match:"/(?![\\s\\*])(?:\\\\.|[^/])+/(?:[gim]{0,3})",name:"string.regexp.js"},{include:"orion.lib#doc_block"},{include:"orion.c-like#comment_block"},{include:"#jsFunctionDef"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#operator"},{include:"orion.lib#number_decimal"},{include:"orion.lib#number_hex"},{match:"\\b(?:"+t.join("|")+")\\b",name:"keyword.operator.js"},{match:"\\b(?:"+n.join("|")+")\\b",name:"keyword.control.js"},{match:"\\b(?:"+i.join("|")+")\\b",name:"constant.language.js"},{match:"\\b(?:"+r.join("|")+")\\b",name:"variable.language.js"}],repository:{jsFunctionDef:{begin:"(function)(\\s+[_$a-zA-Z\\xA0-\\uFFFF][_$a-zA-Z0-9\\xA0-\\uFFFF]*)?\\s*\\(",end:"\\)",captures:{1:{name:"keyword.operator.js"},2:{name:"entity.name.function.js"}},patterns:[{include:"orion.c-like#comment_singleLine"},{include:"orion.c-like#comment_block"},{match:"[^\\s,]+",name:"variable.parameter.js"}]}}}),{id:o[o.length-1].id,grammars:o,keywords:t.concat(n).concat(r).concat(i)}}),n("eslint/lib/load-rules-async",["./util","javascript/logger","javascript/finder","i18n!javascript/nls/problems","estraverse/estraverse","orion/editor/stylers/application_javascript/syntax"],function(e,t,n,r,i,o){function a(){return l}function s(){for(var e=Object.create(null),t=Object.keys(l),n=0;no;o++){var a=n[o];if(a.value===i)return a}return null}function i(e){return e&&e.type?"Literal"===e.type&&null==e.value||"Identifier"===e.type&&"undefined"===e.name:!1}return{BinaryExpression:function(o){try{if(i(o.left)||i(o.right))return;var a=o.operator,s=null;"=="===a?(s="===",e.report(o,r.eqeqeq,{0:s,1:a},n(e,o))):"!="===a&&(s="!==",e.report(o,r.eqeqeq,{0:s,1:a},n(e,o)))}catch(l){t.log(l)}}}}},"missing-doc":{description:r["missing-doc-description"],url:"http://eslint.org/docs/rules/valid-jsdoc",rule:function(e){function n(e){if(e&&e.leading){var t=e.leading.length;return t>0&&"Block"===e.leading[t-1].type}return!1}function i(i){try{var o,a;switch(i.type){case"Property":if(i.value&&"FunctionExpression"===i.value.type&&(o=e.getComments(i),o.leading.length<1&&o.trailing.length<1&&(o=e.getComments(i.key)),!n(o))){switch(i.key.type){case"Identifier":a=i.key.name;break;case"Literal":a=i.key.value}e.report(i.key,r["missing-doc"],{0:a},{type:"expr"})}break;case"FunctionDeclaration":o=e.getComments(i),o.leading.length<1&&o.trailing.length<1&&(o=e.getComments(i.id)),n(o)||e.report(i.id,r["missing-doc"],{0:i.id.name},{type:"decl"});break;case"ExpressionStatement":if(i.expression&&"AssignmentExpression"===i.expression.type){var s=i.expression;s.right&&"FunctionExpression"===s.right.type&&s.left&&"MemberExpression"===s.left.type&&(o=e.getComments(i),o.leading.length<1&&o.trailing.length<1&&(o=e.getComments(s.left)),n(o)||(a=s.left.computed===!0?s.left.property.value:s.left.property.name,e.report(s.left.property,r["missing-doc"],{0:a},{type:"expr"})))}}}catch(l){t.log(l)}}return{Property:i,FunctionDeclaration:i,ExpressionStatement:i}}},"new-parens":{description:r["new-parens-description"],url:"http://eslint.org/docs/rules/new-parens",rule:function(e){return{NewExpression:function(n){try{if(n.callee){var i=e.getTokens(n.callee,0,1);if(i&&i.length>0){var o=i[i.length-1];("Punctuator"!==o.type||"("!==o.value)&&e.report(n.callee,r["new-parens"],null,i[0])}}}catch(a){t.log(a)}}}}},"no-caller":{description:r["no-caller-description"],url:"http://eslint.org/docs/rules/no-caller",rule:function(e){return{MemberExpression:function(t){var i=n.findParentFunction(t);if(i){var o=t.object;if(!o||"arguments"!==o.name||"Identifier"!==o.type)return;var a=t.property,s=a.name?a.name:a.value;("callee"===s||"caller"===s)&&e.report(a,r["no-caller"],{0:s})}}}}},"no-comma-dangle":{description:r["no-comma-dangle-description"],url:"http://eslint.org/docs/rules/no-comma-dangle",rule:function(e){return{ObjectExpression:function(t){var n=e.getLastToken(t,1);n&&","===n.value&&e.report(t,r["no-comma-dangle"],null,n)}}}},"no-cond-assign":{description:r["no-cond-assign-description"],url:"http://eslint.org/docs/rules/no-cond-assign",rule:function(e){function t(t){var n=t.parent.type;return a[n]&&"ForStatement"!==n?"("===e.getTokenBefore(t,1).value:"("===e.getTokenBefore(t).value}function n(e){switch(e.type){case"FunctionExpression":case"ObjectExpression":case"CallExpression":case"ArrayExpression":return!0;default:return!1}}function o(o){var a=[];if(null!==o.test){o.test.parent=o,i.traverse(o.test,{enter:function(e,t){return e.range[0]>o.test.range[1]?i.VisitorOption.Break:n(e)?i.VisitorOption.Skip:(t&&(e.parent=t),void(e&&"AssignmentExpression"===e.type&&a.push(e)))}});var s=a.length;if(s>0)for(var l=0;s>l;l++){var c=a[l];t(c)||(c.range[0]=c.left.range[0],e.report(c,r["no-cond-assign"]))}}}var a={IfStatement:!0,DoWhileStatement:!0,WhileStatement:!0,ForStatement:!0};return{IfStatement:o,WhileStatement:o,ForStatement:o,DoWhileStatement:o}}},"no-console":{description:r["no-console-description"],url:"http://eslint.org/docs/rules/no-console",rule:function(e){return{MemberExpression:function(t){"console"===t.object.name&&e.env&&e.env.browser&&e.report(t.object,r["no-console"])}}}},"no-constant-condition":{description:r["no-constant-condition-description"],url:"http://eslint.org/docs/rules/no-constant-condition",rule:function(e){function t(e){switch(e.type){case"Literal":case"ObjectExpression":case"FunctionExpression":case"ArrayExpression":return!0;case"BinaryExpression":case"LogicalExpression":return t(e.left)&&t(e.right);case"UnaryExpression":return t(e.argument);default:return!1}}function n(n){n&&n.test&&t(n.test)&&e.report(n.test,r["no-constant-condition"])}return{IfStatement:n,WhileStatement:n,DoWhileStatement:n,ForStatement:n,ConditionalExpression:n}}},"no-debugger":{description:r["no-debugger-description"],url:"http://eslint.org/docs/rules/no-debugger",rule:function(e){return{DebuggerStatement:function(n){try{e.report(n,r["no-debugger"],null,e.getTokens(n)[0])}catch(i){t.log(i)}}}}},"no-dupe-keys":{description:r["no-dupe-keys-description"],url:"http://eslint.org/docs/rules/no-dupe-keys",rule:function(e){return{ObjectExpression:function(n){try{var i=n.properties;if(i&&i.length>0)for(var o=i.length,a=Object.create(null),s=0;o>s;s++){var l=i[s];if("init"===l.kind){var c=l.key.name?l.key.name:l.key.value;Object.prototype.hasOwnProperty.call(a,c)?e.report(l,r["no-dupe-keys"],{0:c},e.getTokens(l)[0]):a[c]=1}}}catch(u){t.log(u)}}}}},"no-empty-block":{description:r["no-empty-block-description"],url:"http://eslint.org/docs/rules/no-empty",rule:function(e){var n;return{Program:function(e){n=e.comments},BlockStatement:function(i){try{if(i.body.length<1){for(var o=0;o=i.range[0]&&a[1]<=i.range[1])return}e.report(i,r["no-empty-block"])}}catch(s){t.log(s)}}}}},"no-eval":{description:r["no-eval-description"],url:"http://eslint.org/docs/rules/no-eval",rule:function(e){return{CallExpression:function(n){try{var i=n.callee.name;if(!i)return;"eval"===i&&e.report(n.callee,r["no-eval"],{0:"'eval'"},e.getTokens(n.callee)[0])}catch(o){t.log(o)}}}}},"no-extra-semi":{description:r["no-extra-semi-description"],url:"http://eslint.org/docs/rules/no-extra-semi",rule:function(e){return{EmptyStatement:function(n){try{var i=e.getTokens(n),o=i[i.length-1];o&&"Punctuator"===o.type&&";"===o.value&&e.report(n,r["no-extra-semi"],null,o)}catch(a){t.log(a)}}}}},"no-fallthrough":{description:r["no-fallthrough-description"],url:"http://eslint.org/docs/rules/no-fallthrough",rule:function(n){function i(t){if(t.consequent){var n=t.consequent.slice(0);if(n.length>0&&"BlockStatement"===n[0].type){var r=n.shift();r.body.length>0&&(n=[].concat(n,r.body))}if(n.length<1)return!1;for(var i=null,o=0;o1){var o=e.cases.length;e:for(var a=0;o>a&&a+1!==o;a++)if(i(e.cases[a])){var s=e.cases[a+1];if(s.test)s.range[1]=s.test.range[1];else{var l=n.getTokens(s);l&&l.length>0&&(s.range[1]=l[0].range[1])}var c=s.leadingComments;if(!c&&s.test&&(c=s.test.leadingComments),c)for(var u=null,p=0;p0){var a=i.arguments[0];if("Literal"===a.type)n.report(i.callee,r["no-eval"],{0:"Implicit 'eval'"},n.getTokens(i.callee)[0]);else if("Identifier"===a.type){var s=n.getScope(),l=e.getDeclaration(a,s);if(l&&l.defs&&l.defs.length){var c=l.defs[0],u=c.node;"Variable"===c.type&&u&&"VariableDeclarator"===u.type&&u.init&&"Literal"===u.init.type&&n.report(i.callee,r["no-eval"],{0:"Implicit 'eval'"},n.getTokens(i.callee)[0])}}}}catch(p){t.log(p)}}}}},"no-iterator":{description:r["no-iterator-description"],url:"http://eslint.org/docs/rules/no-iterator",rule:function(e){return{MemberExpression:function(t){null!=t.property&&(t.computed?"__iterator__"===t.property.value&&e.report(t.property,r["no-iterator"]):"__iterator__"===t.property.name&&e.report(t.property,r["no-iterator"]))}}}},"no-proto":{description:r["no-proto-description"],url:"http://eslint.org/docs/rules/no-proto.html",rule:function(e){return{MemberExpression:function(t){null!=t.property&&(t.computed?"__proto__"===t.property.value&&e.report(t.property,r["no-proto"]):"__proto__"===t.property.name&&e.report(t.property,r["no-proto"]))}}}},"no-jslint":{description:r["no-jslint-description"],rule:function(e){return{Program:function(n){try{var i,o=n.comments;if(o&&(i=o.length)&&o.length>0)for(var a=0;i>a;a++){var s=o[a];if("Block"===s.type){var l=/^\s*(js[l|h]int)(\s+\w+:\w+)+/gi.exec(s.value);if(l){var c=l[1];if(c.length<1)continue;var u=2+s.value.indexOf(c)+s.range[0],p=u+c.length;e.report({type:"BlockComment",range:[u,p],loc:s.loc},r["no-jslint"],{0:c})}}}}catch(f){t.log(f)}}}}},"no-new-array":{description:r["no-new-array-description"],rule:function(e){function t(t){var n=t.callee;if(n&&"Array"===n.name){var i=t.arguments;i.length>1?e.report(n,r["no-new-array"]):1===i.length&&"Literal"===i[0].type&&"number"!=typeof i[0].value&&e.report(n,r["no-new-array"])}}return{NewExpression:t,CallExpression:t}}},"no-new-func":{description:r["no-new-func-description"],url:"http://eslint.org/docs/rules/no-new-func",rule:function(e){return{NewExpression:function(t){var n=t.callee;n&&"Function"===n.name&&e.report(n,r["no-new-func"])}}}},"no-new-object":{description:r["no-new-object-description"],url:"http://eslint.org/docs/rules/no-new-object",rule:function(e){return{NewExpression:function(t){var n=t.callee;n&&"Object"===n.name&&e.report(n,r["no-new-object"])}}}},"no-new-wrappers":{description:r["no-new-wrappers-description"],url:"http://eslint.org/docs/rules/no-new-wrappers",rule:function(e){var t=["String","Number","Math","Boolean","JSON"];return{NewExpression:function(n){var i=n.callee;i&&t.indexOf(i.name)>-1&&e.report(i,r["no-new-wrappers"],[i.name])}}}},"no-with":{description:r["no-with-description"],url:"http://eslint.org/docs/rules/no-with",rule:function(e){return{WithStatement:function(t){e.report(t,r["no-with"],null,e.getFirstToken(t))}}}},"missing-nls":{description:r["missing-nls-description"],rule:function(e){function t(t,n){var i=Object.create(null);i.indexOnLine=n,e.report(t,r["missing-nls"],{0:t.value,data:i})}function n(e,t){for(var n=0;n0){if("use strict"===t.value.toLowerCase())return;if(/^(?:[\.,-\/#!$%\^&\*;:{}=\-_`~()@\+\?><\[\]\+])$/.test(t.value))return;if(/^(?:==|!=|===|!==|=>)$/.test(t.value))return;if(t.parent)switch(t.parent.type){case"UnaryExpression":case"MemberExpression":case"SwitchCase":return;case"BinaryExpression":if("+"!==t.parent.operator)return;break;case"Property":if(t.parent.key===t)return;var n=t.parent.parent.parent;if(n&&"CallExpression"===n.type&&n.callee&&"define"===n.callee.name)return;break;case"NewExpression":case"CallExpression":var r=t.parent.callee;if(r){if("MemberExpression"===r.type&&r.property&&i[r.property.name])return;if(i[r.name])return}break;case"ArrayExpression":if(n=t.parent.parent,"CallExpression"===n.type&&("define"===n.callee.name||"require"===n.callee.name||"requirejs"===n.callee.name))return}var o=t.loc.end.line-1;e._linesWithStringLiterals[o]||(e._linesWithStringLiterals[o]=[]),e._linesWithStringLiterals[o].push(t)}},Program:function(){e._linesWithStringLiterals={}},"Program:exit":function(){if(e._linesWithStringLiterals)for(var n in e._linesWithStringLiterals)if(e._linesWithStringLiterals.hasOwnProperty(n)){var r=e.getSourceLines()[n],i=e._linesWithStringLiterals[n];if(i){for(var o,a=/\/\/\$NON-NLS-([0-9])+\$/g,s=[];null!=(o=a.exec(r));)s.push(o[1]);for(var l=0;l-1&&e.report(i.key,r["no-reserved-keys"])}}}}},"no-shadow":{description:r["no-shadow-description"],url:"http://eslint.org/docs/rules/no-shadow",rule:function(n){function i(e,t){t.variables.forEach(function(n){var r=n.name;n.defs.length&&(Object.prototype.hasOwnProperty.call(e,r)||(e[n.name]=t))})}function o(t){for(var n=t.upper,r=Object.create(null);n&&!n._symbols;)n=n.upper;return n&&e.mixin(r,n._symbols),i(r,t),t._symbols=r,r}function a(e,t){n.report(e,r["no-shadow"],{0:t})}function s(e){return e.defs.some(function(e){return"Parameter"===e.type})}function l(e){try{var r=n.getScope();if("FunctionExpression"===e.type&&e.id&&e.id.name&&(r=r.upper,"global"===r.type))return;var i=o(r);r.variables.forEach(function(e){if(e.defs.length){var t;(t=i[e.name])&&t!==r&&!s(e)&&a(e.defs[0].name,e.name)}})}catch(l){t.log(l)}}return{Program:l,FunctionDeclaration:l,FunctionExpression:l,ArrowFunctionExpression:l}}},"no-shadow-global":{description:r["no-shadow-global-description"],rule:function(e){function t(t){var i=e.env?e.env:{};switch(i.builtin=!0,t.type){case"VariableDeclarator":i[n.findESLintEnvForMember(t.id.name)]&&e.report(t.id,r["no-shadow-global"],{0:t.id.name});break;case"FunctionExpression":case"FunctionDeclaration":case"ArrowFunctionExpression":t.params.forEach(function(t){"Identifier"===t.type&&i[n.findESLintEnvForMember(t.name)]&&e.report(t,r["no-shadow-global-param"],{0:t.name,nls:"no-shadow-global-param"})})}}return{FunctionExpression:t,FunctionDeclaration:t,ArrowFunctionExpression:t,VariableDeclarator:t}}},"no-sparse-arrays":{description:r["no-sparse-arrays-description"],url:"http://eslint.org/docs/rules/no-sparse-arrays",rule:function(e){return{ArrayExpression:function(t){t.elements.indexOf(null)>-1&&e.report(t,r["no-sparse-arrays"])}}}},"no-throw-literal":{description:r["no-throw-literal-description"],url:"http://eslint.org/docs/rules/no-throw-literal",rule:function(e){return{ThrowStatement:function(n){try{var i=n.argument;switch(i.type){case"Identifier":if("undefined"!==i.name)return;case"Literal":case"ObjectExpression":case"ArrayExpression":e.report(i,r["no-throw-literal"])}}catch(o){t.log(o)}}}}},"no-undef":{description:r["no-undef-description"],url:"http://eslint.org/docs/rules/no-undef",rule:function(e){function i(e){return e.defs.every(function(e){return"ImplicitGlobalVariable"===e.type})}function o(e,t){var n=null;return e.variables.some(function(e){return e.name!==t.identifier.name||i(e)&&!Object.hasOwnProperty.call(e,"writeable")?!1:(n=e,!0)}),n}return{Program:function(){try{var i=e.getScope();i.through.forEach(function(t){var a=o(i,t),s=t.identifier.name;if(a)t.isWrite()&&a.writeable===!1&&e.report(t.identifier,r["no-undef-readonly"],{0:s,nls:"no-undef-readonly"});else{var l=n.findESLintEnvForMember(s),c=l?"-inenv":"",u="no-undef-defined";e.report(t.identifier,r["no-undef-defined"],{0:s,nls:u,pid:u+c})}})}catch(a){t.log(a)}}}}},"no-undef-init":{description:r["no-undef-init-description"],url:"http://eslint.org/docs/rules/no-undef-init.html",rule:function(e){return{VariableDeclarator:function(t){t.init&&"Identifier"===t.init.type&&"undefined"===t.init.name&&e.report(t.init,r["no-undef-init"])}}}},"no-unreachable":{description:r["no-unreachable-description"],url:"http://eslint.org/docs/rules/no-unreachable",rule:function(n){function i(e){switch(e.type){case"FunctionDeclaration":case"VariableDeclaration":return!0}return!1}function o(o){try{var a=0;for(a;an;n++){var r=e.leadingComments[n];if("Block"===r.type&&/\s*(?:@callback)\s+/.test(r.value))return!0}return!1}function i(i){try{var o=e.getScope(),a=o.childScopes;o.functionExpressionScope&&a&&a.length&&(o=a[0]),o.variables.forEach(function(t){if(t.defs.length&&"Parameter"===t.defs[0].type){var o=t.defs[0].name;if(!t.references.length){var a="no-unused-params";if("FunctionExpression"===i.type){if(a+="-expr",n(i)||i.params&&i.params.length>0&&n(i.params[0]))return;var s=i.parent;switch(s.type){case"Property":if(n(s)||n(s.key))return;break;case"MemberExpression":if(s=s.parent,"CallExpression"===s.type&&n(s))return;break;case"AssignmentExpression":var l=s.left;if("MemberExpression"===l.type){if(n(l))return}else if("Identifier"===l.type&&n(l))return;break;case"VariableDeclarator":if(n(s.id))return}}else"ArrowFunctionExpression"===i.type&&(a+="-arrow");e.report(o,r["no-unused-params"],{0:o.name,pid:a})}}})}catch(s){t.log(s)}}return{FunctionDeclaration:i,FunctionExpression:i,ArrowFunctionExpression:i}}},"no-unused-vars":{description:r["no-unused-vars-description"],url:"http://eslint.org/docs/rules/no-unused-vars",rule:function(e){function n(e){return e.isRead()}function i(e,t){var n=t.references;return"global"===e.type&&(n=n.concat(e.through.filter(function(e){return e.identifier.name===t.name}))),n}function o(){try{var o=e.getScope();o.variables.forEach(function(t){if(t.defs.length&&"Parameter"!==t.defs[0].type){var a=t.defs[0].node,s=i(o,t),l=a.id;s.length?s.some(n)||e.report(l,r["no-unused-vars-unread"],{0:l.name,nls:"no-unused-vars-unread"}):"FunctionDeclaration"===a.type?e.report(l,r["no-unused-vars-unused-funcdecl"],{0:l.name,nls:"no-unused-vars-unused-funcdecl"}):e.report(l,r["no-unused-vars-unused"],{0:l.name,nls:"no-unused-vars-unused"})}})}catch(a){t.log(a)}}return{Program:o,FunctionDeclaration:o,FunctionExpression:o,ArrowFunctonExpression:o}}},"no-use-before-define":{description:r["no-use-before-define-description"],url:"http://eslint.org/docs/rules/no-use-before-define",rule:function(n){function i(e,t){return"boolean"==typeof e?e:t}function o(){try{var i=n.getScope();i.references.forEach(function(t){var o,a=e.getDeclaration(t,i),c=t.identifier,u=c.name;if(a&&(o=a.defs).length&&c.range[0]-1&&("Literal"!==a.type||t.indexOf(a.value)<0)&&e.report(a,r["valid-typeof"])}}}}}};return{getRules:a,getESLintRules:s}}),n("javascript/signatures",[],function(){var e={computeSignature:function(e){if(e){if(e.sig)return e.sig;var t=this.getNameFrom(e);return{sig:t.name,details:t.details,range:this.getSignatureSourceRangeFrom(e)}}return null},getParamsFrom:function(e){if(e){var t=e.params;if(t&&t.length>0){for(var n=t.length,r="",i=0;n>i;i++)r+=t[i].name?t[i].name:"Object",n-1>i&&(r+=", ");return r}}},getPropertyListFrom:function(e,t){if(t||(t=50),0>t&&(t=0),e){var n=e.properties;if(n&&n.length>0){for(var r,i=n.length,o="{",a=0;i>a;a++){if(r=n[a].key&&n[a].key.name?n[a].key.name:"Object",o.length+r.length>t+1){o+="...";break}o+=r,i-1>a&&(o+=", ")}return o+="}"}}return"{...}"},getNameFrom:function(e){var t,n="Anonyous "+e.type;if(e&&e.type)if("FunctionDeclaration"===e.type){if(e.id&&e.id.name){n=e.id.name+"(";var r=this.getParamsFrom(e);r&&(n+=r),n+=")"}}else if("FunctionExpression"===e.type){n="function(";var i=this.getParamsFrom(e);i&&(n+=i),n+=")"}else if("ObjectExpression"===e.type)n="closure ",t=this.getPropertyListFrom(e);else if("Property"===e.type){if(e.value)if("FunctionExpression"===e.value.type){e.key?e.key.name?n=e.key.name+"(":e.key.value&&(n=e.key.value+"("):n="function(";var o=this.getParamsFrom(e.value);o&&(n+=o),n+=")"}else"ObjectExpression"===e.value.type?e.key&&(e.key.name?n=e.key.name+" ":e.key.value&&(n=e.key.value+" "),t=this.getPropertyListFrom(e.value)):e.key&&(e.key.name?n=e.key.name:e.key.value&&(n=e.key.value))}else if("VariableDeclarator"===e.type){if(e.init)if("ObjectExpression"===e.init.type)e.id&&e.id.name&&(n="var "+e.id.name+" = ",t=this.getPropertyListFrom(e.init));else if("FunctionExpression"===e.init.type)if(e.id&&e.id.name){n=e.id.name+"(";var a=this.getParamsFrom(e.init);a&&(n+=a),n+=")"}else n=this.getNameFrom(e.init)}else if("AssignmentExpression"===e.type){if(e.left&&e.right){var s="ObjectExpression"===e.right.type;if(s||"FunctionExpression"===e.right.type)if(e.left.name?n=e.left.name:"MemberExpression"===e.left.type&&(n=this.expandMemberExpression(e.left,"")),n)if(s)n+=" ",t=this.getPropertyListFrom(e.right);else{n+="(";var l=this.getParamsFrom(e.right);l&&(n+=l),n+=")"}else n=this.getNameFrom(e.right)}}else"ReturnStatement"===e.type&&e.argument&&("ObjectExpression"===e.argument.type||"FunctionExpression"===e.argument.type)&&(n="return ",t=this.getPropertyListFrom(e.argument));return{name:n,details:t}},expandMemberExpression:function(e,t){if("MemberExpression"===e.type){if(e.property){var n=e.property.name;"Literal"===e.property.type&&(n=e.property.value),n&&(t=t&&t.length>0?n+"."+t:n)}return e.object&&e.object.name&&(t=e.object.name+"."+t),this.expandMemberExpression(e.object,t)}return t},getSignatureSourceRangeFrom:function(e){var t=[0,0];return e&&("AssignmentExpression"===e.type?e.left&&e.left.range&&(t=e.left.range):"Property"===e.type?e.key&&e.key.range&&(t=e.key.range):"ReturnStatement"===e.type?(t[0]=e.range[0],t[1]=t[0]+6):e.id&&e.id.range?t=e.id.range:e.range&&(t=e.range,"FunctionExpression"===e.type&&(t[1]=t[0]+8)),t[0]<1&&(t[0]=1)),t}};return e}),n("javascript/util",[],function(){function e(e){return e.length<1?!1:isNaN(e.charCodeAt(0))?!1:e.toLocaleUpperCase().charAt(0)===e.charAt(0)}function t(e,t){if("string"!=typeof e||"string"!=typeof t)return!1;if(0===e.length)return!0;if(e.charAt(0).toLowerCase()!==t.charAt(0).toLowerCase())return!1;if(n(t,e))return!0;var i=t.toLowerCase();if(n(i,e))return!0;var o=e.toLowerCase();if(e===o)return!1;if(n(i,o))return!0;var a=r(e),s=r(t);if(a.length>s.length)return!1;for(var l=0;l=0;--r)e(t.charAt(r))&&(n.push(t.substring(r)),t=t.substring(0,r));return 0!==t.length&&n.push(t),n.reverse()}return{isUpperCase:e,looselyMatches:t,startsWith:n,toCamelCaseParts:r}}),n("javascript/contentAssist/sigparser",[],function(){function e(e){this.start=e,this.end=-1}function t(e){return")"===e||":"===e||"{"===e||"}"===e||"["===e||"]"===e||","===e||"|"===e}function n(e){for(var t=e.charAt(f);/\s/.test(t)&&f0?r:(f++,i);if("-"===i){if(">"===e.charAt(f+1))return f+=2,"->"}else{if("("===i)return"fn"===r?(r+=i,f++,r):i;if("|"===i)return r;""===i?f++:(r+=i,f++,i=e.charAt(f))}}return r}function i(t){var n=r(t),i=new e(d);if("fn("===n){var o=[];")"!==t.charAt(f)&&a(t,o),r(t);var l=s(t);return i.finishFunction(t.substring(i.start,f),l,o)}return null}function o(e){var t;return t="f"===e.charAt(f)&&"n"===e.charAt(f+1)&&"("===e.charAt(f+2)?i(e):l(e),"|"===e.charAt(f)&&(t=c(t,e)),t}function a(t,i){var s=r(t),l=new e(d),c=r(t);":"===c&&(n(t),i.push(l.finishParam(s,o(t))),n(t),","===t.charAt(f)&&(r(t),a(t,i)))}function s(e){return n(e),"-"===e.charAt(f)&&">"===e.charAt(f+1)?(r(e),n(e),o(e)):null}function l(n){var i=r(n),a=new e(d);if(t(i)){if("{"===i){var s=n.charAt(f);if("}"===s)return r(n),a.finishObject(n.substring(a.start,f),[]);for(var l=[];"}"!==s&&f-1)return o;if("@"===a)return"@";for(;i>=0&&/\S/.test(a);){if(o=a+o,"@"===a)return o;if(i--,a=n.charAt(i),"{*,".indexOf(a)>-1)return o}return o}return r}function g(e,t,n){var i=r.findComment(t,e);if(i)switch(i.type){case"Block":var o=i.range[0];if("/"===n.charAt(o)&&"*"===n.charAt(o+1)){if("*"===n.charAt(o+2)&&t>o+2)return{kind:"jsdoc",node:i};if(t>o+1)return{kind:"doc",node:i}
+}break;case"Line":return{kind:"linedoc",node:i};default:return null}if(i=r.findNode(t,e,{parents:!0}),i&&i.parents&&i.parents.length>0){var a=i.parents.pop();switch(a.type){case"MemberExpression":return{kind:"member"};case"Program":case"BlockStatement":break;case"VariableDeclarator":if(!a.init||t=a.value.range[0]&&t-1<=a.value.range[1]?{kind:"prop"}:null;case"SwitchStatement":return{kind:"swtch"}}}return{kind:"top"}}function v(t,i,o,a,c){var p=[];if(!i)return p;if("jsdoc"===i.kind){var d=t.offset>t.prefix.length?t.offset-t.prefix.length-1:0;switch(a.charAt(d)){case"{":p=[];break;case".":return[];case"*":case" ":var h=r.findNodeAfterComment(i.node,o);if(h){var m;if(null!==(m=/\s*\*\s*\@name\s*(\w*)/gi.exec(t.line))){if(m[1]===t.prefix){var g=y(h);g&&p.push({proposal:g,relevance:100,name:g,description:e.funcProposalDescription,style:"emphasis",overwrite:!0,kind:"js"})}}else if(null!==(m=/\s*\*\s*\@param\s*(?:\{\w*\})?\s*(\w*)/gi.exec(t.line))&&m[1]===t.prefix){var v=b(h);if(Array.isArray(v))for(var x=0;x0){var n=e.declarations[0];if(n.init&&"FunctionExpression"===n.init.type)return n.init.id?n.init.id.name:n.id.name}}return null}function b(e){switch(e.type){case"FunctionDeclaration":return e.params;case"Property":if("FunctionExpression"===e.value.type)return e.value.params;break;case"ExpressionStatement":var t=e.expression;if(t&&"AssignmentExpression"===t.type&&"FunctionExpression"===t.right.type)return t.right.params;break;case"VariableDeclaration":if(e.declarations.length>0){var n=e.declarations[0];if(n.init&&"FunctionExpression"===n.init.type)return n.init.params}}return[]}function x(e,t,n,r){this.astManager=e,this.ternworker=t,this.pluginenvs=n,this.cuprovider=r,this.timeout=null}function S(e){var t=e;switch(e){case"do":t="do...while";break;case"in":t="for...in";break;case"try":case"catch":case"finally":t="try...catch";break;case"case":case"default":t="switch";break;case"if":case"else":t="if...else"}return L[e]?"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/"+t:"extends"===e?"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/"+t:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/"+t}function E(t,n){var r={relevance:100,style:"emphasis",overwrite:!0,kind:"js"};if(r.name=r.proposal=t.name,"undefined"!=typeof t.type)if(/^fn/.test(t.type))w(t,n,r);else{if("template"===t.type){var o=new i.Template(n.params.prefix,t.description,t.template,t.name),s=o.getProposal(n.params.prefix,n.params.offset,{}),l=Object.create(null);return l.type="markdown",l.content=e.templateHoverHeader,l.content+=s.proposal,s.hover=l,T.removePrefix(n.params.prefix,s),s.style="emphasis",s.kind="js",s}r.description=_(" : "+t.type)}else t.isKeyword?(r.relevance-=2,r.description=e.keywordProposalDescription,r.isKeyword=!0,t.doc=e.keywordHoverProposal,t.url=S(r.name)):r.description="";if(l=Object.create(null),l.type="markdown",l.content="",t.doc){var c=a.formatMarkdownHover(t.doc);l.content+=c?c.content:r.name}else l.content+=r.name;return t.url&&(l.content+=f.formatMessage.call(null,e.onlineDocumentationProposalEntry,t.url)),r.hover=l,r}function w(e,t,n){var r=[];n.relevance+=5;var i=p.parse(e.type);n.description=i.ret?i.ret.value?_(" : "+i.ret.value):i.ret.ret?" : function":"":"";var o=e.name+"(",a=i.params;if(a)for(var s=0;s0&&(n.positions=r)}function _(e){return e.replace(/:\s*\?/g,": any")}function k(e){var t=/([^/.]+\/[^\/]+)$/g.exec(e);return t?t[1]:(t=/\/([^\/]+)$/g.exec(e),t?t[1]:e)}function C(t,n){for(var r=n.envs?n.envs:{},i=Object.create(null),o=Object.create(null),a=[],s=[],l=0;l0&&(s.sort(A),s.splice(0,0,{proposal:"",description:e.keywordAssistHeader,style:"noemphasis_title",unselectable:!0}),h=h.concat(s)),m=Object.keys(i),l=0;l",isValid:function(e,t,n){var r=t.charAt(n-e.length-1);return!r||-1===this.uninterestingChars.indexOf(r)},getTemplateProposals:function(t,n,r,i){for(var a=[],s=i?i.kind:null,l=o.getTemplatesForKind(s),c=0;ct.name?1:0}),a.splice(0,0,{proposal:"",description:e.templateAssistHeader,style:"noemphasis_title",unselectable:!0})),a},templateMatches:function(e,t,n,r){if(e.match(t)){if("undefined"!=typeof r.line){var i=r.line.length-("undefined"!=typeof t?t.length:0),o=r.line.slice(0,i>-1?i:0).trim();if(n&&"jsdoc"===n.kind)return!/^[\/]?[\*]+\s*[@]/gi.test(o)}if(n&&"doc"===n.kind){var a=n.node.value.trim();if(a){var s=r.offset-t.length-n.node.range[0];if(s>-1){var l=/^(eslint-\w+|eslint?)(\s|$)/gi.exec(a.slice(0,s));if(l)return!1}}}return!0}return!1}});var T=new d;n.mixin(x.prototype,{initialize:function(){},computeContentAssist:function(e,t){var n=this;return e.getFileMetadata().then(function(i){return"text/html"===i.contentType.id?e.getText().then(function(e){var o=n.cuprovider.getCompilationUnit(function(){return r.findScriptBlocks(e)},i);return o.validOffset(t.offset)?n.astManager.getAST(o.getEditorContext()).then(function(r){return n.pluginenvs().then(function(o){return n.doAssist(r,t,i,{ecma5:!0,ecma6:!0,browser:!0},o,e)})}):[]}):n.astManager.getAST(e).then(function(e){return n.pluginenvs().then(function(r){return n.doAssist(e,t,i,{ecma5:!0,ecma6:!0},r)})})})},doAssist:function(e,n,r,i,o,a){var s=g(e,n.offset,e.source);n.prefix=m(n,s,e.source);var l=[].concat(v(n,s,e,e.source,o),h(n,s,e.source));if(!s||"jsdoc"!==s.kind&&"doc"!==s.kind&&"linedoc"!==s.kind){var c=this.getActiveEnvironments(e,i),u=[{type:"full",name:r.location,text:a?a:e.source}];"undefined"==typeof n.keywords&&(n.keywords=!0);var p={params:n,meta:r,envs:c,files:u},f=new t;f.proposals=l,f.args=p;var d=this;return this.ternworker.postMessage({request:"completions",args:p},function(e){clearTimeout(d.timeout),f.resolve(f.proposals?[].concat(C(e.proposals?e.proposals:[],f.args),f.proposals):C(e.proposals,f.args))}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){f&&f.resolve(n.timeoutReturn?n.timeoutReturn:[]),this.timeout=null},n.timeout?n.timeout:5e3),f}return(new t).resolve(l)},getActiveEnvironments:function(e,t){var r=Object.create(null);if(n.mixin(r,t),e.comments)for(var i=0;it.relevance)return-1;if(t.relevance>e.relevance)return 1;var n=e.name,r=t.name;return r>n?-1:n>r?1:0};return{TernContentAssist:x}}),n("esrecurse/esrecurse",[],function(){"use strict";function e(e){return null==e?!1:"object"==typeof e&&"string"==typeof e.type}function n(e,t){return(e===a.Syntax.ObjectExpression||e===a.Syntax.ObjectPattern)&&"properties"===t}function r(e){this.__visitor=e}var i,o,a=t("estraverse/estraverse");return i=Array.isArray,i||(i=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),o=Object.keys||function(e){var t,n=[];for(t in e)n.push(t);return n},r.prototype.visitChildren=function(t){var r,i,s,l,c,u,p;if(null!=t)for(r=t.type||a.Syntax.Property,i=a.VisitorKeys[r],i||(i=o(t)),s=0,l=i.length;l>s;++s)if(p=t[i[s]])if(Array.isArray(p))for(c=0,u=p.length;u>c;++c)p[c]&&(e(p[c])||n(r,i[s]))&&this.visit(p[c]);else e(p)&&this.visit(p)},r.prototype.visit=function(e){var t;if(null!=e)return t=e.type||a.Syntax.Property,this.__visitor[t]?void this.__visitor[t].call(this,e):void this.visitChildren(e)},{version:"1.2.0",Visitor:r,visit:function(e,t){var n=new r(t);n.visit(e)}}}),n("escope/escope",["esrecurse/esrecurse","estraverse/estraverse","orion/objects"],function(e,t,n){"use strict";function r(e,t){e.prototype=Object.create(t.prototype),e._super=t}function i(e,t){if(!e)throw new Error(t)}function o(){return{optimistic:!1,directive:!1,sourceType:"script",ecmaVersion:5}}function a(e,t){function n(e){return"object"==typeof e&&e instanceof Object&&!(e instanceof RegExp)}var r,i;for(r in t)t.hasOwnProperty(r)&&(i=t[r],n(i)?n(e[r])?a(e[r],i):e[r]=a({},i):e[r]=i);return e}function s(e,t,n,r,i,o){this.identifier=e,this.from=t,this.tainted=!1,this.resolved=null,this.flag=n,this.isWrite()&&(this.writeExpr=r,this.partial=o),this.__maybeImplicitGlobal=i}function l(e,t){this.name=e,this.identifiers=[],this.references=[],this.defs=[],this.tainted=!1,this.stack=!0,this.scope=t}function c(e,t,n,r){var i,o,a,s,l;if(e.upper&&e.upper.isStrict)return!0;if(t.type===y.ArrowFunctionExpression)return!0;if(n)return!0;if("class"===e.type||"module"===e.type)return!0;if("block"===e.type||"switch"===e.type)return!1;if("function"===e.type)i=t.body;else{if("global"!==e.type)return!1;i=t}if(r){for(o=0,a=i.body.length;a>o&&(s=i.body[o],"DirectiveStatement"===s.type);++o)if('"use strict"'===s.raw||"'use strict'"===s.raw)return!0}else for(o=0,a=i.body.length;a>o&&(s=i.body[o],s.type===y.ExpressionStatement)&&(l=s.expression,l.type===y.Literal&&"string"==typeof l.value);++o)if(null!=l.raw){if('"use strict"'===l.raw||"'use strict'"===l.raw)return!0}else if("use strict"===l.value)return!0;return!1}function u(e,t){var n;e.scopes.push(t),n=e.__nodeToScope.get(t.block),n?n.push(t):e.__nodeToScope.set(t.block,[t])}function p(e,t,n,r){this.type=r===E?"TDZ":r===x?"module":t.type===y.BlockStatement?"block":t.type===y.SwitchStatement?"switch":t.type===y.FunctionExpression||t.type===y.FunctionDeclaration||t.type===y.ArrowFunctionExpression?"function":t.type===y.CatchClause?"catch":t.type===y.ForInStatement||t.type===y.ForOfStatement||t.type===y.ForStatement?"for":t.type===y.WithStatement?"with":t.type===y.ClassExpression||t.type===y.ClassDeclaration?"class":"global",this.set=new Map,this.taints=new Map,this.dynamic="global"===this.type||"with"===this.type,this.block=t,this.through=[],this.variables=[],this.references=[],this.variableScope="global"===this.type||"function"===this.type||"module"===this.type?this:e.__currentScope.variableScope,this.functionExpressionScope=!1,this.directCallToEvalScope=!1,this.thisFound=!1,this.__left=[],r===S?(this.__define(t.id,{type:l.FunctionName,name:t.id,node:t}),this.functionExpressionScope=!0):("function"===this.type&&this.block.type!==y.ArrowFunctionExpression&&this.__defineArguments(),t.type===y.FunctionExpression&&t.id&&e.__nestFunctionExpressionNameScope(t,n)),this.upper=e.__currentScope,this.isStrict=c(this,t,n,e.__useDirective()),this.childScopes=[],e.__currentScope&&e.__currentScope.childScopes.push(this),e.__currentScope=this,"global"===this.type&&(e.globalScope=this,e.globalScope.implicit={set:new Map,variables:[],left:[]}),u(e,this)}function f(e){this.scopes=[],this.globalScope=null,this.__nodeToScope=new WeakMap,this.__currentScope=null,this.__options=e}function d(e,n){t.traverse(e,{enter:function(e,t){var r,i,o,a;switch(e.type){case y.Identifier:null===t&&n(e,!0);break;case y.SpreadElement:e.argument.type===y.Identifier&&n(e.argument,!1);break;case y.ObjectPattern:for(r=0,i=e.properties.length;i>r;++r)a=e.properties[r],a.shorthand?n(a.key,!1):a.value.type!==y.Identifier||n(a.value,!1);break;case y.ArrayPattern:for(r=0,i=e.elements.length;i>r;++r)o=e.elements[r],o&&o.type===y.Identifier&&n(o,!1)}}})}function h(e){var t=e.type;return t===y.Identifier||t===y.ObjectPattern||t===y.ArrayPattern||t===y.SpreadElement}function m(t,n){e.Visitor.call(this,this),this.declaration=t,this.referencer=n}function g(t){e.Visitor.call(this,this),this.scopeManager=t,this.parent=null,this.isInnerMethodDefinition=!1}function v(e,t){var n,r,s;return s=a(o(),t),n=new f(s),r=new g(n),r.visit(e),i(null===n.__currentScope),n}var y=t.Syntax;s.READ=1,s.WRITE=2,s.RW=s.READ|s.WRITE,s.prototype.isStatic=function(){return!this.tainted&&this.resolved&&this.resolved.scope.isStatic()},s.prototype.isWrite=function(){return!!(this.flag&s.WRITE)},s.prototype.isRead=function(){return!!(this.flag&s.READ)},s.prototype.isReadOnly=function(){return this.flag===s.READ},s.prototype.isWriteOnly=function(){return this.flag===s.WRITE},s.prototype.isReadWrite=function(){return this.flag===s.RW},l.CatchClause="CatchClause",l.Parameter="Parameter",l.FunctionName="FunctionName",l.ClassName="ClassName",l.Variable="Variable",l.ImportBinding="ImportBinding",l.TDZ="TDZ",l.ImplicitGlobalVariable="ImplicitGlobalVariable";var b=0,x=1,S=2,E=3;return p.prototype.__close=function(e){var t,n,r,i,o,a;if(!this.dynamic||e.__isOptimistic())for(t=0,n=this.__left.length;n>t;++t)r=this.__left[t],this.__resolve(r)||this.__delegateToUpperScope(r);else if("with"===this.type)for(t=0,n=this.__left.length;n>t;++t)r=this.__left[t],r.tainted=!0,this.__delegateToUpperScope(r);else for(t=0,n=this.__left.length;n>t;++t){r=this.__left[t],i=this;do i.through.push(r),i=i.upper;while(i)}if("global"===this.type){for(o=[],t=0,n=this.__left.length;n>t;++t)r=this.__left[t],r.__maybeImplicitGlobal&&!this.set.has(r.identifier.name)&&o.push(r.__maybeImplicitGlobal);for(t=0,n=o.length;n>t;++t)a=o[t],this.__defineImplicit(a.pattern,{type:l.ImplicitGlobalVariable,name:a.pattern,node:a.node});this.implicit.left=this.__left}this.__left=null,e.__currentScope=this.upper},p.prototype.__resolve=function(e){var t,n;return n=e.identifier.name,this.set.has(n)?(t=this.set.get(n),t.references.push(e),t.stack=t.stack&&e.from.variableScope===this.variableScope,e.tainted&&(t.tainted=!0,this.taints.set(t.name,!0)),e.resolved=t,!0):!1},p.prototype.__delegateToUpperScope=function(e){this.upper&&this.upper.__left.push(e),this.through.push(e)},p.prototype.__defineGeneric=function(e,t,n,r,i){var o;o=t.get(e),o||(o=new l(e,this),t.set(e,o),n.push(o)),i&&o.defs.push(i),r&&o.identifiers.push(r)},p.prototype.__defineArguments=function(){this.__defineGeneric("arguments",this.set,this.variables),this.taints.set("arguments",!0)},p.prototype.__defineImplicit=function(e,t){e&&e.type===y.Identifier&&this.__defineGeneric(e.name,this.implicit.set,this.implicit.variables,e,t)},p.prototype.__define=function(e,t){e&&e.type===y.Identifier&&this.__defineGeneric(e.name,this.set,this.variables,e,t)},p.prototype.__referencing=function(e,t,n,r,i){var o;e&&e.type===y.Identifier&&(o=new s(e,this,t||s.READ,n,r,!!i),this.references.push(o),this.__left.push(o))},p.prototype.__detectEval=function(){var e;e=this,this.directCallToEvalScope=!0;do e.dynamic=!0,e=e.upper;while(e)},p.prototype.__detectThis=function(){this.thisFound=!0},p.prototype.__isClosed=function(){return null===this.__left},p.prototype.resolve=function(e){var t,n,r;for(i(this.__isClosed(),"scope should be closed"),i(e.type===y.Identifier,"target should be identifier"),n=0,r=this.references.length;r>n;++n)if(t=this.references[n],t.identifier===e)return t;return null},p.prototype.isStatic=function(){return!this.dynamic},p.prototype.isArgumentsMaterialized=function(){var e;return"function"!==this.type?!0:this.isStatic()?(e=this.set.get("arguments"),i(e,"always have arguments variable"),e.tainted||0!==e.references.length):!0},p.prototype.isThisMaterialized=function(){return"function"!==this.type?!0:this.isStatic()?this.thisFound:!0},p.prototype.isUsedName=function(e){if(this.set.has(e))return!0;for(var t=0,n=this.through.length;n>t;++t)if(this.through[t].identifier.name===e)return!0;return!1},f.prototype.__useDirective=function(){return this.__options.directive},f.prototype.__isOptimistic=function(){return this.__options.optimistic},f.prototype.__ignoreEval=function(){return this.__options.ignoreEval},f.prototype.isModule=function(){return"module"===this.__options.sourceType},f.prototype.__get=function(e){return this.__nodeToScope.get(e)},f.prototype.acquire=function(e,t){function n(e){return"function"===e.type&&e.functionExpressionScope?!1:"TDZ"===e.type?!1:!0}var r,i,o,a;if(r=this.__get(e),!r||0===r.length)return null;if(1===r.length)return r[0];if(t){for(o=r.length-1;o>=0;--o)if(i=r[o],n(i))return i}else for(o=0,a=r.length;a>o;++o)if(i=r[o],n(i))return i;return null},f.prototype.acquireAll=function(e){return this.__get(e)},f.prototype.release=function(e,t){var n,r;return n=this.__get(e),n&&n.length?(r=n[0].upper,r?this.acquire(r.block,t):null):null},f.prototype.attach=function(){},f.prototype.detach=function(){},f.prototype.__nestScope=function(e,t){return new p(this,e,t,b)},f.prototype.__nestModuleScope=function(e){return new p(this,e,!1,x)},f.prototype.__nestTDZScope=function(e){return new p(this,e,!1,E)},f.prototype.__nestFunctionExpressionNameScope=function(e,t){return new p(this,e,t,S)},f.prototype.__isES6=function(){return this.__options.ecmaVersion>=6},r(m,e.Visitor),m.prototype.visitImport=function(e,t){var n=this;n.referencer.visitPattern(e,function(e){n.referencer.currentScope().__define(e,{type:l.ImportBinding,name:e,node:t,parent:n.declaration})})},m.prototype.ImportNamespaceSpecifier=function(e){e.id&&this.visitImport(e.id,e)},m.prototype.ImportDefaultSpecifier=function(e){this.visitImport(e.id,e)},m.prototype.ImportSpecifier=function(e){e.name?this.visitImport(e.name,e):this.visitImport(e.id,e)},r(g,e.Visitor),n.mixin(g.prototype,{currentScope:function(){return this.scopeManager.__currentScope},close:function(e){for(;this.currentScope()&&e===this.currentScope().block;)this.currentScope().__close(this.scopeManager)},pushInnerMethodDefinition:function(e){var t=this.isInnerMethodDefinition;return this.isInnerMethodDefinition=e,t},popInnerMethodDefinition:function(e){this.isInnerMethodDefinition=e},materializeTDZScope:function(e,t){this.scopeManager.__nestTDZScope(e,t),this.visitVariableDeclaration(this.currentScope(),l.TDZ,t.left,0)},materializeIterationScope:function(e){var t,n=this;this.scopeManager.__nestScope(e,!1),t=e.left,this.visitVariableDeclaration(this.currentScope(),l.Variable,t,0),this.visitPattern(t.declarations[0].id,function(t){n.currentScope().__referencing(t,s.WRITE,e.right,null,!0)})},visitPattern:function(e,t){d(e,t)},visitFunction:function(e){var t,n,r=this;for(e.type===y.FunctionDeclaration&&this.currentScope().__define(e.id,{type:l.FunctionName,name:e.id,node:e}),this.scopeManager.__nestScope(e,this.isInnerMethodDefinition),t=0,n=e.params.length;n>t;++t)this.visitPattern(e.params[t],function(n){r.currentScope().__define(n,{type:l.Parameter,name:n,node:e,index:t})});e.body.type===y.BlockStatement?this.visitChildren(e.body):this.visit(e.body),this.close(e)},visitClass:function(e){e.type===y.ClassDeclaration&&this.currentScope().__define(e.id,{type:l.ClassName,name:e.id,node:e}),this.visit(e.superClass),this.scopeManager.__nestScope(e),e.id&&this.currentScope().__define(e.id,{type:l.ClassName,name:e.id,node:e}),this.visit(e.body),this.close(e)},visitProperty:function(e){var t,n;e.computed&&this.visit(e.key),n=e.type===y.MethodDefinition||e.method,n&&(t=this.pushInnerMethodDefinition(!0)),this.visit(e.value),n&&this.popInnerMethodDefinition(t)},visitForIn:function(e){var t=this;e.left.type===y.VariableDeclaration&&"var"!==e.left.kind?(this.materializeTDZScope(e.right,e),this.visit(e.right),this.close(e.right),this.materializeIterationScope(e),this.visit(e.body),this.close(e)):(e.left.type===y.VariableDeclaration?(this.visit(e.left),this.visitPattern(e.left.declarations[0].id,function(n){t.currentScope().__referencing(n,s.WRITE,e.right,null,!0)})):(h(e.left)||this.visit(e.left),this.visitPattern(e.left,function(n){var r=null;t.currentScope().isStrict||(r={pattern:n,node:e}),t.currentScope().__referencing(n,s.WRITE,e.right,r,!0)})),this.visit(e.right),this.visit(e.body))},visitVariableDeclaration:function(e,t,n,r){var i,o,a=this;i=n.declarations[r],o=i.init,this.visitPattern(i.id,function(l,c){e.__define(l,{type:t,name:l,node:i,index:r,kind:n.kind,parent:n}),o&&a.currentScope().__referencing(l,s.WRITE,o,null,!c)})},AssignmentExpression:function(e){var t=this;h(e.left)?"="===e.operator?this.visitPattern(e.left,function(n,r){var i=null;t.currentScope().isStrict||(i={pattern:n,node:e}),t.currentScope().__referencing(n,s.WRITE,e.right,i,!r)}):t.currentScope().__referencing(e.left,s.RW,e.right):this.visit(e.left),this.visit(e.right)},CatchClause:function(e){var t=this;this.scopeManager.__nestScope(e),this.visitPattern(e.param,function(n){t.currentScope().__define(n,{type:l.CatchClause,name:e.param,node:e})}),this.visit(e.body),this.close(e)},Program:function(e){this.scopeManager.__nestScope(e),this.scopeManager.__isES6()&&this.scopeManager.isModule()&&this.scopeManager.__nestModuleScope(e),this.visitChildren(e),this.close(e)},Identifier:function(e){this.currentScope().__referencing(e)},UpdateExpression:function(e){h(e.argument)?this.currentScope().__referencing(e.argument,s.RW,null):this.visitChildren(e)},MemberExpression:function(e){this.visit(e.object),e.computed&&this.visit(e.property)},Property:function(e){this.visitProperty(e)},MethodDefinition:function(e){this.visitProperty(e)},BreakStatement:function(){},ContinueStatement:function(){},LabeledStatement:function(e){this.visit(e.body)},ForStatement:function(e){e.init&&e.init.type===y.VariableDeclaration&&"var"!==e.init.kind&&this.scopeManager.__nestScope(e),this.visitChildren(e),this.close(e)},ClassExpression:function(e){this.visitClass(e)},ClassDeclaration:function(e){this.visitClass(e)},CallExpression:function(e){this.scopeManager.__ignoreEval()||e.callee.type!==y.Identifier||"eval"!==e.callee.name||this.currentScope().variableScope.__detectEval(),this.visitChildren(e)},BlockStatement:function(e){this.scopeManager.__isES6()&&this.scopeManager.__nestScope(e),this.visitChildren(e),this.close(e)},ThisExpression:function(){this.currentScope().variableScope.__detectThis()},WithStatement:function(e){this.visit(e.object),this.scopeManager.__nestScope(e),this.visit(e.body),this.close(e)},VariableDeclaration:function(e){var t,n,r,i;for(t="var"===e.kind?this.currentScope().variableScope:this.currentScope(),n=0,r=e.declarations.length;r>n;++n)i=e.declarations[n],this.visitVariableDeclaration(t,l.Variable,e,n),i.init&&this.visit(i.init)},SwitchStatement:function(e){var t,n;for(this.visit(e.discriminant),this.scopeManager.__isES6()&&this.scopeManager.__nestScope(e),t=0,n=e.cases.length;n>t;++t)this.visit(e.cases[t]);this.close(e)},FunctionDeclaration:function(e){this.visitFunction(e)},FunctionExpression:function(e){this.visitFunction(e)},ForOfStatement:function(e){this.visitForIn(e)},ForInStatement:function(e){this.visitForIn(e)},ArrowFunctionExpression:function(e){this.visitFunction(e)},ImportDeclaration:function(e){var t;i(this.scopeManager.__isES6()&&this.scopeManager.isModule()),t=new m(e,this),t.visit(e)},ExportDeclaration:function(e){return e.source?void 0:e.declaration?void this.visit(e.declaration):void this.visitChildren(e)},ExportSpecifier:function(e){this.visit(e.id)}}),{version:"2.0.4",Reference:s,Variable:l,Scope:p,ScopeManager:f,analyze:v}}),n("eslint/lib/rules",["./load-rules-async","exports"],function(e,t){function n(e,t){i[e]=t}function r(){var t=e.getESLintRules();Object.keys(t).forEach(function(e){n(e,t[e])})}var i=Object.create(null);return t.define=n,t.load=r,t["import"]=function(e,t){Object.keys(e).forEach(function(r){var i=t+"/"+r,o=e[r];n(i,o)})},t.get=function(e){return i[e]},t.testClear=function(){i=Object.create(null)},r(),t}),n("eslint/lib/rule-context",[],function(){function e(e,n,r,i,o,a,s){Object.defineProperty(this,"env",{value:s}),Object.defineProperty(this,"id",{value:e}),Object.defineProperty(this,"options",{value:i}),Object.defineProperty(this,"settings",{value:o}),Object.defineProperty(this,"ecmaFeatures",{value:Object.create(a)}),Object.freeze(this.ecmaFeatures),t.forEach(function(e){this[e]=function(){return n[e].apply(n,arguments)}},this),this.report=function(t,i,o,a){n.report(e,r,t,i,o,a)}}var t=["getAllComments","getAncestors","getComments","getFilename","getFirstToken","getFirstTokens","getJSDocComment","getLastToken","getLastTokens","getNodeByRangeIndex","getScope","getSource","getSourceLines","getTokenAfter","getTokenBefore","getTokenByRangeStart","getTokens","getTokensAfter","getTokensBefore","getTokensBetween"];return e.prototype={constructor:e},e}),n("eslint/lib/events",["orion/EventTarget","orion/objects"],function(e,t){function n(){this._eventTarget=new e}function r(e,t){if("function"!=typeof t)throw new Error("addListener only takes instances of Function");var r,o="undefined"!=typeof this._maxListeners?this._maxListeners:i;return 0!==o&&(r=n.listenerCount(this,e)>=o)&&"undefined"!=typeof console&&console.error("Possible EventEmitter memory leak: "+r+" listeners added."),this.emit("newListener",t),this._eventTarget.addEventListener(e,t),this}var i=10;return n.prototype.constructor=n,t.mixin(n.prototype,{_maxListeners:10,addListener:r,on:r,once:function(e,t){var n=this,r=function(){try{t.apply(this,Array.prototype.slice.call(arguments))}finally{n.removeListener(e,r)}};return this.addListener(e,r),this},removeListener:function(e,t){if("function"!=typeof t)throw new Error("removeListener only takes instances of Function");return this._eventTarget.removeEventListener(e,t),this.emit("removeListener",t),this},removeAllListeners:function(e){var t=this._eventTarget._namedListeners,n=this,r=function(e){var r=t[e];r&&(r.forEach(n.emit.bind(n,"removeListener")),delete t[e])};return"undefined"==typeof e?Object.keys(t).forEach(r):r(e),this},setMaxListeners:function(e){if("number"!=typeof e)throw new Error("setMaxListeners only takes a number");this._maxListeners=e},listeners:function(e){var t=this._eventTarget._namedListeners[e];return t?t.slice():[]},emit:function(e){var t=this._eventTarget._namedListeners[e];if(!t){if("error"===e)throw new Error("Uncaught, unspecified 'error' event.");return!1}var n=Array.prototype.slice.call(arguments,1),r=this;return t.forEach(function(e){e.apply(r,n)}),!0}}),n.listenerCount=function(e,t){var n=e._eventTarget._namedListeners[t];return n?n.length:0},{EventEmitter:n}}),n("eslint/lib/token-store",[],function(){return function(e){function t(t,n){var r,o=[];for(r=Math.max(0,t);n>r&&i>r;r++)o.push(e[r]);return o}function n(e){var t=e.range[1],n=l[t];return"undefined"==typeof n&&(n=s[t]-1),isNaN(n)&&(n=i-1),n}var r,i,o,a={},s=Object.create(null),l=Object.create(null);for(r=0,i=e.length;i>r;r++)o=e[r].range,s[o[0]]=r,l[o[1]]=r;return a.getTokensBefore=function(e,n){var r=s[e.range[0]];return t(r-(n||0),r)},a.getTokenBefore=function(t,n){return e[s[t.range[0]]-(n||0)-1]},a.getTokensAfter=function(e,r){var i=n(e)+1;return t(i,i+(r||0))},a.getTokenAfter=function(t,r){return e[n(t)+(r||0)+1]},a.getTokens=function(e,r,i){return t(s[e.range[0]]-(r||0),n(e)+(i||0)+1)},a.getFirstTokens=function(e,r){var i=s[e.range[0]];return t(i,Math.min(n(e)+1,i+(r||0)))},a.getFirstToken=function(t,n){return e[s[t.range[0]]+(n||0)]},a.getLastTokens=function(e,r){var i=n(e)+1;return t(Math.max(s[e.range[0]],i-(r||0)),i)},a.getLastToken=function(t,r){return e[n(t)-(r||0)]},a.getTokensBetween=function(e,r,i){return i=i||0,t(n(e)+1-i,s[r.range[0]]+i)},a.getTokenByRangeStart=function(t){return e[s[t]]||null},a}}),n("eslint/lib/eslint",["esprima/esprima","estraverse/estraverse","escope/escope","eslint/conf/environments","./rules","./util","./rule-context","./events","./token-store","require","module"],function(e,t,n,r,i,o,a,s,l,c,u){function p(e,t){Object.keys(t).forEach(function(n){e[n]=t[n]})}function f(e){var t={};return e=e.replace(/\s*:\s*/g,":"),e=e.replace(/\s*,\s*/g,","),e.split(/\s|,+/).forEach(function(e){if(e){var n,r=e.indexOf(":");-1!==r&&(n=e.substring(r+1,e.length),e=e.substring(0,r)),t[e]="true"===n}}),t}function d(e){var t={};e=e.replace(/([a-z0-9\-\/]+):/g,'"$1":').replace(/(\]|[0-9])\s+(?=")/,"$1,");try{t=JSON.parse("{"+e+"}")}catch(n){}return t}function h(e){var t={};return e=e.replace(/\s*,\s*/g,","),e.split(/,+/).forEach(function(e){e=e.trim(),e&&(t[e]=!0)}),t}function m(e,t){var n=null;return e.variables.some(function(e){return e.name===t?(n=e,!0):!1}),n}function g(e,t,i){var o={},a={},s=r.builtin;p(o,s),Object.keys(i.env).forEach(function(e){if(i.env[e]){var t=r[e]&&r[e].globals;t&&p(o,t)}}),p(o,i.globals),p(a,i.astGlobals),Object.keys(o).forEach(function(e){var r=m(t,e);r||(r=new n.Variable(e,t),r.eslintExplicitGlobal=!1,t.variables.push(r)),r.writeable=o[e]}),Object.keys(a).forEach(function(e){var r=m(t,e);r||(r=new n.Variable(e,t),r.eslintExplicitGlobal=!0,t.variables.push(r)),r.writeable=a[e]})}function v(e,t,n){n.length?n.forEach(function(n){e.push({start:t,end:null,rule:n})}):e.push({start:t,end:null,rule:null})}function y(e,t,n){var r;if(n.length)n.forEach(function(n){for(r=e.length-1;r>=0;r--)if(!e[r].end&&e[r].rule===n){e[r].end=t;break}});else{var i;for(r=e.length-1;r>=0&&(!i||i===e[r].start);r--)e[r].end||(e[r].end=t,i=e[r].start)}}function b(e,t,n){var i={astGlobals:{},rules:{},env:{}},a={};e.comments.forEach(function(e){if("Block"===e.type){var t=e.value.trim(),r=/^(eslint-\w+|eslint|globals?)(\s|$)/.exec(t);if(r)switch(t=t.substring(r.index+r[1].length),r[1]){case"globals":case"global":o.mixin(i.astGlobals,f(t));break;case"eslint-env":o.mixin(i.env,h(t));break;case"eslint-disable":v(n,e.loc.start,Object.keys(h(t)));break;case"eslint-enable":y(n,e.loc.start,Object.keys(h(t)));
+break;case"eslint":var s=d(t);Object.keys(s).forEach(function(e){var t=s[e];("number"==typeof t||Array.isArray(t)&&"number"==typeof t[0])&&(a[e]=t)})}}}),Object.keys(i.env).forEach(function(e){var t=r[e]&&r[e].rules;i.env[e]&&t&&o.mixin(i.rules,t)}),o.mixin(i.rules,a),o.mergeConfigs(t,i)}function x(e,t,n){for(var r=0,i=e.length;i>r;r++){var o=e[r];if((!o.rule||o.rule===t)&&(n.line>o.start.line||n.line===o.start.line&&n.column>=o.start.column)&&(!o.end||n.line=0?t.splice(t.indexOf(e.loc),1):(t.push(e.loc),d.emit(e.type+n,e))})}function s(e){o(e,P,"Comment")}function u(e){o(e,j,"Comment:exit")}function p(e){return"number"==typeof e?e:Array.isArray(e)?e[0]:0}function f(e){return Array.isArray(e)?e.slice(1):[]}var d=Object.create(new E),h=[],m=null,v=[],y=null,w=null,_=null,k=null,C=null,T=null,L=null,A=[],P=[],j=[],F=null;d.setMaxListeners(0),d.reset=function(){this.removeAllListeners(),h=[],F=null,y=null,m=null,v=[],w=null,_=null,k=null,C=null,L=null,A=[],P=[],j=[]},d.verify=function(e,o,c,x){var E,P;T=c,x||this.reset();var j=e&&"string"==typeof e?e:e.source;return 0===j.trim().length?(m=j,h):(o=S(o||{}),E=e&&"object"==typeof e?e:r(j.replace(/^#!([^\r\n]+)/,function(e,t){return P=t,"//"+t}),o),E&&(F=E,b(E,o,A),Object.keys(o.rules).filter(function(e){return p(o.rules[e])>0}).forEach(function(e){var t,n=i.get(e),r=p(o.rules[e]),s=f(o.rules[e]);if(!n)throw new Error("Definition for rule '"+e+"' was not found.");try{t=n(new a(e,d,r,s,o.settings,o.ecmaFeatures,o.env)),Object.keys(t).forEach(function(e){d.on(e,t[e])})}catch(l){throw l.message="Error while loading rule '"+e+"': "+l.message,l}}),y=o,m=j,L=new t.Controller,C=n.analyze(E,{ignoreEval:!0,ecmaVersion:y.ecmaFeatures.blockBindings?6:5}),_=C.scopes,k=[],_.forEach(function(e,t){var n=e.block.range[0];k[n]||(k[n]=t)}),v=m.split(/\r?\n|\u2028|\u2029/g),Object.freeze(v),w=l(E.tokens),Object.keys(w).forEach(function(e){d[e]=w[e]}),g(E,_[0],y),P&&E.comments.length&&E.comments[0].value===P&&(E.comments.splice(0,1),E.body.length&&E.body[0].leadingComments&&E.body[0].leadingComments[0].value===P&&E.body[0].leadingComments.splice(0,1)),L.traverse(E,{enter:function(e,t){var n=d.getComments(e);s(n.leading),e.parent=t,d.emit(e.type,e),s(n.trailing)},leave:function(e){var t=d.getComments(e);u(t.trailing),d.emit(e.type+":exit",e),u(t.leading)}})),h.sort(function(e,t){var n=e.line-t.line;return 0===n?e.column-t.column:n}),h)},d.report=function(e,t,n,r,i,o,a){"string"==typeof r&&(a=o,o=i,i=r,r=n.loc.start),i=i.replace(/\$\{([^\}]+)\}/g,function(e,t){return o[t]}),x(A,e,r)||h.push({ruleId:e,severity:t,node:n,message:i,args:o,line:r.line,column:r.column,nodeType:n.type,source:v[r.line-1]||"",related:"undefined"!=typeof a?a:null})},d.getSource=function(e,t,n){return e?null!==m?m.slice(Math.max(e.range[0]-(t||0),0),e.range[1]+(n||0)):null:m},d.getSourceLines=function(){return v},d.getAllComments=function(){return F.comments},d.getComments=function(e){var t=e.leadingComments||[],n=e.trailingComments||[];return"Program"===e.type&&0===e.body.length&&(t=e.comments),{leading:t,trailing:n}},d.getJSDocComment=function(e){function t(e){if(e)for(var t=e.length-1;t>=0;t--)if("Block"===e[t].type&&"*"===e[t].value.charAt(0)){if(r-e[t].loc.end.line<=1)return e[t];break}return null}var n=e.parent,r=e.loc.start.line;switch(e.type){case"FunctionDeclaration":return t(e.leadingComments);case"ArrowFunctionExpression":case"FunctionExpression":if("CallExpression"!==n.type||n.callee!==e){for(;n&&!n.leadingComments&&!/Function/.test(n.type);)n=n.parent;return n&&"FunctionDeclaration"!==n.type?t(n.leadingComments):null}default:return null}},d.getAncestors=function(){return L.parents()},d.getNodeByRangeIndex=function(e){var n=null;return t.traverse(L.root,{enter:function(t){t.range[0]<=e&&e=0;--r)if(t=C.acquire(e[r]))return t}return _[0]},d.getFilename=function(){return"string"==typeof T?T:" "};var O=d.defineRule=function(e,t){i.define(e,t)};return d.defineRules=function(e){Object.getOwnPropertyNames(e).forEach(function(t){O(t,e[t])})},d.defaults=function(){return c("../conf/eslint.json")},d}(),u.exports}),n("javascript/validator",["eslint/lib/eslint","orion/objects","javascript/astManager","javascript/finder","orion/i18nUtil","i18n!javascript/nls/problems","orion/metrics"],function(e,t,n,r,i,o,a){function s(e,t){this.astManager=e,this.cuprovider=t,p.setDefaults()}function l(e){var t=2,n=p.rules[e.ruleId];if(Array.isArray(n)){var r=e.related,i=r&&r.type;t="missing-doc"===e.ruleId&&void 0!==n[1][i]?n[1][i]:n[0]}else t=n;switch(t){case 1:return"warning";case 2:return"error"}return"error"}function c(e){if(e.args){if(e.args.pid)return e.args.pid;if(e.args.nls)return e.args.nls}return e.ruleId}function u(e){var t=e.start,n=e.end;if(e.node&&(t=e.node.range[0],n=e.node.range[1],e.related&&e.related.range)){var r=e.related;t=r.range[0],n=r.range[1]}var a=e.args&&e.args.nls?e.args.nls:e.ruleId,s=e.args||Object.create(null),u=e.message;a&&o[a]&&(u=i.formatMessage.call(null,o[a],s));var p={id:c(e),description:u,severity:l(e)};return"undefined"!=typeof t?(p.start=t,p.end=n):"number"==typeof e.index?(p.start=n,p.end=e.index):"undefined"!=typeof e.lineNumber?(p.line=e.lineNumber,p.start=e.column):(p.start=0,p.end=0),e.args&&e.args.data&&(p.data=e.args.data),p}var p={defaults:{curly:0,eqeqeq:1,"missing-doc":0,"missing-nls":0,"new-parens":1,"no-caller":1,"no-cond-assign":2,"no-comma-dangle":0,"no-console":2,"no-constant-condition":2,"no-debugger":1,"no-dupe-keys":2,"no-eval":0,"no-extra-semi":1,"no-implied-eval":0,"no-iterator":2,"no-proto":2,"no-jslint":1,"no-new-array":1,"no-new-func":1,"no-new-object":1,"no-new-wrappers":1,"no-redeclare":1,"no-reserved-keys":2,"no-regex-spaces":2,"no-shadow":1,"no-shadow-global":1,"no-throw-literal":1,"no-undef":2,"no-undef-init":1,"no-unused-params":1,"no-unused-vars":1,"no-use-before-define":1,radix:1,semi:1,"use-isnan":2,"no-unreachable":2,"no-fallthrough":2,"no-empty-block":0,"valid-typeof":2,"no-sparse-arrays":1,"no-with":1},setOption:function(e,t,n){if("number"==typeof t)if(Array.isArray(this.rules[e])){var r=this.rules[e];n?(r[1]=r[1]||{},r[1][n]=t):r[0]=t}else this.rules[e]=t},setDefaults:function(){this.rules=Object.create(null);for(var e=Object.keys(this.defaults),t=0;ts;s++){var l=o[s],c=null;l.end&&l.token?c={range:[l.index,l.end],value:l.token}:e.tokens.length>0&&(c=r.findToken(l.index,e.tokens));var u=l.message;if(i[l.index]!==u){if(i[l.index]=u,l.type)switch(l.type){case n.ErrorTypes.Unexpected:c&&(l.args={0:c.value,nls:"syntaxErrorBadToken"},l.message=u=l.args.nls);break;case n.ErrorTypes.EndOfInput:l.args={nls:"syntaxErrorIncomplete"},l.message=l.args.nls}else l.token||(l.args={0:l.message,nls:"esprimaParseFailure"},l.message=l.args.nls,delete l.start,delete l.end);c&&(l.node=c,c.value&&(l.args||(l.args=Object.create(null)),l.args.data||(l.args.data=Object.create(null)),l.args.data.tokenValue=c.value)),t.push(l)}}return t},computeProblems:function(e){var t=this;return e.getFileMetadata().then(function(n){return"text/html"===n.contentType.id?e.getText().then(function(e){var i=t.cuprovider.getCompilationUnit(function(){return r.findScriptBlocks(e)},n);return t.astManager.getAST(i.getEditorContext()).then(function(e){var n=Object.create(null);return n.browser=!0,t._validateAst(e,n)})}):t.astManager.getAST(e).then(function(e){return t._validateAst(e)})})},_validateAst:function(t,n){var r=[],i=this._extractParseErrors(t),o=Date.now();try{p.env=n,r=e.verify(t,p)}catch(s){i.length<1&&r.push({start:0,args:{0:s.toString(),nls:"eslintValidationFailure"},severity:"error"})}var l=Date.now()-o;return a.logTiming("language tools","validation",l,"application/javascript"),{problems:this._filterProblems(i,r).map(u)}},_filterProblems:function(e,t){var n=e.length;if(1>n)return t;var r=[].concat(e),i=t.length;e:for(var o=0;i>o;o++){for(var a=t[o],s=0;n>s;s++){var l=e[s],c=a.node;if(c&&c.range[0]>=l.index&&c.range[0]<=l.end)continue e}r.push(a)}return r},updated:function(e){if(e)for(var t="eslint.config"===e.pid,n=Object.keys(e),r=Object.create(null),i=0;i0?r.parents[r.parents.length-1]:null;if(i&&i.type===n.Syntax.ArrayExpression){var o=i.parent?i.parent:r.parents&&r.parents.length>1?r.parents[r.parents.length-2]:null;if(o&&o.type===n.Syntax.CallExpression&&o.callee&&"define"===o.callee.name)for(var a=i.elements,s=0;ss))return t.findNode(l.params[s].range[0],e,{parents:!0});break}}return null}if(e&&r){var c=r.selection.start,u=r.selection.end,p=o(c,e);if(p){var f=t.findNode(c,e,{parents:!0});if(!s(f)&&p.range[0]>=f.range[0]&&p.range[1]<=f.range[1]){if(f.type===n.Syntax.Literal){var d=i(f);if(!d)return[];f=d,c=f.range[0],u=f.range[1]}var h={start:c,end:u,word:a(f),token:f},m=l(h);return n.traverse(e,m),m.occurrences}}}return[]}function o(e,n){if(n.tokens&&n.tokens.length>0){var r=t.findToken(e,n.tokens);if(r){if("Punctuator"===r.type){var i=r.index;if(e===r.range[0]&&null!=i&&i>0){var o=n.tokens[i-1];if(o.range[1]!==r.range[0])return null;r=o}}if("Identifier"===r.type||"String"===r.type||"Keyword"===r.type&&"this"===r.value)return r}}return null}function a(e){switch(e.type){case n.Syntax.Identifier:return e.name;case n.Syntax.ThisExpression:return"this"}}function s(e){return e?e.type===n.Syntax.ThisExpression?!1:e.type===n.Syntax.Literal?!1:e.type!==n.Syntax.Identifier:!0}function l(e){if(this.visitor||(this.visitor=new r,this.visitor.enter=this.visitor.enter.bind(this.visitor),this.visitor.leave=this.visitor.leave.bind(this.visitor)),e.token){var t=e.token.parent?e.token.parent:e.token.parents&&e.token.parents.length>0?e.token.parents[e.token.parents.length-1]:null;this.visitor.thisCheck=e.token.type===n.Syntax.ThisExpression,this.visitor.objectPropCheck=!1,t&&t.type===n.Syntax.Property?this.visitor.objectPropCheck=e.token===t.key:t&&t.type===n.Syntax.MemberExpression?t.object&&t.object.type===n.Syntax.ThisExpression?this.visitor.objectPropCheck=!0:!t.computed&&t.property&&e.start>=t.property.range[0]&&e.end<=t.property.range[1]&&(this.visitor.objectPropCheck=!0):t&&t.type===n.Syntax.FunctionExpression&&e.token.parents&&e.token.parents.length>1&&e.token.parents[e.token.parents.length-2].type===n.Syntax.Property&&t.id&&t.id.range===e.token.range&&(this.visitor.objectPropCheck=!0),this.visitor.labeledStatementCheck=t&&(t.type===n.Syntax.LabeledStatement||t.type===n.Syntax.ContinueStatement||t.type===n.Syntax.BreakStatement)}return this.visitor.context=e,this.visitor}function c(e,t){this.astManager=e,this.cuprovider=t}return n.VisitorKeys.RecoveredNode=[],e.mixin(r.prototype,{occurrences:[],scopes:[],context:null,thisCheck:!1,objectPropCheck:!1,enter:function(e){var t,r;switch(e.type){case n.Syntax.Program:this.occurrences=[],this.scopes=[{range:e.range,occurrences:[],kind:"p"}],this.defscope=null,this.skipScope=null;break;case n.Syntax.FunctionDeclaration:if(this.checkId(e.id,!0),this._enterScope(e),this.skipScope)return n.VisitorOption.Skip;if(e.params)for(t=e.params.length,r=0;t>r;r++)if(this.checkId(e.params[r],!0))return n.VisitorOption.Skip;break;case n.Syntax.FunctionExpression:case n.Syntax.ArrowFunctionExpression:if(this._enterScope(e))return n.VisitorOption.Skip;if(this.checkId(e.id,!0),e.params)for(t=e.params.length,r=0;t>r;r++)if(this.checkId(e.params[r],!0))return n.VisitorOption.Skip;break;case n.Syntax.AssignmentExpression:this.checkId(e.left),this.checkId(e.right);break;case n.Syntax.ExpressionStatement:this.checkId(e.expression);break;case n.Syntax.ArrayExpression:if(e.elements)for(t=e.elements.length,r=0;t>r;r++)this.checkId(e.elements[r]);break;case n.Syntax.MemberExpression:this.checkId(e.object),e.computed?this.checkId(e.property):this.checkId(e.property,!1,!0);break;case n.Syntax.BinaryExpression:this.checkId(e.left),this.checkId(e.right);break;case n.Syntax.UnaryExpression:this.checkId(e.argument);break;case n.Syntax.SwitchStatement:this.checkId(e.discriminant);break;case n.Syntax.UpdateExpression:this.checkId(e.argument);break;case n.Syntax.ConditionalExpression:this.checkId(e.test),this.checkId(e.consequent),this.checkId(e.alternate);break;case n.Syntax.CallExpression:if(this.checkId(e.callee,!1),e.arguments)for(t=e.arguments.length,r=0;t>r;r++)this.checkId(e.arguments[r]);break;case n.Syntax.ReturnStatement:this.checkId(e.argument);break;case n.Syntax.ObjectExpression:if(this._enterScope(e))return n.VisitorOption.Skip;if(e.properties)for(t=e.properties.length,r=0;t>r;r++){var i=e.properties[r];i.value&&i.value.type===n.Syntax.FunctionExpression&&(this.thisCheck?i.value.isprop=!0:this.checkId(i.value.id,!1,!0)),this.checkId(i.key,!0,!0),this.checkId(i.value)}break;case n.Syntax.VariableDeclarator:this.checkId(e.id,!0),this.checkId(e.init);break;case n.Syntax.NewExpression:if(this.checkId(e.callee,!1),e.arguments)for(t=e.arguments.length,r=0;t>r;r++)this.checkId(e.arguments[r]);break;case n.Syntax.LogicalExpression:this.checkId(e.left),this.checkId(e.right);break;case n.Syntax.ThisExpression:if(this.thisCheck){var o=this.scopes[this.scopes.length-1];o.occurrences.push({start:e.range[0],end:e.range[1]}),e.range[0]===this.context.token.range[0]&&(this.defscope=o)}break;case n.Syntax.IfStatement:case n.Syntax.DoWhileStatement:case n.Syntax.WhileStatement:this.checkId(e.test);break;case n.Syntax.ForStatement:this.checkId(e.init);break;case n.Syntax.ForInStatement:this.checkId(e.left),this.checkId(e.right);break;case n.Syntax.WithStatement:this.checkId(e.object);break;case n.Syntax.ThrowStatement:this.checkId(e.argument);break;case n.Syntax.LabeledStatement:this._enterScope(e),this.checkId(e.label,!0,!1,!0);break;case n.Syntax.ContinueStatement:this.checkId(e.label,!1,!1,!0);break;case n.Syntax.BreakStatement:this.checkId(e.label,!1,!1,!0)}},_enterScope:function(e){if(this.thisCheck)switch(e.type){case n.Syntax.ObjectExpression:if(this.scopes.push({range:e.range,occurrences:[],kind:"o"}),this.defscope)return!0;break;case n.Syntax.FunctionExpression:if(!e.isprop&&(this.scopes.push({range:e.body.range,occurrences:[],kind:"fe"}),this.defscope))return!0}else if(this.objectPropCheck)switch(e.type){case n.Syntax.ObjectExpression:this.scopes.push({range:e.range,occurrences:[],kind:"o"})}else if(this.labeledStatementCheck)switch(e.type){case n.Syntax.LabeledStatement:if(this.scopes.push({range:e.range,occurrences:[],kind:"ls"}),e.range[0]>this.context.start||e.range[1]0&&(r=e.params[0].range[0]);break;case n.Syntax.FunctionExpression:case n.Syntax.ArrowFunctionExpression:t="fe",e.id?r=e.id.range[0]:e.params&&e.params.length>0&&(r=e.params[0].range[0])}t&&this.scopes.push({range:[r,e.range[1]],occurrences:[],kind:t})}return!1},leave:function(e){if(this.thisCheck)switch(e.type){case n.Syntax.FunctionExpression:if(e.isprop){delete e.isprop;break}case n.Syntax.ObjectExpression:case n.Syntax.Program:if(this._popScope())return n.VisitorOption.Break}else if(this.objectPropCheck)switch(e.type){case n.Syntax.ObjectExpression:case n.Syntax.Program:if(this._popScope())return n.VisitorOption.Break}else if(this.labeledStatementCheck)switch(e.type){case n.Syntax.LabeledStatement:if(this._popScope())return n.VisitorOption.Break}else switch(e.type){case n.Syntax.FunctionExpression:case n.Syntax.FunctionDeclaration:case n.Syntax.ArrowFunctionExpression:if(this._popScope())return n.VisitorOption.Break;break;case n.Syntax.Program:this._popScope()}},_popScope:function(){var e=this.scopes.pop();if(this.skipScope)return this.skipScope===e&&(this.skipScope=null),!1;var t,n,r=e.occurrences.length;if(this.defscope&&this.defscope===e){for(t=0;r>t;t++)this.occurrences.push(e.occurrences[t]);if(this.defscope.range[0]===e.range[0]&&this.defscope.range[1]===e.range[1]&&this.defscope.kind===e.kind)return!0}else if(this.scopes.length>0)for(n=0;r>n;n++)this.scopes[this.scopes.length-1].occurrences.push(e.occurrences[n]);else for(this.occurrences=[],n=0;r>n;n++)this.occurrences.push(e.occurrences[n]);return!1},_markDefineStatementOccurrences:function(e,t){var r=e.parent?e.parent:e.parents&&e.parents.length>0?e.parents[e.parents.length-1]:null;if(r&&r.type===n.Syntax.FunctionExpression){var i=r.parent?r.parent:e.parents&&e.parents.length>1?e.parents[e.parents.length-2]:null;if(i&&i.type===n.Syntax.CallExpression&&i.callee&&"define"===i.callee.name)for(var o=r,a=0;aa&&t.push({start:s.elements[a].range[0],end:s.elements[a].range[1]})}break}}},checkId:function(e,t,r,i){if(this.skipScope)return!0;if(this.thisCheck)return!1;if(r&&!this.objectPropCheck||!r&&this.objectPropCheck)return!1;if(i&&!this.labeledStatementCheck||!i&&this.labeledStatementCheck)return!1;if(e&&e.type===n.Syntax.Identifier&&e.name===this.context.word){var o=this.scopes[this.scopes.length-1];if(t){if(this.defscope)return o.range[0]<=this.context.start&&o.range[1]>=this.context.end?(this.occurrences=[],this.defscope=o,o.occurrences.push({start:e.range[0],end:e.range[1]}),!1):(o.occurrences=[],this.skipScope=o,!0);if(!(o.range[0]<=this.context.start&&o.range[1]>=this.context.end))return o.occurrences=[],this.skipScope=o,!0;this.defscope=o,this._markDefineStatementOccurrences(e,o.occurrences)}o.occurrences.push({start:e.range[0],end:e.range[1]})}return!1}}),r.prototype.constructor=r,e.mixin(c.prototype,{computeOccurrences:function(e,n){var r=this;return e.getFileMetadata().then(function(o){return"application/javascript"===o.contentType.id?r.astManager.getAST(e).then(function(e){return i(e,n)}):e.getText().then(function(e){var a=r.cuprovider.getCompilationUnit(function(){return t.findScriptBlocks(e)},o);return a.validOffset(n.selection.start)?r.astManager.getAST(a.getEditorContext()).then(function(e){return i(e,n)}):[]})})}}),c.prototype.contructor=c,{JavaScriptOccurrences:c}}),n("javascript/outliner",["orion/objects","javascript/signatures","estraverse/estraverse"],function(e,t,n){function r(){}function i(e){this.astManager=e}return e.mixin(r.prototype,{outline:[],scope:[],enter:function(e){var r,i=this;e.type===n.Syntax.FunctionDeclaration?(r=this.addElement(t.computeSignature(e)),r&&this.scope.push(r)):e.type===n.Syntax.FunctionExpression?(r=this.addElement(t.computeSignature(e)),r&&this.scope.push(r),delete e.sig):e.type===n.Syntax.ObjectExpression?(r=this.addElement(t.computeSignature(e)),r&&this.scope.push(r),delete e.sig,e.properties&&e.properties.forEach(function(e){e.value&&(e.value.type===n.Syntax.FunctionExpression||e.value.type===n.Syntax.ObjectExpression?e.value.sig=t.computeSignature(e):i.addElement(t.computeSignature(e)))})):e.type===n.Syntax.VariableDeclaration?e.declarations&&e.declarations.forEach(function(e){e.init&&e.init.type===n.Syntax.ObjectExpression&&(e.init.sig=t.computeSignature(e))}):e.type===n.Syntax.AssignmentExpression?e.left&&e.right&&(e.right.type===n.Syntax.ObjectExpression||e.right.type===n.Syntax.FunctionExpression)&&(e.right.sig=t.computeSignature(e)):e.type===n.Syntax.ReturnStatement&&e.argument&&(e.argument.type===n.Syntax.ObjectExpression||e.argument.type===n.Syntax.FunctionExpression)&&(e.argument.sig=t.computeSignature(e))},leave:function(e){(e.type===n.Syntax.ObjectExpression||e.type===n.Syntax.FunctionDeclaration||e.type===n.Syntax.FunctionExpression)&&this.scope.pop()},addElement:function(e){if(e){var t={label:e.sig,labelPost:e.details,start:e.range[0],end:e.range[1]};if(this.scope.length<1)this.outline.push(t);else{var n=this.scope[this.scope.length-1];n.children||(n.children=[]),n.children.push(t)}return t}}}),r.prototype.constructor=r,e.mixin(i.prototype,{visitor:null,getVisitor:function(){return this.visitor||(this.visitor=new r,this.visitor.enter=this.visitor.enter.bind(this.visitor),this.visitor.leave=this.visitor.leave.bind(this.visitor)),this.visitor.outline=[],this.visitor},computeOutline:function(e){var t=this;return this.astManager.getAST(e).then(function(e){if(e){var r=t.getVisitor();return n.traverse(e,r),r.outline}return[]})}}),i.prototype.contructor=i,{JSOutliner:i}}),n("javascript/cuProvider",["javascript/lru","javascript/compilationUnit"],function(e,t){function n(e,n,r){if(l){var i=s.get(n.location);if(i)return i}var o=e();return o||(o=[]),i=new t(o,n,r),l&&s.put(n.location,i),i}function r(e){c?c=null:s.remove(o(e.file))}function i(e){l=e}function o(e){return e&&e.location?e.location:"unknown"}function a(e){c=e}var s=new e(10),l=!0,c=null;return{getCompilationUnit:n,onModelChanging:r,onInputChanged:a,setUseCache:i}}),n("javascript/ternProjectManager",["orion/objects","orion/Deferred","i18n!javascript/nls/messages"],function(e){function t(e,t,n){this.ternworker=e,this.scriptResolver=t,this.fileClient=n,this.currentProjectLocation=null,this.timeout=null}return e.mixin(t.prototype,{_getProjectTernConfiguration:function(e,t){for(var n=0;n0?(t.length>1&&console.log("Found multiple potential files for: "+i),e.postMessage({request:"addFile",args:{file:t[0].location}})):console.log("Could not find any matching files for: "+i)})}},onInputChanged:function(e){var t=this,n=e.file;if(n&&n.parents&&n.parents.length>0){var r=n.parents[n.parents.length-1];!r||t.currentProjectLocation&&r.Location===t.currentProjectLocation||(t.currentProjectLocation=r.Location,t.scriptResolver.setSearchLocation(r.Location),r.Children?t._getProjectTernConfiguration(t.fileClient,r.Children).then(function(e){e&&t._loadTernConfig(t.ternworker,t.scriptResolver,e)}):r.ChildrenLocation&&t.fileClient.fetchChildren(r.ChildrenLocation).then(function(e){t._getProjectTernConfiguration(t.fileClient,e).then(function(e){e&&t._loadTernConfig(t.ternworker,t.scriptResolver,e)})}))}".tern-project"===n.name&&(t.currentProjectLocation=null)}}),{TernProjectManager:t}}),n("javascript/commands/generateDocCommand",["orion/objects","javascript/finder","javascript/signatures","orion/Deferred"],function(e,t,n,r){function i(e,t){this.astManager=e,this.cuprovider=t}return e.mixin(i.prototype,{execute:function(e){var n=this;return e.getFileMetadata().then(function(i){return"application/javascript"===i.contentType.id?r.all([n.astManager.getAST(e),e.getCaretOffset()]).then(function(t){n._doCommand(e,t[0],t[1])}):r.all([e.getText(),e.getCaretOffset()]).then(function(r){var o=r[1],a=n.cuprovider.getCompilationUnit(function(){return t.findScriptBlocks(r[0])},i);return a.validOffset(o)?n.astManager.getAST(a.getEditorContext()).then(function(t){n._doCommand(e,t,o)}):void 0})})},_doCommand:function(e,i,o){var a=t.findNode(o,i,{parents:!0});if(a){var s=i.source,l=this._resolveParent(a);if(l){var c,u=l.range[0];if("FunctionDeclaration"===l.type)c=this._genTemplate(l.id.name,l.params,!1,l.range[0],s);else if("Property"===l.type)c=this._genTemplate(l.key.name?l.key.name:l.key.value,l.value.params,!0,l.range[0],s);else if("VariableDeclarator"===l.type){if(u=l.range[0],l.decl){if(l.decl.leadingComments)return;l.decl.declarations&&1===l.decl.declarations.length&&(u=l.decl.range[0])}c=this._genTemplate(l.id.name,l.init.params,!0,u,s)}else"AssignmentExpression"===l.type&&(c=this._genTemplate(n.expandMemberExpression(l.left,""),l.right.params,!0,l.range[0],s))}if(c)return r.all([e.setText(c,u,u),e.setCaretOffset(o+c.length)])}},_genTemplate:function(e,t,n,r,i){for(var o=i[--r],a="";" "===o||" "===o;)a+=o,o=i[--r];var s=[];if(s.push("/**\n"+a+" * @name "+e+"\n"),s.push(a+" * @description description\n"),n&&s.push(a+" * @function\n"),"_"===e.charAt(0)&&s.push(a+" * @private\n"),t)for(var l=t.length,c=0;l>c;c++)s.push(a+" * @param "+t[c].name+"\n");return s.push(a+" * @returns returns\n"+a+" */\n"+a),s.join("")},_resolveParent:function(e){if(!e.parents||e.parents.length<1)return null;switch(e.type){case"FunctionDeclaration":return e;case"Property":return e.value&&"FunctionExpression"===e.value.type?e:null;case"VariableDeclarator":return e.init&&"FunctionExpression"===e.init.type?(e.decl=e.parents[e.parents.length-1],e):null;case"VariableDeclaration":if(e.declarations&&1===e.declarations.length){var t=e.declarations[0];if(t.init&&"FunctionExpression"===t.init.type)return e.parents.push(e),t.parents=e.parents,this._resolveParent(t)}case"AssignmentExpression":if(e.left&&"MemberExpression"===e.left.type&&e.right&&"FunctionExpression"===e.right.type)return e}var n=e.parents.length-1,r=e.parents[n];return r.parents=e.parents.slice(0,n),this._resolveParent(r)}}),{GenerateDocCommand:i}}),n("javascript/commands/openDeclaration",["orion/objects","javascript/finder","orion/Deferred","i18n!javascript/nls/messages"],function(e,t,n,r){function i(e,t,n,r){this.astManager=e,this.ternworker=t,this.cuprovider=n,this.openMode=r,this.timeout=null}var o,a;return e.mixin(i.prototype,{execute:function(e,t){var n=this;return e.getText().then(function(r){return n._findDecl(e,t,r)})},_findDecl:function(e,t,i){o=e,a=new n,this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){o.setStatus({Severity:"Error",Message:r.noDeclTimedOut}),a&&a.resolve(r.noDeclFound),this.timeout=null},5e3);var s=[{type:"full",name:t.input,text:i}];return this.ternworker.postMessage({request:"definition",args:{params:{offset:t.offset},files:s,meta:{location:t.input}}},function(e){if("definition"===e.request)if(e.declaration&&"number"==typeof e.declaration.start&&"number"==typeof e.declaration.end){var t=Object.create(null);t.start=e.declaration.start,t.end=e.declaration.end,null!=this.openMode&&"undefined"!=typeof this.openMode&&(t.mode=this.openMode),a.resolve(o.openEditor(e.declaration.file,t))}else a.resolve(o.setStatus(r.noDeclFound))}.bind(this)),a}}),{OpenDeclarationCommand:i}}),n("javascript/commands/openImplementation",["orion/objects","orion/Deferred","i18n!javascript/nls/messages"],function(e,t){function n(e,t,n){this.astManager=e,this.ternworker=t,this.cuprovider=n,this.timeout=null}var r,i;return e.mixin(n.prototype,{execute:function(e,t){var n=this;return e.getText().then(function(r){return n._findImpl(e,t,r)})},_findImpl:function(e,n,o){r=e,i=new t,this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){r.setStatus({Severity:"Error",Message:"Could not compute implementation, the operation timed out"}),i&&i.resolve("No implementation was found"),this.timeout=null},5e3);var a=[{type:"full",name:n.input,text:o}];return this.ternworker.postMessage({request:"implementation",args:{params:{offset:n.offset},files:a,meta:{location:n.input}}},function(e){if(e.implementation&&"number"==typeof e.implementation.start&&"number"==typeof e.implementation.end){var t=Object.create(null);t.start=e.implementation.start,t.end=e.implementation.end,i.resolve(r.openEditor(e.implementation.file,t))}else i.resolve(r.setStatus("No implementation was found"))}),i}}),{OpenImplementationCommand:n}}),n("javascript/commands/renameCommand",["orion/objects","javascript/finder","orion/Deferred","i18n!javascript/nls/messages"],function(e,t,n,r){function i(e,t,n,r){this.astManager=e,this.ternworker=t,this.scriptResolver=n,this.cuprovider=r,this.timeout=null}var o,a;return e.mixin(i.prototype,{execute:function(e,n){var r=this;return e.getFileMetadata().then(function(i){return r.scriptResolver.setSearchLocation(Array.isArray(i.parents)&&i.parents.length>1?i.parents[i.parents.length-1].Location:null),"application/javascript"===n.contentType.id?r._doRename(e,n):e.getText().then(function(i){var o=n.offset,a=r.cuprovider.getCompilationUnit(function(){return t.findScriptBlocks(i)},{location:n.input,contentType:n.contentType});return a.validOffset(o)?r._doRename(e,n):[]})})},_doRename:function(e,t){var i=this;return e.getText().then(function(s){a=e,o=new n,i.timeout&&clearTimeout(i.timeout),i.timeout=setTimeout(function(){a.setStatus({Severity:"Error",Message:r.renameFailedTimedOut}),o&&o.resolve(),i.timeout=null},5e3);var l=[{type:"full",name:t.input,text:s}];return i.ternworker.postMessage({request:"rename",args:{params:{offset:t.offset},files:l,meta:{location:t.input},newname:""}},function(e){var t=e.changes;if(t&&t.changes&&t.changes.length>0){for(var n=t.changes,r=[n.length],i=0;i0?(s=n.parents[n.parents.length-1].Location,a.progress({message:"Finding all project references.."})):a.progress({message:"Finding all workspace references.."}),o.scriptresolver.setSearchLocation(s),"application/javascript"!==i.contentType.id?e.getText().then(function(r){var s=i.offset,l=o.cuprovider.getCompilationUnit(function(){return t.findScriptBlocks(r)},{location:i.input,contentType:i.contentType});l.validOffset(s)?o._findRefs(e,i,n,a):a.resolve("Not a valid offset in HTML")},function(){a.resolve(r.noFileContents)}):void o._findRefs(e,i,n,a)},function(){a.resolve(r.noFileMeta)}),a},_findRefs:function(e,n,o,s){var l=this;return l.astmanager.getAST(e).then(function(c){var u=t.findNode(n.offset,c);u&&"Identifier"===u.type?l.ternworker.postMessage({request:"type",args:{meta:o,params:n}},function(n,o){if(o)e.setStatus({Severity:"Error",Message:o}),s.resolve([]);else{var c=Object.create(null);c.total=0,c.done=0,c.result=[];var p={keyword:u.name,resource:l.scriptresolver.getSearchLocation(),fileNamePatterns:["*.js","*.html","*.htm"],caseSensitive:!0,incremental:!1,shape:"group"};c.params=p,c.deferred=s,l.searchclient.search(p,!0,!0).then(function(e){c.result=e;for(var r=0,i=e.length;i>r;r++)for(var o=e[r],s=0,p=o.children.length;p>s;s++){var f=o.children[s];c.total+=f.matches.length;for(var d=0,h=f.matches.length;h>d;d++){var m=f.matches[d],g=t.findWord(f.name,m.startIndex);g===u.name?l._checkType(n,o.metadata,m,c):(m.category=a.partial.category,m.confidence=0,c.done++)}}l._checkDone(c)},function(t){e.setStatus({Severity:"Error",Message:i.formatMessage(r.cannotComputeRefs,t.message)}),s.resolve([])},function(){})}}):(e.setStatus({Severity:"Error",Message:r.notAnIdentifier}),s.resolve([]))})},_checkType:function(e,t,n,r){var i=this;i.ternworker.postMessage({request:"checkRef",args:{meta:{location:t.Location},params:{offset:n.end},origin:e}},function(o,s){if(o&&o.type){var l=o.type,c=e.type;n.confidence=l.name===c.name&&l.type===c.type&&i._sameOrigin(l.origin,c.origin)?100:l.staticCheck?l.staticCheck.confidence:"blockcomments"===l.category?5:0,n.category=l.category}else s&&(n.category=a.uncategorized.category,n.confidence=0);r.done++,r.deferred.progress({message:"References found in file: '"+t.Name+"' ("+r.done+"/"+r.total+")"}),i._checkDone(r)})},_sameOrigin:function(e,t){if(e===t)return!0;var n=decodeURIComponent(e),r=decodeURIComponent(t);return n===r?!0:decodeURIComponent(n)===decodeURIComponent(r)},_checkDone:function(e){e.done>=e.total&&e.deferred.resolve({searchParams:e.params,refResult:e.result,categories:a})}}),o}),n("orion/crawler/nls/messages",{root:!0}),n("orion/crawler/nls/root/messages",{filesFound:"${0} files found out of ${1}",searchCancelled:"Search cancelled by user",Cancel:"Cancel"}),n("orion/nls/messages",{root:!0}),n("orion/nls/root/messages",{Navigator:"Navigator",Sites:"Sites",Shell:"Shell",ShellLinkWorkspace:"Shell","Get Plugins":"Get Plug-ins",Global:"Global",Editor:"Editor",EditorRelatedLink:"Show Current Folder",EditorRelatedLinkParent:"Show Enclosing Folder",EditorLinkWorkspace:"Edit",EditorRelatedLinkProj:"Show Project",navigationBar:"Navigation Bar","Filter bindings":"Filter bindings",BindingPrompt:"Enter the new binding",NoBinding:"---",orionClientLabel:"Orion client repository","Orion Editor":"Orion Editor","Orion Image Viewer":"Orion Image Viewer","Orion Markdown Editor":"Orion Markdown Editor","Orion Markdown Viewer":"Orion Markdown Viewer","Orion JSON Editor":"Orion JSON Editor","View on Site":"View on Site","View this file or folder on a web site hosted by Orion":"View this file or folder on a web site hosted by Orion.",ShowAllKeyBindings:"Show a list of all the keybindings on this page","Show Keys":"Show Keys",HideShowBannerFooter:"Hide or show the page banner","Toggle banner and footer":"Toggle banner",ChooseFileOpenEditor:"Choose a file by name and open an editor on it",FindFile:"Open File...","System Configuration Details":"System Configuration Details","System Config Tooltip":"Go to the System Configuration Details page","Background Operations":"Background Operations","Background Operations Tooltip":"Go to the Background Operations page","Operation status is unknown":"Operation status is unknown","Unknown item":"Unknown item",NoSearchAvailableErr:"Can't search: no search service is available",Related:"Related",Options:"Options","LOG: ":"LOG: ",View:"View",SplashTitle:"Setting up Workspace",SplashTitleSettings:"Loading Settings",SplashTitleGit:"Loading Git Repositories",LoadingPage:"Loading Page",LoadingPlugins:"Loading Plugins",LoadingResources:"Loading Resources",plugin_started:'"${0}" started',"plugin_lazy activation":'"${0}" lazily activated',plugin_starting:'"${0}" starting',"no parent":"no parent","no tree model":"no tree model","no renderer":"no renderer","could not find table row ":"could not find table row ",Operations:"Operations","Operations running":"Operations running",SomeOpWarning:"Some operations finished with warning",SomeOpErr:"Some operations finished with error","no service registry":"no service registry",Tasks:"Tasks",Close:"Close","Expand all":"Expand all","Collapse all":"Collapse all",Search:"Search","Advanced search":"Advanced search",Submit:"Submit",More:"More","Recent searches":"Recent searches","Regular expression":"Regular expression","Search options":"Search options","Global search":"Global search","Orion Home":"Orion Home","Close notification":"Close notification",OpPressSpaceMsg:"Operations - Press spacebar to show current operations","Toggle side panel":"Toggle side panel","Open or close the side panel":"Open or close the side panel",Projects:"Projects","Toggle Sidebar":"Toggle Sidebar","Sample HTML5 Site":"Sample HTML5 Site","Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.":"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.","Sample Orion Plugin":"Sample Orion Plug-in","Generate a sample plugin for integrating with Orion.":"Generate a sample plug-in for integrating with Orion.",Browser:"Web Browser",OutlineProgress:"Getting outline for ${0} from ${1}",outlineTimeout:"Outline service timed out. Try reloading the page and opening the outline again.",UnknownError:"An unknown error occurred.",Filter:"Filter (* = any string, ? = any character)",TemplateExplorerLabel:"Templates",OpenTemplateExplorer:"Open Template Explorer",Edit:"Edit",CentralNavTooltip:"Toggle Navigation Menu","Wrote: ${0}":"Wrote: ${0}",GenerateHTML:"Generate HTML file",GenerateHTMLTooltip:"Write an HTML file generated from the current Markdown editor content","alt text":"alt text",blockquote:"blockquote",code:"code","code (block)":"code (block)","code (span)":"code (span)",emphasis:"emphasis","fenced code (${0})":"fenced code (${0})","header (${0})":"header (${0})","horizontal rule":"horizontal rule",label:"label","link (auto)":"link (auto)","link (image)":"link (image)","link (inline)":"link (inline)","link label":"link label","link label (optional)":"link label (optional)","link (ref)":"link (ref)","list item (bullet)":"list item (bullet)","list item (numbered)":"list item (numbered)","strikethrough (${0})":"strikethrough (${0})",strong:"strong","table (${0})":"table (${0})",text:"text","title (optional)":"title (optional)",url:"url",TogglePaneOrientationTooltip:"Toggle split pane orientation",WarningDuplicateLinkId:"Duplicate link ID: ${0} (link IDs are not case-sensitive)",WarningHeaderTooDeep:"Header level cannot exceed 6",WarningLinkHasNoText:"Link has no text",WarningLinkHasNoURL:"Link has no URL",WarningOrderedListItem:"Ordered list item within unordered list",WarningOrderedListShouldStartAt1:"The first item in an ordered list should have index 1",WarningUndefinedLinkId:"Undefined link ID: ${0}",WarningUnorderedListItem:"Unordered list item within ordered list",PageTitleFormat:"${0} - ${1}",KeyCTRL:"Ctrl",KeySHIFT:"Shift",KeyALT:"Alt",KeyBKSPC:"Backspace",KeyDEL:"Del",KeyEND:"End",KeyENTER:"Enter",KeyESCAPE:"Esc",KeyHOME:"Home",KeyINSERT:"Ins",KeyPAGEDOWN:"Page Down",KeyPAGEUP:"Page Up",KeySPACE:"Space",KeyTAB:"Tab","a year":"a year",years:"${0} years","a month":"a month",months:"${0} months","a day":"a day",days:"${0} days","an hour":"an hour",hours:"${0} hours","a minute":"a minute",minutes:"${0} minutes",timeAgo:"${0} ago",justNow:"just now"}),n("orion/searchUtils",["i18n!orion/nls/messages","orion/regex","orion/editor/textModel","orion/URITemplate"],function(e,t,n,r){function i(e,n,r){var i="";r&&(i="^");var o=t.parse("/"+i+e.searchStr+"/");if(o){var a=o.pattern,s=o.flags;-1!==s.indexOf("i")||n.caseSensitive||(s+="i"),e.regExp={pattern:a,flags:s},e.wildCard=!0}}var o={};return o.ALL_FILE_TYPE="*.*",o.getSearchParams=function(t,n,r){if(t){var i=n,a=!0;if("*"===i&&(i=""),""===i&&(a=r&&r.type!==o.ALL_FILE_TYPE),a){var s=t.createSearchParams(i,!1,!1,r);return s}}else window.alert(e.NoSearchAvailableErr);return null},o.generateSearchHelper=function(e,t){var n=e.keyword,r=n,a={};if(e.fileType&&e.fileType!==o.ALL_FILE_TYPE&&""===n&&(r="*."+e.fileType),e.regEx)a.searchStr=n,i(a,e,t);else{var s=n.indexOf("*")>-1,l=n.indexOf("?")>-1;s&&(n=n.split("*").join(".*")),l&&(n=n.split("?").join(".")),s||l||e.nameSearch?(a.searchStr=e.caseSensitive?n:n.toLowerCase(),i(a,e,t),a.wildCard=!0):(a.searchStr=e.caseSensitive?n.split("\\").join(""):n.split("\\").join("").toLowerCase(),a.wildCard=!1)}return a.searchStrLength=a.searchStr.length,{params:e,inFileQuery:a,displayedSearchTerm:r}},o.convertSearchParams=function(e){void 0!==e.rows&&(e.rows=parseInt(e.rows,10)),void 0!==e.start&&(e.start=parseInt(e.start,10)),"string"==typeof e.regEx&&(e.regEx="true"===e.regEx.toLowerCase()),"string"==typeof e.caseSensitive&&(e.caseSensitive="true"===e.caseSensitive.toLowerCase()),"string"==typeof e.nameSearch&&(e.nameSearch="true"===e.nameSearch.toLowerCase()),void 0!==e.fileNamePatterns&&(e.fileNamePatterns=o.getFileNamePatternsArray(e.fileNamePatterns))},o.getFileNamePatternsArray=function(e){var t=void 0;if(e){var n=e.trim();n=n.replace(/^(\s*,\s*)+/g,""),n=n.replace(/([^\\]),(\s*,\s*)*/g,"$1/"),n=n.replace(/(\s*\/\s*)/g,"/"),n=n.replace(/\/\/+/g,"/"),n=n.replace(/\/+$/g,""),t=n.split("/")}return t},o.copySearchParams=function(e,t){var n={};for(var r in e)if(void 0!==e[r]&&null!==e[r]){if(!t&&"replace"===r)continue;n[r]=e[r]}return n},o.generateFindURLBinding=function(e,t,n,i,o){var a={find:t.searchStr,regEx:t.wildCard?!0:void 0,caseSensitive:e.caseSensitive?!0:void 0,replaceWith:"string"==typeof i?i:void 0,atLine:"number"==typeof n?n:void 0};if(o)return a;var s=new r("{,params*}").expand({params:a});return","+s},o.convertFindURLBinding=function(e){"string"==typeof e.regEx&&(e.regEx="true"===e.regEx.toLowerCase()),"string"==typeof e.caseSensitive&&(e.caseSensitive="true"===e.caseSensitive.toLowerCase()),"string"==typeof e.atLine&&(e.atLine=parseInt(e.atLine,10))},o.replaceRegEx=function(e,t,n){var r=new RegExp(t.pattern,t.flags);return e.replace(r,n)},o.replaceStringLiteral=function(e,n,r){var i=t.parse("/"+n+"/gim");return o.replaceRegEx(e,i,r)},o.searchOnelineLiteral=function(e,t,n,r,i){for(var o,a=0,s=!1,l=[];;){if(o=t.indexOf(e.searchStr,a),0>o)break;if(r){var c=r.getLineStart(i)+o;l.push({startIndex:o,length:e.searchStrLength,start:c,end:c+e.searchStrLength})}else l.push({startIndex:o,length:e.searchStrLength});if(s=!0,n)break;a=o+e.searchStrLength}return s?l:null},o.findRegExp=function(e,t,n,r){if(!t)return null;n=n||"",n+=(-1===n.indexOf("g")?"g":"")+(-1===n.indexOf("m")?"m":"");var i=new RegExp(t,n),o=null;return o=i.exec(e.substring(r)),o&&{startIndex:o.index+r,length:o[0].length}},o.searchOnelineRegEx=function(e,t,n,r,i){for(var a=0,s=!1,l=[];;){var c=o.findRegExp(t,e.regExp.pattern,e.regExp.flags,a);if(!c)break;if(r){var u=r.getLineStart(i)+c.startIndex;c.start=u,c.end=u+c.length}if(l.push(c),s=!0,n)break;a=c.startIndex+c.length}return s?l:null},o.generateNewContents=function(e,t,n,r,i,a){if(r&&t){e||(n.contents=[]);for(var s=0;s0,l=r.children[m].matches,p=!0;break}}if(p){var v;if(f){var y=o.replaceCheckedMatches(u,i,l,d,a);for(v=y.replacedStr,c=0;cr?(r=0,i=r+a-1):(i=n+e,i>t.length-1&&(i=t.length-1,r=i-a+1)));for(var s=r;i>=s;s++)o.push({context:t[s],current:s===n});return o},o.splitFile=function(e){for(var t=0,n=0,r=0,i=0,o=[];;){if(-1!==t&&r>=t&&(t=e.indexOf("\r",r)),-1!==n&&r>=n&&(n=e.indexOf("\n",r)),-1===n&&-1===t){o.push(e.substring(i));break}var a=1;-1!==t&&-1!==n?t+1===n?(a=2,r=n+1):r=(n>t?t:n)+1:r=-1!==t?t+1:n+1,o.push(e.substring(i,r-a)),i=r}return o},o.searchWithinFile=function(e,t,r,i,a,s){var l;s&&(l=new n.TextModel(r));var c=o.splitFile(r);if((i||s)&&(t.contents=c),t){t.children=[];for(var u=0,p=0;p0){var d,h=a?f:f.toLowerCase();if(d=e.wildCard?o.searchOnelineRegEx(e,h,!1,l,p):o.searchOnelineLiteral(e,h,!1,l,p)){var m,g=p+1;if(i)for(var v=0;v0)for(var r=t-1;r>-1;r--){var i=""===n?"":"/";n=n+i+e[r].Name}return n},o}),n("orion/serviceTracker",[],function(){function e(e,r){function i(e){var t=e.getProperty("service.id"),n=this.addingService(e);n&&(c[t]=e,u[t]=n)}function o(e){var t=e.getProperty("service.id"),n=u[t];delete c[t],delete u[t],this.removedService(e,n)}function a(e){return-1!==e.getProperty("objectClass").indexOf(r)}this.serviceRegistry=e;var s,l,c={},u={},p=t;this.close=function(){if(p!==n)throw new Error("Already closed");p=t,e.removeEventListener("registered",s),e.removeEventListener("unregistering",l),s=null,l=null;var r=this;this.getServiceReferences().forEach(function(e){o.call(r,e)}),"function"==typeof this.onClose&&this.onClose()},this.getServiceReferences=function(){var e=Object.keys(c);return e.length?e.map(function(e){return c[e]}):null},this.open=function(c){if("undefined"==typeof c&&(c=!0),p!==t)throw new Error("Already open");p=n;var u=this;s=function(e){return a(e.serviceReference)&&(i.call(u,e.serviceReference),"function"==typeof u.onServiceAdded)?u.onServiceAdded(e.serviceReference,u.serviceRegistry.getService(e.serviceReference)):void 0},l=function(e){a(e.serviceReference)&&o.call(u,e.serviceReference)},e.addEventListener("registered",s),e.addEventListener("unregistering",l),c&&e.getServiceReferences(r).forEach(function(t){return i.call(u,t),"function"==typeof u.onServiceAdded?u.onServiceAdded(t,e.getService(t)):void 0}),"function"==typeof this.onOpen&&this.onOpen()}}var t=0,n=1;return e.prototype={addingService:function(e){return this.serviceRegistry.getService(e)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(){}},e}),n("orion/contentTypes",["orion/serviceTracker"],function(e){function t(e,t){return-1!==e.indexOf(t)}function n(e){switch(e&&e.id){case"image/jpeg":case"image/png":case"image/gif":case"image/ico":case"image/tiff":case"image/svg":return!0}return!1}function r(e){return e?"application/octet-stream"===e.id||"application/octet-stream"===e["extends"]:!1}function i(e,n){if("string"!=typeof e)return null;var r,i=null,o=e.indexOf(".");o++;for(var a=e.substring(o).toLowerCase(),s=0;s=0){i=r;break}t(r.extension,a)&&(i=r)}if(!i)for(o=a.indexOf(".");!i&&o>=0;){for(o++,a=a.substring(o),s=0;s=0)return e;if(e.hasChildNodes())for(var t=0;t=0)return e;if(e.hasChildNodes())for(var t=e.childNodes.length-1;t>=0;t--){var n=u(e.childNodes[t]);if(n)return n}return null}function p(e,t){if(3===e.nodeType){var n=E.exec(e.nodeValue);n&&n.length>1&&t(e,n)}if(e.hasChildNodes())for(var r=0;r2&&-1!==o.indexOf("px",o.length-2)){o=o.slice(0,-2);var a=parseInt(o,10);return a!==a?0:a}}return 0}function d(e,t){p(e,function(e,n){var r=t[n[1]]||n[1];e.parentNode.replaceChild(document.createTextNode(r),e)})}function h(e,t){p(e,function(e,n){var r=t[n[1]];if(r){var i=document.createRange(),o=n.index;i.setStart(e,o),i.setEnd(e,o+n[0].length),i.deleteContents(),i.insertNode(r)}})}function m(t,n){function r(e){w.forEach(function(t){var n=!1,r=t.excludeNodes.some(function(t){return document.body.contains(t)?(n=!0,t.contains(e.target)):!1});if(n&&!r)try{t.dismiss(e)}catch(i){"undefined"!=typeof console&&console&&console.error(i&&i.message)}}),w=w.filter(function(e){return e.excludeNodes.some(function(e){return document.body.contains(e)})})}null===w&&(w=[],document.addEventListener("click",r,!0),e.isIOS&&document.addEventListener("touchend",function(e){function t(){e.target.removeEventListener("click",t)}0===e.touches.length&&e.target.addEventListener("click",t)},!1)),w.push({excludeNodes:t,dismiss:n})}function g(e){w=w.filter(function(t){return e!==t.dismiss})}function v(e){for(var t=e.parentNode,n=document.documentElement;t&&t!==n;){var r=window.getComputedStyle(t,null);if(!r)break;var i=r.getPropertyValue("overflow-y");if("auto"===i||"scroll"===i)break;t=t.parentNode}return t}function y(e){window.document.all&&(e.keyCode=0),e.preventDefault&&(e.preventDefault(),e.stopPropagation())}function b(e){for(var t=document.getElementsByTagName("iframe"),n=0;n1?n.children:n.firstChild}var E=/\$\{([^\}]+)\}/,w=null,_={BKSPC:8,TAB:9,ENTER:13,SHIFT:16,CONTROL:17,ALT:18,ESCAPE:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DEL:46,COMMAND:991},k=Object.create(null);return Object.keys(_).forEach(function(e){k[_[e]]=e}),{$:t,$$:n,$$array:r,node:i,contains:o,bounds:a,empty:s,firstTabbable:c,lastTabbable:u,pixelValueOf:f,stop:y,processTextNodes:d,processDOMNodes:h,addAutoDismiss:m,setFramesEnabled:b,getOffsetParent:v,removeAutoDismiss:g,keyName:x,KEY:_,createNodes:S}}),n("orion/uiUtils",["i18n!orion/nls/messages","orion/webui/littlelib","orion/i18nUtil"],function(e,t,n){function r(n){var r="";if(g)n.mod4&&(r+="⌃"),n.mod3&&(r+="⌥"),n.mod2&&(r+="⇧"),n.mod1&&(r+="⌘");else{var i="+";n.mod1&&(r+=e.KeyCTRL+i),n.mod2&&(r+=e.KeySHIFT+i),n.mod3&&(r+=e.KeyALT+i)}if(n.alphaKey)return r+n.alphaKey;if("keypress"===n.type)return r+n.keyCode;var o=n.keyCode,a=v[o];if(a)return r+a;var s=t.keyName(o);if(s)return s=e["Key"+s]||s,r+s;var l;switch(n.keyCode){case 59:l=n.mod2?":":";";break;case 61:l=n.mod2?"+":"=";break;case 188:l=n.mod2?"<":",";break;case 190:l=n.mod2?">":".";break;case 191:l=n.mod2?"?":"/";break;case 192:l=n.mod2?"~":"`";break;case 219:l=n.mod2?"{":"[";break;case 220:l=n.mod2?"|":"\\";break;case 221:l=n.mod2?"}":"]";break;case 222:l=n.mod2?'"':"'"}return l?r+l:n.keyCode>=112&&n.keyCode<=123?r+"F"+(n.keyCode-111):r+String.fromCharCode(n.keyCode)}function i(e){for(var t="",n=e.getKeys(),i=0;i0)if(e.createTextRange){var i=e.createTextRange();i.collapse(!0),i.moveStart("character",0),i.moveEnd("character",r),i.select()}else e.setSelectionRange?e.setSelectionRange(0,r):void 0!==e.selectionStart&&(e.selectionStart=0,e.selectionEnd=r);else e.select()}},0)}function a(e){var t=-1!==window.navigator.platform.indexOf("Mac");return t&&e.metaKey||!t&&e.ctrlKey}function s(e,t){t&&a(t)?window.open(e):window.location=e}function l(e,n){var r=document.createElement("button");return r.className="orionButton commandButton commandMargins",r.addEventListener("click",function(e){n(),t.stop(e)},!1),e&&r.appendChild(document.createTextNode(e)),r}function c(){}function u(e,t){if(!e||!e.tagName)return!1;switch(e.tagName.toLowerCase()){case"button":case"fieldset":case"form":case"input":case"keygen":case"label":case"legend":case"meter":case"optgroup":case"output":case"progress":case"select":case"textarea":return!0}return e.parentNode===t?!1:e.parentNode&&u(e.parentNode,t)}function p(e,t,n){var r=n?0:1;return e.substring(0,e.length-encodeURIComponent(t).length-r)}function f(e){var t=new Date,n=new Date(e),r=t.getTime()-n.getTime(),i=Math.floor(r/1e3/60/60/24/365);r-=1e3*i*60*60*24*365;var o=Math.floor(r/1e3/60/60/24/30);r-=1e3*o*60*60*24*30;var a=Math.floor(r/1e3/60/60/24);r-=1e3*a*60*60*24;var s=Math.floor(r/1e3/60/60);r-=1e3*s*60*60;var l=Math.floor(r/1e3/60);r-=1e3*l*60;var c=Math.floor(r/1e3);return{year:i,month:o,day:a,hour:s,minute:l,second:c}}function d(t,r,i){return t>0?1===t?e[r]:n.formatMessage(e[i],t):""}function h(e){var t=f(e),n=d(t.year,"a year","years"),r=d(t.month,"a month","months"),i=d(t.day,"a day","days"),o=d(t.hour,"an hour","hours"),a=d(t.minute,"a minute","minutes"),s="";return n?s=t.year>0?n:n+r:r?s=t.month>0?r:r+i:i?s=t.day>0?i:i+o:o?s=t.hour>0?o:o+a:a&&(s=a),s}function m(t){var r=h(t);return r?n.formatMessage(e.timeAgo,r):e.justNow}var g=-1!==navigator.platform.indexOf("Mac"),v=Object.create(null);return v[t.KEY.DOWN]="↓",v[t.KEY.UP]="↑",v[t.KEY.RIGHT]="→",v[t.KEY.LEFT]="←",g&&(v[t.KEY.BKSPC]="⌫",v[t.KEY.DEL]="⌦",v[t.KEY.END]="⇲",v[t.KEY.ENTER]="⏎",v[t.KEY.ESCAPE]="⎋",v[t.KEY.HOME]="⇱",v[t.KEY.PAGEDOWN]="⇟",v[t.KEY.PAGEUP]="⇞",v[t.KEY.SPACE]="␣",v[t.KEY.TAB]="⇥"),{getUserKeyString:i,getUserText:o,openInNewWindow:a,followLink:s,createButton:l,createDropdownButton:c,isFormElement:u,path2FolderName:p,timeElapsed:h,displayableTimeElapsed:m}}),n("orion/crawler/searchCrawler",["i18n!orion/crawler/nls/messages","orion/i18nUtil","orion/searchUtils","orion/contentTypes","orion/uiUtils","orion/Deferred"],function(e,t,n,r,i,o){function a(t,r,i,o){this.registry=t,this.fileClient=r,this.fileLocations=[],this.fileSkeleton=[],this._hitCounter=0,this._totalCounter=0,this._searchOnName=o&&o.searchOnName,this._buildSkeletonOnly=o&&o.buildSkeletonOnly,this._fetchChildrenCallBack=o&&o.fetchChildrenCallBack,this._searchParams=i,this.searchHelper=this._searchOnName||this._buildSkeletonOnly||!this._searchParams?null:n.generateSearchHelper(i),this._location=i?i.resource:o&&o.location,this._childrenLocation=o&&o.childrenLocation?o.childrenLocation:this._location,this._reportOnCancel=o&&o.reportOnCancel,this._visitSingleFile=o&&o.visitSingleFile,this._visitSingleFile||(this._visitSingleFile=this._searchSingleFile),this._cancelMessage=o&&o.cancelMessage,this._cancelMessage||(this._cancelMessage=e.searchCancelled),this._cancelled=!1,this._statusService=this.registry.getService("orion.page.message"),this._progressService=this.registry.getService("orion.page.progress"),this._statusService&&this._statusService.setCancelFunction(function(){this._cancelFileVisit()}.bind(this))}var s=!1,l=[".git"];return a.prototype.search=function(e){this.contentTypeService=this.registry.getService("orion.core.contentTypeRegistry"),this._onSearchComplete=e,this._cancelled=!1,this._deferredArray=[];var t;return this.contentTypeService.getContentTypes().then(function(e){this.contentTypesCache=e;var n=this;return this._visitRecursively(this._childrenLocation).then(function(){return(!n._cancelled||n._reportOnCancel)&&(t=n._reportResult()),n._cancelled&&n._HandleStatus({name:"Cancel"}),(new o).resolve(t)}.bind(n),function(e){return t=n._reportResult(),n._HandleStatus(e),(new o).resolve(t)}.bind(n))}.bind(this))},a.prototype.searchName=function(e){e&&(this._searchParams=e,this.searchHelper=n.generateSearchHelper(e,!0));var t=[];if(this._cancelled=!1,this._deferredArray=[],this._sort(this.fileSkeleton),this.fileSkeleton.length>0){for(var r=0;r=this.searchHelper.params.rows))break}var s={numFound:t.length,docs:t};return(new o).resolve({response:s})}return(new o).resolve({response:{numFound:0,docs:[]}})},a.prototype.buildSkeleton=function(e,t){this._buildingSkeleton=!0,this.contentTypeService=this.registry.getService("orion.core.contentTypeRegistry"),this._cancelled=!1,this._deferredArray=[];var n=this;e(),this.contentTypeService.getContentTypes().then(function(e){n.contentTypesCache=e,n._visitRecursively(n._childrenLocation).then(function(){n._buildingSkeleton=!1,t()})})},a.prototype.incrementalReport=function(n,r){if(!this._cancelled){n.LastModified=n.LocalTimeStamp,this.fileLocations.push(n),this._hitCounter++,r&&this._sort(this.fileLocations);var i={numFound:this.fileLocations.length,docs:this.fileLocations};this._onSearchComplete({response:i},!0),this._statusService&&this._statusService.setProgressResult({Message:t.formatMessage(e.filesFound,this._hitCounter,this._totalCounter)},e.Cancel)}},a.prototype.addTotalCounter=function(e){e||(e=1),this._totalCounter=this._totalCounter+e},a.prototype.isCancelled=function(){return this._cancelled
+},a.prototype._contains=function(e,t){return-1!==(e||[]).indexOf(t)},a.prototype._sort=function(e){e.sort(function(e,t){var n,r;if(this._searchParams&&"Path asc"===this._searchParams.sort){var o=e.Location&&e.Location.toLowerCase();n=i.path2FolderName(o,e.Name&&e.Name.toLowerCase(),!0);var a=t.Location&&t.Location.toLowerCase();return r=i.path2FolderName(a,t.Name&&t.Name.toLowerCase(),!0),r>n?-1:n>r?1:this._sortOnNameSingle(e,t)}return this._sortOnNameSingle(e,t)}.bind(this))},a.prototype._HandleStatus=function(e){this._statusService&&"Cancel"===e.name&&(s&&console.log("Crawling search cancelled. Deferred array length : "+this._deferredArray.length),this._statusService.setProgressResult({Message:this._cancelMessage,Severity:"Warning"}))},a.prototype._reportResult=function(){this._sort(this.fileLocations);var e={numFound:this.fileLocations.length,docs:this.fileLocations},t={response:e};return this._onSearchComplete(t),t},a.prototype._sortOnNameSingle=function(e,t){var n=e.Name&&e.Name.toLowerCase(),r=t.Name&&t.Name.toLowerCase();return r>n?-1:n>r?1:0},a.prototype._fileNameMatches=function(e){var t=!0;return this.searchHelper&&this.searchHelper.params.fileNamePatterns&&(t=this.searchHelper.params.fileNamePatterns.some(function(t){var n="^"+t.replace(/([*?])/g,".$1")+"$";return e.match(n)})),t},a.prototype._visitRecursively=function(e){var t=[],n=this;return this._fetchChildrenCallBack&&this._fetchChildrenCallBack(e),(n._progressService?this._progressService.progress(n.fileClient.fetchChildren(e),"Crawling search for children of "+e):n.fileClient.fetchChildren(e)).then(function(e){for(var i=0;i-1))throw s;this._crawler||(this._crawler=this._createCrawler(e)),e.nameSearch?this._crawler.searchName(e).then(function(t){this._searchDeferred=null,o.resolve(this.convert(t,e))}.bind(this)):this._crawler.search(function(){o.progress(arguments[0],arguments[1])}).then(function(t){this._searchDeferred=null,o.resolve(this.convert(t,e))}.bind(this))}return o},_generateSingle:function(e,t){return this._fileClient.read(e.location).then(function(n){return r.searchWithinFile(t.inFileQuery,e,n,!1,t.params.caseSensitive,!0),e}.bind(this),function(e){var t=this._registry.getService("orion.page.message");t&&t.setProgressResult({Message:e.message,Severity:"Error"})}.bind(this))},_generateMatches:function(e,n,i){if(!i||0===n.length)return(new t).resolve(n);var o=r.generateSearchHelper(e),a=[];return n.forEach(function(e){a.push(this._generateSingle(e,o))}.bind(this)),t.all(a,function(e){return{_error:e}})},_generateSingleMeta:function(e){return this._fileClient.read(e.location,!0).then(function(t){return e.metadata=t,e}.bind(this),function(e){var t=this._registry.getService("orion.page.message");t&&t.setProgressResult({Message:e.message,Severity:"Error"})}.bind(this))},_generateMeta:function(e,n){if(!n||0===e.length)return(new t).resolve(e);var r=[];return e.forEach(function(e){r.push(this._generateSingleMeta(e))}.bind(this)),t.all(r,function(e){return{_error:e}})},convert:function(e,t){var n=[],r=this._fileClient.fileServiceRootURL(t.resource);if(e.response.numFound>0)for(var i=0;i",literal:"-->"},name:"comment.block.xml",patterns:[{match:"(\\b)(TODO)(\\b)(((?!-->).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.line"}}}]},doctype:{begin:"",name:"meta.tag.doctype.xml",captures:{0:{name:"meta.tag.doctype.xml"}},patterns:[{include:"#comment"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"}]},tag:{begin:"?[A-Za-z0-9]+",end:"/?>",captures:{0:{name:"meta.tag.xml"}},patterns:[{include:"#comment"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"}]},xmlDeclaration:{begin:"<\\?xml",end:"\\?>",captures:{0:{name:"meta.tag.declaration.xml"}},patterns:[{include:"#comment"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"}],name:"meta.tag.declaration.xml"}}}),{id:t[t.length-1].id,grammars:t,keywords:[]}}),n("orion/editor/stylers/application_x-ejs/syntax",["orion/editor/stylers/application_javascript/syntax","orion/editor/stylers/application_xml/syntax"],function(e,t){var n=[];return n.push.apply(n,e.grammars),n.push.apply(n,t.grammars),n.push({id:"orion.ejs",contentTypes:["application/x-ejs"],patterns:[{include:"orion.xml#comment"},{include:"orion.xml#doctype"},{begin:"<%=?(?:\\s|$)",end:"%>",captures:{0:{name:"entity.name.declaration.js"}},contentName:"source.js.embedded.ejs",patterns:[{include:"orion.js"}]},{include:"orion.xml#tag"},{include:"orion.xml#ampersandEscape"}]}),{id:n[n.length-1].id,grammars:n,keywords:[]}}),function(){function e(e){if("string"!=typeof e)throw new TypeError}function t(e){return e?e.split("&"):[]}function n(e){return 0===e.length?"":e.join("&")}function r(e){var t=/([^=]*)(?:=?)(.*)/.exec(e),n=t[1]?decodeURIComponent(t[1]):"",r=t[2]?decodeURIComponent(t[2]):"";return[n,r]}function i(e){var t=encodeURIComponent(e[0]);return e[1]&&(t+="="+encodeURIComponent(e[1])),t}function o(e,n){var i="",o=[],a=0;return{next:function(){if(i!==e.query&&(i=e.query,o=t(i)),a1&&t.pop():"."!==e&&t.push(e)}),t.join("/")}function p(e){e.scheme&&(e.scheme=l(e.scheme)),e.port&&(e.port=c(e.port)),e.host&&e.path&&(e.path=u(e.path))}function f(e){return e.replace(/\s/g,function(e){return"%"+e.charCodeAt(0).toString(16)})}function d(e,t){if("string"!=typeof e)throw new TypeError;e=f(e);var n=y.exec(e);if(!n)return null;var r={};if(r.scheme=n[1]||"",r.scheme&&!S.test(r.scheme))return null;var i=n[2];if(i){var o=b.exec(i);if(r.userinfo=o[1],r.host=o[2],r.port=o[3],r.port&&!E.test(r.port))return null}return r.path=n[3],r.query=n[4],r.fragment=n[5],s(r,t),p(r),r}function h(e){var t=e.scheme?e.scheme+":":"";return e.host&&(t+="//",e.userinfo&&(t+=e.userinfo+"@"),t+=e.host,e.port&&(t+=":"+e.port)),t+=e.path,e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t}function m(e,t){var n;if(t){if(t=t.href||t,n=d(t),!n||!n.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:n})}var r=d(e,n);if(!r)throw new SyntaxError;Object.defineProperty(this,"_input",{value:e,writable:!0}),Object.defineProperty(this,"_url",{value:r,writable:!0});var i=new a(this);Object.defineProperty(this,"query",{get:function(){return this._url?i:null},enumerable:!0})}try{var g;if("function"==typeof self.URL&&0!==self.URL.length&&"http:"===(g=new self.URL("http://www.w3.org?q")).protocol&&g.query)return}catch(v){}var y=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,b=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,x=/^\S*$/,S=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,E=/^\d*$/,w=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,_=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,k=/^([^?#\s]*)$/,C=/^([^\s]*)$/,T=x,L=/([^:]*):?(.*)/,A="undefined"!=typeof StopIteration?StopIteration:new Error("Stop Iteration"),P={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(a.prototype,{get:{value:function(n){e(n);var i,o=t(this._url.query);return o.some(function(e){var t=r(e);return t[0]===n?(i=t[1],!0):void 0}),i},enumerable:!0},set:{value:function(o,a){e(o),e(a);var s=t(this._url.query),l=s.some(function(e,t){var n=r(e);return n[0]===o?(n[1]=a,s[t]=i(n),!0):void 0});l||s.push(i([o,a])),this._url.query=n(s)},enumerable:!0},has:{value:function(n){e(n);var i=t(this._url.query);return i.some(function(e){var t=r(e);return t[0]===n?!0:void 0})},enumerable:!0},"delete":{value:function(i){e(i);var o=t(this._url.query),a=o.filter(function(e){var t=r(e);return t[0]!==i});return a.length!==o.length?(this._url.query=n(a),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(e,t){if("function"!=typeof e)throw new TypeError;var n=o(this._url,"keys+values");try{for(;;){var r=n.next();e.call(t,r[1],r[0],this)}}catch(i){if(i!==A)throw i}},enumerable:!0},keys:{value:function(){return o(this._url,"keys")},enumerable:!0},values:{value:function(){return o(this._url,"values")},enumerable:!0},items:{value:function(){return o(this._url,"keys+values")}},size:{get:function(){return t(this._url.query).length},enumerable:!0},getAll:{value:function(n){e(n);var i=[],o=t(this._url.query);return o.forEach(function(e){var t=r(e);t[0]===n&&i.push(t[1])}),i},enumerable:!0},append:{value:function(r,o){e(r),e(o);var a=t(this._url.query);a.push(i([r,o])),this._url.query=n(a)},enumerable:!0}}),Object.defineProperties(m.prototype,{toString:{value:function(){return this.href}},href:{get:function(){return this._url?h(this._url):this._input},set:function(t){e(t),this._input=t,this._url=d(this._input,this._baseURL)},enumerable:!0},origin:{get:function(){return this._url&&this._url.host?this.protocol+"//"+this.host:""},enumerable:!0},protocol:{get:function(){return this._url?this._url.scheme+":":":"},set:function(t){if(e(t),this._url){var n=":"===t.slice(-1)?t.substring(0,t.length-1):t;(""===n||S.test(n))&&(this._url.scheme=l(n))}},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(t){e(t),this._url&&(this._url.userinfo=t)}},username:{get:function(){if(!this._url)return"";var e=L.exec(this._userinfo),t=decodeURIComponent(e[1]||"");return t},set:function(t){if(e(t),this._url){var n=L.exec(this._userinfo),r=[encodeURIComponent(t||"")];n[2]&&r.push(n[2]),this._userinfo=r.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var e=L.exec(this._userinfo),t=decodeURIComponent(e[2]||"");return t},set:function(t){if(e(t),this._url){var n=L.exec(this._userinfo),r=[n[1]||""];t&&r.push(encodeURIComponent(t)),this._userinfo=r.join(":")}},enumerable:!0},host:{get:function(){var e="";return this._url&&this._url.host&&(e+=this._url.host,this._url.port&&(e+=":"+this._url.port)),e},set:function(t){if(e(t),this._url){var n=_.exec(t);n&&(this._url.host=n[1],this._url.port=c(n[2]))}},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(t){if(e(t),this._url){var n=w.exec(t);n&&(this._url.host=t)}},enumerable:!0},port:{get:function(){var e=this._url?this._url.port||"":"";return e&&e===P[this.protocol]&&(e=""),e},set:function(t){if(e(t),this._url){var n=E.exec(t);n&&(this._url.port=c(t))}},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(t){if(e(t),this._url){var n=k.exec(t);n&&(this._url.host&&t&&"/"!==t[0]&&(t="/"+t),this._url.path=t?u(t):"")}},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(t){if(e(t),this._url){t&&"?"===t[0]&&(t=t.substring(1));var n=C.exec(t);n&&(this._url.query=t)}},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(t){if(e(t),this._url){t&&"#"===t[0]&&(t=t.substring(1));var n=T.exec(t);n&&(this._url.fragment=t)}},enumerable:!0}});var j=self.URL||self.webkitURL;j&&j.createObjectURL&&(Object.defineProperty(m,"createObjectURL",{value:j.createObjectURL.bind(j),enumerable:!1}),Object.defineProperty(m,"revokeObjectURL",{value:j.revokeObjectURL.bind(j),enumerable:!1})),self.URL=m}(),n("orion/URL-shim",function(){}),n("javascript/plugins/javascriptPlugin",["orion/plugin","orion/bootstrap","orion/Deferred","orion/fileClient","orion/metrics","esprima/esprima","estraverse/estraverse","javascript/scriptResolver","javascript/astManager","javascript/quickFixes","javascript/contentAssist/ternAssist","javascript/validator","javascript/occurrences","javascript/hover","javascript/outliner","javascript/cuProvider","javascript/ternProjectManager","orion/util","javascript/logger","javascript/commands/generateDocCommand","javascript/commands/openDeclaration","javascript/commands/openImplementation","javascript/commands/renameCommand","javascript/commands/refsCommand","orion/gSearchClient","orion/editor/stylers/application_javascript/syntax","orion/editor/stylers/application_json/syntax","orion/editor/stylers/application_schema_json/syntax","orion/editor/stylers/application_x-ejs/syntax","i18n!javascript/nls/messages","orion/URL-shim"],function(e,t,n,r,i,o,a,s,l,c,u,p,f,d,h,m,g,v,y,b,x,S,E,w,_,k,C,T,L,A){var P=new e({name:A.pluginName,version:"1.0",description:A.pluginDescription});t.startup().then(function(e){function t(e,t,n){var r=new URL(e,window.location.href);r.query.set("worker-language",navigator.language),this.worker=new Worker(r.href),this.worker.onmessage=t.bind(this),this.worker.onerror=n.bind(this),this.worker.postMessage("start_worker"),this.messageId=0,this.callbacks=Object.create(null)}function j(e){var t={request:"read",ternID:e.ternID,args:{}};if("object"==typeof e.args.file){var n=e.args.file.logical;t.args.logical=n,R.getWorkspaceFile(n).then(function(r){if(r&&r.length>0){var i=R.resolveRelativeFiles(n,r,{location:e.args.file.file,contentType:{name:"JavaScript"}});if(i&&i.length>0)return N.read(i[0].location).then(function(e){t.args.contents=e,t.args.file=i[0].location,t.args.path=i[0].path,G.postMessage(t)});t.args.error="Failed to read file "+n,G.postMessage(t)}else t.args.error="Failed to read file "+n,G.postMessage(t)},function(e){t.args.error="Failed to read file "+n,t.args.message=e.toString(),G.postMessage(t)})}else{var r=e.args.file;t.args.file=r;try{return N.read(r).then(function(e){t.args.contents=e,G.postMessage(t)},function(e){t.args.message=e.toString(),t.args.error="Failed to read file "+r,G.postMessage(t)})}catch(i){t.args.message=i.toString(),t.args.error="Failed to read file "+r,G.postMessage(t)}}}function F(){G.startServer()}function O(){function e(e){var n=e.keys();for(t=0,r=n.length;r>t;t++){var i=n[t];/^tern.$/.test(i)&&e.remove(n[t])}e.sync(!0)}M=!0;for(var t=0,r=V.length;r>t;t++){var i=V[t];G.postMessage(i.msg,i.f)}V=[],G.postMessage({request:"installed_plugins"},function(r){var i=r.plugins;return U?U.getPreferences("/cm/configurations").then(function(n){var r=n.get("tern");e(n),r?"string"==typeof r&&(r=JSON.parse(r)):r=Object.create(null);var o=Object.keys(i),a=r.plugins?r.plugins:Object.create(null);for(t=0;t
+ Copyright (C) 2013 Thaddee Tyl
+ Copyright (C) 2013 Mathias Bynens
+ Copyright (C) 2012 Ariya Hidayat
+ Copyright (C) 2012 Mathias Bynens
+ Copyright (C) 2012 Joost-Wim Boekesteijn
+ Copyright (C) 2012 Kris Kowal
+ Copyright (C) 2012 Yusuke Suzuki
+ Copyright (C) 2012 Arpad Borsos
+ Copyright (C) 2011 Ariya Hidayat
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/*******************************************************************************
+ * @license
+ * Copyright (c) 2010, 2014 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0
+ * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
+ * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+/*******************************************************************************
+ * @license
+ * Copyright (c) 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0
+ * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
+ * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+/*******************************************************************************
+ * @license
+ * Copyright (c) 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0
+ * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
+ * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+/*
+ Copyright (C) 2012-2013 Yusuke Suzuki
+ Copyright (C) 2012 Ariya Hidayat
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/**
+ * @fileoverview Defines environment settings and globals.
+ * @author Elan Shanker
+ * @copyright 2014 Elan Shanker. All rights reserved.
+ */
+
+/*******************************************************************************
+ * @license
+ * Copyright (c) 2013, 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0
+ * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
+ * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+/*******************************************************************************
+ * @license
+ * Copyright (c) 2012 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0
+ * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
+ * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+/*******************************************************************************
+ * @license
+ * Copyright (c) 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0
+ * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
+ * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+/*******************************************************************************
+ * @license
+ * Copyright (c) 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0
+ * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
+ * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
+ *
+ * Contributors:
+ * IBM Corporation - Allow original requirejs plugin to find files in Orion workspace
+ *******************************************************************************/
+
+/**
+ * @license RequireJS text 2.0.12 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/requirejs/text for details
+ */
+
+/*******************************************************************************
+ * @license
+ * Copyright (c) 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0
+ * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
+ * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+/**
+ * @license RequireJS i18n 2.0.4 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/requirejs/i18n for details
+ */
+
+/*******************************************************************************
+ * @license
+ * Copyright (c) 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0
+ * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
+ * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
+ *
+ ******************************************************************************/
+
+/*******************************************************************************
+ * @license
+ * Copyright (c) 2014, 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0
+ * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
+ * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
+ *
+ ******************************************************************************/
+
+/*******************************************************************************
+ * @license
+ * Copyright (c) 2012, 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0
+ * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
+ * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+!function(e,t){"use strict";"function"==typeof define&&define.amd?define("esprima/esprima",["exports"],t):t("undefined"!=typeof exports?exports:e.esprima={})}(this,function(e){"use strict";function t(e,t){if(!e)throw new Error("ASSERT: "+t)}function r(e){return e>=48&&57>=e}function n(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function o(e){return"01234567".indexOf(e)>=0}function s(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function a(e){return 10===e||13===e||8232===e||8233===e}function i(e){return 36===e||95===e||e>=65&&90>=e||e>=97&&122>=e||92===e||e>=128&&Dr.NonAsciiIdentifierStart.test(String.fromCharCode(e))}function l(e){return 36===e||95===e||e>=65&&90>=e||e>=97&&122>=e||e>=48&&57>=e||92===e||e>=128&&Dr.NonAsciiIdentifierPart.test(String.fromCharCode(e))}function c(e){switch(e){case"class":case"enum":case"export":case"extends":case"import":case"super":return!0;default:return!1}}function p(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}}function d(e){return"eval"===e||"arguments"===e}function u(e){if(zr&&p(e))return!0;switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e||"let"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}}function h(e,r,n,o,s){var a;t("number"==typeof n,"Comment must have valid position"),Vr.lastCommentStart=n,a={type:e,value:r},$r.range&&(a.range=[n,o]),$r.loc&&(a.loc=s),$r.comments.push(a),$r.attachComment&&($r.leadingComments.push(a),$r.trailingComments.push(a))}function f(e){var t,r,n,o;for(t=Cr-e,r={start:{line:Pr,column:Cr-Ir-e}};Br>Cr;)if(n=Ar.charCodeAt(Cr),++Cr,a(n))return Nr=!0,$r.comments&&(o=Ar.slice(t+e,Cr-1),r.end={line:Pr,column:Cr-Ir-1},h("Line",o,t,Cr-1,r)),13===n&&10===Ar.charCodeAt(Cr)&&++Cr,++Pr,void(Ir=Cr);$r.comments&&(o=Ar.slice(t+e,Cr),r.end={line:Pr,column:Cr-Ir},h("Line",o,t,Cr,r))}function m(){var e,t,r,n;for($r.comments&&(e=Cr-2,t={start:{line:Pr,column:Cr-Ir-2}});Br>Cr;)if(r=Ar.charCodeAt(Cr),a(r))13===r&&10===Ar.charCodeAt(Cr+1)&&++Cr,Nr=!0,++Pr,++Cr,Ir=Cr;else if(42===r){if(47===Ar.charCodeAt(Cr+1))return++Cr,++Cr,void($r.comments&&(n=Ar.slice(e+2,Cr-2),t.end={line:Pr,column:Cr-Ir},h("Block",n,e,Cr,t)));++Cr}else++Cr;Cr>=Br&&$r.comments?(t.end={line:Pr,column:Cr-Ir},n=Ar.slice(e+2,Cr),h("Block",n,e,Cr,t),Z()):Q()}function g(){var e,t;for(Nr=!1,t=0===Cr;Br>Cr;)if(e=Ar.charCodeAt(Cr),s(e))++Cr;else if(a(e))Nr=!0,++Cr,13===e&&10===Ar.charCodeAt(Cr)&&++Cr,++Pr,Ir=Cr,t=!0;else if(47===e)if(e=Ar.charCodeAt(Cr+1),47===e)++Cr,++Cr,f(2),t=!0;else{if(42!==e)break;++Cr,++Cr,m()}else if(t&&45===e){if(45!==Ar.charCodeAt(Cr+1)||62!==Ar.charCodeAt(Cr+2))break;Cr+=3,f(3)}else{if(60!==e)break;if("!--"!==Ar.slice(Cr+1,Cr+4))break;++Cr,++Cr,++Cr,++Cr,f(4)}}function b(e){var t,r,o,s=0;for(r="u"===e?4:2,t=0;r>t;++t){if(!(Br>Cr&&n(Ar[Cr])))return"";o=Ar[Cr++],s=16*s+"0123456789abcdef".indexOf(o.toLowerCase())}return String.fromCharCode(s)}function y(){var e,t,r,o;for(e=Ar[Cr],t=0,"}"===e&&Q();Br>Cr&&(e=Ar[Cr++],n(e));)t=16*t+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||"}"!==e)&&Q(),65535>=t?String.fromCharCode(t):(r=(t-65536>>10)+55296,o=(t-65536&1023)+56320,String.fromCharCode(r,o))}function v(){var e,t;for(e=Ar.charCodeAt(Cr++),t=String.fromCharCode(e),92===e&&(117!==Ar.charCodeAt(Cr)&&Q(),++Cr,e=b("u"),e&&"\\"!==e&&i(e.charCodeAt(0))||Q(),t=e);Br>Cr&&(e=Ar.charCodeAt(Cr),l(e));)++Cr,t+=String.fromCharCode(e),92===e&&(t=t.substr(0,t.length-1),117!==Ar.charCodeAt(Cr)&&Q(),++Cr,e=b("u"),e&&"\\"!==e&&l(e.charCodeAt(0))||Q(),t+=e);return t}function w(){var e,t;for(e=Cr++;Br>Cr;){if(t=Ar.charCodeAt(Cr),92===t)return Cr=e,v();if(!l(t))break;++Cr}return Ar.slice(e,Cr)}function _(){var e,t,r;return e=Cr,t=92===Ar.charCodeAt(Cr)?v():w(),r=1===t.length?Er.Identifier:u(t)?Er.Keyword:"null"===t?Er.NullLiteral:"true"===t||"false"===t?Er.BooleanLiteral:Er.Identifier,{type:r,value:t,lineNumber:Pr,lineStart:Ir,start:e,end:Cr}}function S(){var e,t,r,n,o=Cr,s=Ar.charCodeAt(Cr),a=Ar[Cr];switch(s){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++Cr,$r.tokenize&&(40===s?$r.openParenToken=$r.tokens.length:123===s&&($r.openCurlyToken=$r.tokens.length)),{type:Er.Punctuator,value:String.fromCharCode(s),lineNumber:Pr,lineStart:Ir,start:o,end:Cr};default:if(e=Ar.charCodeAt(Cr+1),61===e)switch(s){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return Cr+=2,{type:Er.Punctuator,value:String.fromCharCode(s)+String.fromCharCode(e),lineNumber:Pr,lineStart:Ir,start:o,end:Cr};case 33:case 61:return Cr+=2,61===Ar.charCodeAt(Cr)&&++Cr,{type:Er.Punctuator,value:Ar.slice(o,Cr),lineNumber:Pr,lineStart:Ir,start:o,end:Cr}}}if(n=Ar.substr(Cr,4),">>>="===n)return Cr+=4,{type:Er.Punctuator,value:n,lineNumber:Pr,lineStart:Ir,start:o,end:Cr};if(r=n.substr(0,3),">>>"===r||"<<="===r||">>="===r)return Cr+=3,{type:Er.Punctuator,value:r,lineNumber:Pr,lineStart:Ir,start:o,end:Cr};if(t=r.substr(0,2),a===t[1]&&"+-<>&|".indexOf(a)>=0||"=>"===t)return Cr+=2,{type:Er.Punctuator,value:t,lineNumber:Pr,lineStart:Ir,start:o,end:Cr};if("<>=!+-*%&|^/".indexOf(a)>=0)return++Cr,{type:Er.Punctuator,value:a,lineNumber:Pr,lineStart:Ir,start:o,end:Cr};++Cr;var i={type:Er.Punctuator,lineNumber:Pr,lineStart:Ir,start:o,end:Cr,value:Ar.slice(o,Cr)};Q(i)}function T(e){for(var t="";Br>Cr&&n(Ar[Cr]);)t+=Ar[Cr++];return 0===t.length&&Q(),i(Ar.charCodeAt(Cr))&&Q(),{type:Er.NumericLiteral,value:parseInt("0x"+t,16),lineNumber:Pr,lineStart:Ir,start:e,end:Cr}}function E(e){var t,n;for(n="";Br>Cr&&(t=Ar[Cr],"0"===t||"1"===t);)n+=Ar[Cr++];return 0===n.length&&Q(),Br>Cr&&(t=Ar.charCodeAt(Cr),(i(t)||r(t))&&Q()),{type:Er.NumericLiteral,value:parseInt(n,2),lineNumber:Pr,lineStart:Ir,start:e,end:Cr}}function x(e,t){var n,s;for(o(e)?(s=!0,n="0"+Ar[Cr++]):(s=!1,++Cr,n="");Br>Cr&&o(Ar[Cr]);)n+=Ar[Cr++];return s||0!==n.length||Q(),(i(Ar.charCodeAt(Cr))||r(Ar.charCodeAt(Cr)))&&Q(),{type:Er.NumericLiteral,value:parseInt(n,8),octal:s,lineNumber:Pr,lineStart:Ir,start:t,end:Cr}}function j(){var e,t;for(e=Cr+1;Br>e;++e){if(t=Ar[e],"8"===t||"9"===t)return!1;if(!o(t))return!0}return!0}function O(){var e,n,s;if(s=Ar[Cr],t(r(s.charCodeAt(0))||"."===s,"Numeric literal must start with a decimal digit or a decimal point"),n=Cr,e="","."!==s){if(e=Ar[Cr++],s=Ar[Cr],"0"===e){if("x"===s||"X"===s)return++Cr,T(n);if("b"===s||"B"===s)return++Cr,E(n);if("o"===s||"O"===s)return x(s,n);if(o(s)&&j())return x(s,n)}for(;r(Ar.charCodeAt(Cr));)e+=Ar[Cr++];s=Ar[Cr]}if("."===s){for(e+=Ar[Cr++];r(Ar.charCodeAt(Cr));)e+=Ar[Cr++];s=Ar[Cr]}if("e"===s||"E"===s)if(e+=Ar[Cr++],s=Ar[Cr],("+"===s||"-"===s)&&(e+=Ar[Cr++]),r(Ar.charCodeAt(Cr)))for(;r(Ar.charCodeAt(Cr));)e+=Ar[Cr++];else Q();return i(Ar.charCodeAt(Cr))&&Q(),{type:Er.NumericLiteral,value:parseFloat(e),lineNumber:Pr,lineStart:Ir,start:n,end:Cr}}function k(){var e,r,n,s,i,l,c="",p=!1;for(e=Ar[Cr],t("'"===e||'"'===e,"String literal must starts with a quote"),r=Cr,++Cr;Br>Cr;){if(n=Ar[Cr++],n===e){e="";break}if("\\"===n)if(n=Ar[Cr++],n&&a(n.charCodeAt(0)))++Pr,"\r"===n&&"\n"===Ar[Cr]&&++Cr,Ir=Cr;else switch(n){case"u":case"x":"{"===Ar[Cr]?(++Cr,c+=y()):(l=Cr,i=b(n),i?c+=i:(Cr=l,c+=n));break;case"n":c+="\n";break;case"r":c+="\r";break;case"t":c+=" ";break;case"b":c+="\b";break;case"f":c+="\f";break;case"v":c+="";break;default:o(n)?(s="01234567".indexOf(n),0!==s&&(p=!0),Br>Cr&&o(Ar[Cr])&&(p=!0,s=8*s+"01234567".indexOf(Ar[Cr++]),"0123".indexOf(n)>=0&&Br>Cr&&o(Ar[Cr])&&(s=8*s+"01234567".indexOf(Ar[Cr++]))),c+=String.fromCharCode(s)):c+=n}else{if(a(n.charCodeAt(0)))break;c+=n}}var d={type:Er.StringLiteral,value:c,octal:p,lineNumber:Gr,lineStart:Wr,start:r,end:Cr};return""!==e&&Z(d),d}function R(e,t){var r=e;t.indexOf("u")>=0&&(r=r.replace(/\\u\{([0-9a-fA-F]+)\}/g,function(e,t){return parseInt(t,16)<=1114111?"x":void Q(null,Mr.InvalidRegExp)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{RegExp(r)}catch(n){Q(null,Mr.InvalidRegExp)}try{return new RegExp(e,t)}catch(o){return null}}function M(){var e,r,n,o,s;for(e=Ar[Cr],t("/"===e,"Regular expression literal must start with a slash"),r=Ar[Cr++],n=!1,o=!1;Br>Cr;)if(e=Ar[Cr++],r+=e,"\\"===e)e=Ar[Cr++],a(e.charCodeAt(0))&&Q(null,Mr.UnterminatedRegExp),r+=e;else if(a(e.charCodeAt(0)))Q(null,Mr.UnterminatedRegExp);else if(n)"]"===e&&(n=!1);else{if("/"===e){o=!0;break}"["===e&&(n=!0)}return o||Q(Jr,Mr.UnterminatedRegExp),s=r.substr(1,r.length-2),{value:s,literal:r}}function D(){var e,t,r,n;for(t="",r="";Br>Cr&&(e=Ar[Cr],l(e.charCodeAt(0)));)if(++Cr,"\\"===e&&Br>Cr)if(e=Ar[Cr],"u"===e){if(++Cr,n=Cr,e=b("u"))for(r+=e,t+="\\u";Cr>n;++n)t+=Ar[n];else Cr=n,r+="u",t+="\\u";Z()}else t+="\\",Z();else r+=e,t+=e;return{value:r,literal:t}}function A(){Hr=!0;var e,t,r,n;return g(),e=Cr,t=M(),r=D(),n=R(t.value,r.value),Hr=!1,$r.tokenize?{type:Er.RegularExpression,value:n,regex:{pattern:t.value,flags:r.value},lineNumber:Pr,lineStart:Ir,start:e,end:Cr}:{literal:t.literal+r.literal,value:n,regex:{pattern:t.value,flags:r.value},start:e,end:Cr}}function z(){var e,t,r,n;return g(),e=Cr,t={start:{line:Pr,column:Cr-Ir}},r=A(),t.end={line:Pr,column:Cr-Ir},$r.tokenize||($r.tokens.length>0&&(n=$r.tokens[$r.tokens.length-1],n.range[0]===e&&"Punctuator"===n.type&&("/"===n.value||"/="===n.value)&&$r.tokens.pop()),$r.tokens.push({type:"RegularExpression",value:r.literal,regex:r.regex,range:[e,Cr],loc:t})),r}function C(e){return e.type===Er.Identifier||e.type===Er.Keyword||e.type===Er.BooleanLiteral||e.type===Er.NullLiteral}function P(){var e,t;if(e=$r.tokens[$r.tokens.length-1],!e)return z();if("Punctuator"===e.type){if("]"===e.value)return S();if(")"===e.value)return t=$r.tokens[$r.openParenToken-1],!t||"Keyword"!==t.type||"if"!==t.value&&"while"!==t.value&&"for"!==t.value&&"with"!==t.value?S():z();if("}"===e.value){if($r.tokens[$r.openCurlyToken-3]&&"Keyword"===$r.tokens[$r.openCurlyToken-3].type){if(t=$r.tokens[$r.openCurlyToken-4],!t)return S()}else{if(!$r.tokens[$r.openCurlyToken-4]||"Keyword"!==$r.tokens[$r.openCurlyToken-4].type)return S();if(t=$r.tokens[$r.openCurlyToken-5],!t)return z()}return jr.indexOf(t.value)>=0?S():z()}return z()}return"Keyword"===e.type&&"this"!==e.value?z():S()}function I(){var e;return Cr>=Br?{type:Er.EOF,lineNumber:Pr,lineStart:Ir,start:Cr,end:Cr,range:[Cr,Cr]}:(e=Ar.charCodeAt(Cr),i(e)?_():40===e||41===e||59===e?S():39===e||34===e?k():46===e?r(Ar.charCodeAt(Cr+1))?O():S():r(e)?O():$r.tokenize&&47===e?P():S())}function N(){var e,t,r,n;return e={start:{line:Pr,column:Cr-Ir}},t=I(),e.end={line:Pr,column:Cr-Ir},t.type!==Er.EOF&&(r=Ar.slice(t.start,t.end),n={type:xr[t.type],value:r,range:[t.start,t.end],loc:e},t.regex&&(n.regex={pattern:t.regex.pattern,flags:t.regex.flags}),$r.tokens.push(n)),t}function U(){var e;return Hr=!0,Ur=Cr,Lr=Pr,qr=Ir,g(),e=Jr,Fr=Cr,Gr=Pr,Wr=Ir,Jr="undefined"!=typeof $r.tokens?N():I(),Hr=!1,e}function L(){Hr=!0,g(),Ur=Cr,Lr=Pr,qr=Ir,Fr=Cr,Gr=Pr,Wr=Ir,Jr="undefined"!=typeof $r.tokens?N():I(),Hr=!1}function q(e){if($r.deps)for(var t=e.length,r=0;t>r;r++)F(e[r])}function F(e){if($r.deps&&e.type===Or.Literal){for(var t=0;t<$r.deps.length;t++)if($r.deps[t].value===e.value)return;$r.deps.push(e)}}function G(e,t){if($r.deps){var r=t.length;if("importScripts"===e.name)q(t);else if("Worker"===e.name)F(t[0]);else if("require"===e.name){var n=t[0];n.type===Or.ArrayExpression?($r.envs.node=!0,q(n.elements)):n.type===Or.Literal&&($r.envs.node=!0,F(n)),r>1&&(n=t[1],n.type===Or.ArrayExpression&&($r.envs.node=!0,q(n.elements)))}else"requirejs"===e.name?(n=t[0],n.type===Or.ArrayExpression&&($r.envs.amd=!0,q(n.elements))):"define"===e.name&&r>1&&(n=t[0],n.type===Or.Literal&&(n=t[1]),n.type===Or.ArrayExpression&&($r.envs.amd=!0,q(n.elements)))}}function W(){this.line=Gr,this.column=Fr-Wr}function H(){this.start=new W,this.end=null}function B(e){this.start={line:e.lineNumber,column:e.start-e.lineStart},this.end=null}function J(){$r.loc&&(this.loc=new H),$r.range&&(this.range=[Fr,0]),$r.directSourceFile&&(this.sourceFile=$r.directSourceFile)}function V(e){$r.loc&&(this.loc=new B(e)),$r.range&&(this.range=[e.start,0]),$r.directSourceFile&&(this.sourceFile=$r.directSourceFile)}function $(e,t,r,n){var o=new Error("Line "+e+": "+r);if(o.index=t,o.lineNumber=e,o.column=t-(Hr?Ir:qr)+1,o.description=r,n){var s=n;2===n.type&&$r&&Array.isArray($r.tokens)&&$r.tokens.length>0&&(s=$r.tokens[$r.tokens.length-1]),o.index="number"==typeof s.start?s.start:s.range[0],o.token=s.value,o.end="number"==typeof s.end?s.end:s.range[1]}return o}function X(e){var r,n;throw r=Array.prototype.slice.call(arguments,1),n=e.replace(/%(\d)/g,function(e,n){return t(n0&&(t=$r.tokens[$r.tokens.length-2]),Z(t,Mr.MissingToken,r)}else t.type!==Er.EOF&&($r.tokens&&$r.tokens.length>0&&(t=$r.tokens[$r.tokens.length-2]),Z(t,Mr.MissingToken,","));else et(",")}function rt(e){var t=U();(t.type!==Er.Keyword||t.value!==e)&&Q(t)}function nt(e){return Jr.type===Er.Punctuator&&Jr.value===e}function ot(e){return Jr.type===Er.Keyword&&Jr.value===e}function st(){var e;return Jr.type!==Er.Punctuator?!1:(e=Jr.value,"="===e||"*="===e||"/="===e||"%="===e||"+="===e||"-="===e||"<<="===e||">>="===e||">>>="===e||"&="===e||"^="===e||"|="===e)}function at(){try{if(59===Ar.charCodeAt(Fr)||nt(";"))return void U();if(Nr)return;if(Ur=Fr,Lr=Gr,qr=Wr,Jr.type!==Er.EOF&&!nt("}")){var e=Jr;$r.errors&&vr(Wr),Q(e)}}catch(t){if($r.errors)return void gr(t);throw t}}function it(e){return e.type===Or.Identifier||e.type===Or.MemberExpression}function lt(){var e=[],t=new J;for(et("[");!nt("]");)nt(",")?(U(),e.push(null)):(e.push(Mt()),nt("]")||et(","));return U(),t.finishArrayExpression(e)}function ct(e,t){var r,n,o=new J;return r=zr,n=nr(),t&&zr&&d(e[0].name)&&Z(t,Mr.StrictParamName),zr=r,o.finishFunctionExpression(null,e,[],n)}function pt(){var e,t=new J;return e=U(),e.type===Er.StringLiteral||e.type===Er.NumericLiteral?(zr&&e.octal&&Z(e,Mr.StrictOctalLiteral),t.finishLiteral(e)):t.finishIdentifier(e.value)}function dt(){var e,t,r,n,o,s=new J;return e=Jr,e.type===Er.Identifier?(r=pt(),"get"!==e.value||nt(":")||nt("(")?"set"!==e.value||nt(":")||nt("(")?Tr(e,r,s):(t=pt(),et("("),e=Jr,e.type!==Er.Identifier?(et(")"),Z(e),n=ct([])):(o=[Ct()],et(")"),n=ct(o,e)),s.finishProperty("set",t,n,!1,!1)):(t=pt(),et("("),et(")"),n=ct([]),s.finishProperty("get",t,n,!1,!1))):e.type!==Er.EOF&&e.type!==Er.Punctuator?Tr(e,pt(),s):void Q(e)}function ut(){var e,t,r,n,o=[],s={},a=String,i=new J;for(et("{");!nt("}");)e=dt(),null!=e&&"undefined"!=typeof e&&(t=e.key.type===Or.Identifier?e.key.name:a(e.key.value),n="init"===e.kind?Rr.Data:"get"===e.kind?Rr.Get:Rr.Set,r="$"+t,Object.prototype.hasOwnProperty.call(s,r)?(s[r]===Rr.Data?zr&&n===Rr.Data?Y(Mr.StrictDuplicateProperty):n!==Rr.Data&&Y(Mr.AccessorDataProperty):n===Rr.Data?Y(Mr.AccessorDataProperty):s[r]&n&&Y(Mr.AccessorGetSet),s[r]|=n):s[r]=n,o.push(e),nt("}")||tt("}"));return et("}"),i.finishObjectExpression(o)}function ht(){var e;return et("("),nt(")")?(U(),kr.ArrowParameterPlaceHolder):(++Vr.parenthesisCount,e=Dt(),et(")"),e)}function ft(){var e,t,r,n;if(nt("("))return ht();if(nt("["))return lt();if(nt("{"))return ut();if(e=Jr.type,n=new J,e===Er.Identifier)r=n.finishIdentifier(U().value);else if(e===Er.StringLiteral||e===Er.NumericLiteral)zr&&Jr.octal&&Z(Jr,Mr.StrictOctalLiteral),r=n.finishLiteral(U());else if(e===Er.Keyword){if(ot("function"))return lr();ot("this")?(U(),r=n.finishThisExpression()):Q(U())}else e===Er.BooleanLiteral?(t=U(),t.value="true"===t.value,r=n.finishLiteral(t)):e===Er.NullLiteral?(t=U(),t.value=null,r=n.finishLiteral(t)):nt("/")||nt("/=")?(Cr=Fr,t="undefined"!=typeof $r.tokens?z():A(),U(),r=n.finishLiteral(t)):Q(U());return r}function mt(){var e=[];if(et("("),!nt(")"))for(;Br>Fr&&(e.push(Mt()),!nt(")"));)tt(")");return mr(")"),e}function gt(){var e,t=new J;try{e=U(),C(e)||($r.errors&&_r(e),Q(e))}catch(r){if($r.errors)return gr(r),Sr(t,Or.Identifier);throw r}return t.finishIdentifier(e.value)}function bt(){return et("."),gt()}function yt(){var e;return et("["),e=Dt(),et("]"),e}function vt(){var e,t,r=new J;return rt("new"),e=_t(),t=nt("(")?mt():[],r.finishNewExpression(e,t)}function wt(){var e,t,r,n,o=Vr.allowIn;for(n=Jr,Vr.allowIn=!0,e=ot("new")?vt():ft();;)if(nt("."))r=bt(),e=new V(n).finishMemberExpression(".",e,r);else if(nt("("))t=mt(),e=new V(n).finishCallExpression(e,t);else{if(!nt("["))break;r=yt(),e=new V(n).finishMemberExpression("[",e,r)}return Vr.allowIn=o,e}function _t(){var e,r,n;for(t(Vr.allowIn,"callee of new expression always allow in keyword."),n=Jr,e=ot("new")?vt():ft();;)if(nt("["))r=yt(),e=new V(n).finishMemberExpression("[",e,r);else{if(!nt("."))break;r=bt(),e=new V(n).finishMemberExpression(".",e,r)}return e}function St(){var e,t,r=Jr;return e=wt(),Nr||Jr.type!==Er.Punctuator||(nt("++")||nt("--"))&&(zr&&e.type===Or.Identifier&&d(e.name)&&Y(Mr.StrictLHSPostfix),it(e)||Y(Mr.InvalidLHSInAssignment),t=U(),e=new V(r).finishPostfixExpression(t.value,e)),e}function Tt(){var e,t,r;return Jr.type!==Er.Punctuator&&Jr.type!==Er.Keyword?t=St():nt("++")||nt("--")?(r=Jr,e=U(),t=Tt(),zr&&t.type===Or.Identifier&&d(t.name)&&Y(Mr.StrictLHSPrefix),it(t)||Y(Mr.InvalidLHSInAssignment),t=new V(r).finishUnaryExpression(e.value,t)):nt("+")||nt("-")||nt("~")||nt("!")?(r=Jr,e=U(),t=Tt(),t=new V(r).finishUnaryExpression(e.value,t)):ot("delete")||ot("void")||ot("typeof")?(r=Jr,e=U(),t=Tt(),t=new V(r).finishUnaryExpression(e.value,t),zr&&"delete"===t.operator&&t.argument.type===Or.Identifier&&Y(Mr.StrictDelete)):t=St(),t}function Et(e,t){var r=0;if(e.type!==Er.Punctuator&&e.type!==Er.Keyword)return 0;switch(e.value){case"||":r=1;break;case"&&":r=2;break;case"|":r=3;break;case"^":r=4;break;case"&":r=5;break;case"==":case"!=":case"===":case"!==":r=6;break;case"<":case">":case"<=":case">=":case"instanceof":r=7;break;case"in":r=t?7:0;break;case"<<":case">>":case">>>":r=8;break;case"+":case"-":r=9;break;case"*":case"/":case"%":r=11}return r}function xt(){var e,t,r,n,o,s,a,i,l,c;if(e=Jr,l=Tt(),l===kr.ArrowParameterPlaceHolder)return l;if(n=Jr,o=Et(n,Vr.allowIn),0===o)return l;for(n.prec=o,U(),t=[e,Jr],a=Tt(),s=[l,n,a];(o=Et(Jr,Vr.allowIn))>0;){for(;s.length>2&&o<=s[s.length-2].prec;)a=s.pop(),i=s.pop().value,l=s.pop(),t.pop(),r=new V(t[t.length-1]).finishBinaryExpression(i,l,a),s.push(r);n=U(),n.prec=o,s.push(n),t.push(Jr),r=Tt(),s.push(r)}for(c=s.length-1,r=s[c],t.pop();c>1;)r=new V(t.pop()).finishBinaryExpression(s[c-1].value,s[c-2],r),c-=2;return r}function jt(){var e,t,r,n,o;return o=Jr,e=xt(),e===kr.ArrowParameterPlaceHolder?e:(nt("?")&&(U(),t=Vr.allowIn,Vr.allowIn=!0,r=Mt(),Vr.allowIn=t,et(":"),n=Mt(),e=new V(o).finishConditionalExpression(e,r,n)),e)}function Ot(){return nt("{")?nr():Mt()}function kt(e){var t,r,n,o,s,a,i,l,c;for(o=[],s=[],a=0,l=null,i={paramSet:{}},t=0,r=e.length;r>t;t+=1)if(n=e[t],n.type===Or.Identifier)o.push(n),s.push(null),or(i,n,n.name);else{if(n.type!==Or.AssignmentExpression)return null;o.push(n.left),s.push(n.right),++a,or(i,n.left,n.left.name)}return i.message===Mr.StrictParamDupe&&(c=zr?i.stricted:i.firstRestricted,Q(c,i.message)),0===a&&(s=[]),{params:o,defaults:s,rest:l,stricted:i.stricted,firstRestricted:i.firstRestricted,message:i.message}}function Rt(e,t){var r,n;return et("=>"),r=zr,n=Ot(),zr&&e.firstRestricted&&Q(e.firstRestricted,e.message),zr&&e.stricted&&Z(e.stricted,e.message),zr=r,t.finishArrowFunctionExpression(e.params,e.defaults,n,n.type!==Or.BlockStatement)}function Mt(){var e,t,r,n,o,s;return e=Vr.parenthesisCount,s=Jr,t=Jr,r=jt(),r!==kr.ArrowParameterPlaceHolder&&!nt("=>")||Vr.parenthesisCount!==e&&Vr.parenthesisCount!==e+1||(r.type===Or.Identifier?o=kt([r]):r.type===Or.AssignmentExpression?o=kt([r]):r.type===Or.SequenceExpression?o=kt(r.expressions):r===kr.ArrowParameterPlaceHolder&&(o=kt([])),!o)?(st()&&(it(r)||Y(Mr.InvalidLHSInAssignment),zr&&r.type===Or.Identifier&&d(r.name)&&Z(t,Mr.StrictLHSAssignment),t=U(),n=Mt(),r=new V(s).finishAssignmentExpression(t.value,r,n)),r):Rt(o,new V(s))}function Dt(){var e,t,r=Jr;if(e=Mt(),nt(",")){for(t=[e];Br>Fr&&nt(",");)U(),t.push(Mt());e=new V(r).finishSequenceExpression(t)}return e}function At(){for(var e,t=[],r=Cr;Br>Fr&&!nt("}")&&(e=cr(),"undefined"!=typeof e&&r!==Cr);)t.push(e),r=Cr;return t}function zt(){var e,t=new J;return et("{"),e=At(),mr("}"),t.finishBlockStatement(e)}function Ct(){var e,t=new J;return e=U(),e.type!==Er.Identifier&&(zr&&e.type===Er.Keyword&&p(e.value)?Z(e,Mr.StrictReservedWord):Q(e)),t.finishIdentifier(e.value)}function Pt(e){var t,r=null,n=new J;return t=Ct(),zr&&d(t.name)&&Y(Mr.StrictVarName),"const"===e?(et("="),r=Mt()):nt("=")&&(U(),r=Mt()),n.finishVariableDeclarator(t,r)}function It(e){var t=[];do{if(t.push(Pt(e)),!nt(","))break;U()}while(Br>Fr);return t}function Nt(e){var t;return rt("var"),t=It(),at(),e.finishVariableDeclaration(t,"var")}function Ut(e){var t,r=new J;return rt(e),t=It(e),at(),r.finishVariableDeclaration(t,e)}function Lt(){var e=new J;return et(";"),e.finishEmptyStatement()}function qt(e){var t=Dt();return at(),t||(t=Sr(e)),e.finishExpressionStatement(t)}function Ft(e){var t,r,n;return rt("if"),et("("),t=Dt(),mr(")","{"),r=rr(),ot("else")?(U(),n=rr()):n=null,e.finishIfStatement(t,r,n)}function Gt(e){var t,r,n;return rt("do"),n=Vr.inIteration,Vr.inIteration=!0,t=rr(),Vr.inIteration=n,rt("while"),et("("),r=Dt(),mr(")","{"),nt(";")&&U(),e.finishDoWhileStatement(t,r)}function Wt(e){var t,r,n;return rt("while"),et("("),t=Dt(),mr(")","{"),n=Vr.inIteration,Vr.inIteration=!0,r=rr(),Vr.inIteration=n,e.finishWhileStatement(t,r)}function Ht(){var e,t,r=new J;return e=U(),t=It(),r.finishVariableDeclaration(t,e.value)}function Bt(e){var t,r,n,o,s,a,i,l=Vr.allowIn;return t=r=n=null,rt("for"),et("("),nt(";")?U():(ot("var")||ot("let")?(Vr.allowIn=!1,t=Ht(),Vr.allowIn=l,1===t.declarations.length&&ot("in")&&(U(),o=t,s=Dt(),t=null)):(Vr.allowIn=!1,t=Dt(),Vr.allowIn=l,ot("in")&&(it(t)||Y(Mr.InvalidLHSInForIn),U(),o=t,s=Dt(),t=null)),"undefined"==typeof o&&et(";")),"undefined"==typeof o&&(nt(";")||(r=Dt()),et(";"),nt(")")||(n=Dt())),mr(")","{"),i=Vr.inIteration,Vr.inIteration=!0,a=rr(),Vr.inIteration=i,"undefined"==typeof o?e.finishForStatement(t,r,n,a):e.finishForInStatement(o,s,a)}function Jt(e){var t,r=null;if(rt("continue"),59===Ar.charCodeAt(Fr))return U(),Vr.inIteration||X(Mr.IllegalContinue),e.finishContinueStatement(null);if(Nr)return Vr.inIteration||X(Mr.IllegalContinue),e.finishContinueStatement(null);if(Jr.type===Er.Identifier){var n=Jr;r=Ct(),t="$"+r.name,Object.prototype.hasOwnProperty.call(Vr.labelSet,t)||Z(n,Mr.UnknownLabel,r.name)}return at(),null!==r||Vr.inIteration||X(Mr.IllegalContinue),e.finishContinueStatement(r)}function Vt(e){var t,r=null;return rt("break"),59===Ar.charCodeAt(Ur)?(U(),Vr.inIteration||Vr.inSwitch||X(Mr.IllegalBreak),e.finishBreakStatement(null)):Nr?(Vr.inIteration||Vr.inSwitch||X(Mr.IllegalBreak),e.finishBreakStatement(null)):(Jr.type===Er.Identifier&&(r=Ct(),t="$"+r.name,Object.prototype.hasOwnProperty.call(Vr.labelSet,t)||X(Mr.UnknownLabel,r.name)),at(),null!==r||Vr.inIteration||Vr.inSwitch||X(Mr.IllegalBreak),e.finishBreakStatement(r))}function $t(e){var t=null,r=Jr;return rt("return"),Vr.inFunctionBody||Z(r,Mr.IllegalReturn,r.value),32===Ar.charCodeAt(Ur)&&i(Ar.charCodeAt(Ur+1))?(t=Dt(),at(),e.finishReturnStatement(t)):Nr?e.finishReturnStatement(null):(nt(";")||nt("}")||Jr.type===Er.EOF||(t=Dt()),at(),e.finishReturnStatement(t))}function Xt(e){var t,r;return zr&&Y(Mr.StrictModeWith),rt("with"),et("("),t=Dt(),mr(")","{"),r=rr(),e.finishWithStatement(t,r)}function Yt(){var e,t,r=[],n=new J;ot("default")?(U(),e=null):(rt("case"),e=Dt()),nt(":")&&U();for(var o=Cr;Br>Fr&&!(nt("}")||ot("default")||ot("case"))&&(t=rr(),"undefined"!=typeof t&&null!==t)&&(r.push(t),o!==Cr);)o=Cr;return n.finishSwitchCase(e,r)}function Kt(e){var t,r,n,o,s;if(rt("switch"),et("("),t=Dt(),et(")"),et("{"),r=[],nt("}"))return U(),e.finishSwitchStatement(t,r);for(o=Vr.inSwitch,Vr.inSwitch=!0,s=!1;Br>Fr&&!nt("}");)n=Yt(),null===n.test&&(s&&X(Mr.MultipleDefaultsInSwitch),s=!0),r.push(n);return Vr.inSwitch=o,et("}"),e.finishSwitchStatement(t,r)}function Qt(e){var t;return rt("throw"),Nr&&X(Mr.NewlineAfterThrow),t=Dt(),at(),e.finishThrowStatement(t)}function Zt(){var e,t,r=new J;return rt("catch"),et("("),nt(")")&&Q(Jr),e=Ct(),zr&&d(e.name)&&Y(Mr.StrictCatchVariable),et(")"),t=zt(),r.finishCatchClause(e,t)}function er(e){var t,r=[],n=null;return rt("try"),t=zt(),ot("catch")&&r.push(Zt()),ot("finally")&&(U(),n=zt()),0!==r.length||n||X(Mr.NoCatchOrFinally),e.finishTryStatement(t,[],r,n)}function tr(e){return rt("debugger"),at(),e.finishDebuggerStatement()}function rr(){var e,t,r,n,o=Jr.type;if(o===Er.EOF&&Q(Jr),o===Er.Punctuator&&"{"===Jr.value)return zt();if(n=new J,o===Er.Punctuator)switch(Jr.value){case";":return Lt(n);case"(":return qt(n)}else if(o===Er.Keyword)switch(Jr.value){case"break":return Vt(n);case"continue":return Jt(n);case"debugger":return tr(n);case"do":return Gt(n);case"for":return Bt(n);case"function":return ir(n);case"if":return Ft(n);case"return":return $t(n);case"switch":return Kt(n);case"throw":return Qt(n);case"try":return er(n);case"var":return Nt(n);case"while":return Wt(n);case"with":return Xt(n)}return e=Dt(),e&&e.type===Or.Identifier&&nt(":")?(U(),r="$"+e.name,Object.prototype.hasOwnProperty.call(Vr.labelSet,r)&&X(Mr.Redeclaration,"Label",e.name),Vr.labelSet[r]=!0,t=rr(),delete Vr.labelSet[r],n.finishLabeledStatement(e,t)):(at(),e||(e=Sr(n)),n.finishExpressionStatement(e))}function nr(){var e,t,r,n,o,s,a,i,l,c=[],p=new J;for(et("{");Br>Fr&&Jr.type===Er.StringLiteral&&(t=Jr,e=cr(),c.push(e),e.expression.type===Or.Literal);)r=Ar.slice(t.start+1,t.end-1),"use strict"===r?(zr=!0,n&&Z(n,Mr.StrictOctalLiteral)):!n&&t.octal&&(n=t);o=Vr.labelSet,s=Vr.inIteration,a=Vr.inSwitch,i=Vr.inFunctionBody,l=Vr.parenthesizedCount,Vr.labelSet={},Vr.inIteration=!1,Vr.inSwitch=!1,Vr.inFunctionBody=!0,Vr.parenthesizedCount=0;for(var d=Cr;Br>Cr&&!nt("}")&&(e=cr(),"undefined"!=typeof e&&null!=e)&&(c.push(e),d!==Cr);)d=Cr;return mr("}"),Vr.labelSet=o,Vr.inIteration=s,Vr.inSwitch=a,Vr.inFunctionBody=i,Vr.parenthesizedCount=l,p.finishBlockStatement(c)}function or(e,t,r){var n="$"+r;zr?(d(r)&&(e.stricted=t,e.message=Mr.StrictParamName),Object.prototype.hasOwnProperty.call(e.paramSet,n)&&(e.stricted=t,e.message=Mr.StrictParamDupe)):e.firstRestricted||(d(r)?(e.firstRestricted=t,e.message=Mr.StrictParamName):p(r)?(e.firstRestricted=t,e.message=Mr.StrictReservedWord):Object.prototype.hasOwnProperty.call(e.paramSet,n)&&(e.firstRestricted=t,e.message=Mr.StrictParamDupe)),e.paramSet[n]=!0}function sr(e){var t,r,n;return t=Jr,r=Ct(),or(e,t,t.value),nt("=")&&(U(),n=Mt(),++e.defaultCount),e.params.push(r),e.defaults.push(n),!nt(")")}function ar(e){var t;if(t={params:[],defaultCount:0,defaults:[],firstRestricted:e},et("("),!nt(")"))for(t.paramSet={};Br>Fr&&sr(t);)et(",");return et(")"),0===t.defaultCount&&(t.defaults=[]),{params:t.params,defaults:t.defaults,stricted:t.stricted,firstRestricted:t.firstRestricted,message:t.message}}function ir(){var e,t,r,n,o,s,a,i,l=[],c=[],u=new J;return rt("function"),r=Jr,e=Ct(),zr?d(r.value)&&Z(r,Mr.StrictFunctionName):d(r.value)?(s=r,a=Mr.StrictFunctionName):p(r.value)&&(s=r,a=Mr.StrictReservedWord),o=ar(s),l=o.params,c=o.defaults,n=o.stricted,s=o.firstRestricted,o.message&&(a=o.message),i=zr,t=nr(),zr&&s&&Q(s,a),zr&&n&&Z(n,a),zr=i,u.finishFunctionDeclaration(e,l,c,t)}function lr(){var e,t,r,n,o,s,a,i=null,l=[],c=[],u=new J;return rt("function"),nt("(")||(e=Jr,i=Ct(),zr?d(e.value)&&Z(e,Mr.StrictFunctionName):d(e.value)?(r=e,n=Mr.StrictFunctionName):p(e.value)&&(r=e,n=Mr.StrictReservedWord)),o=ar(r),l=o.params,c=o.defaults,t=o.stricted,r=o.firstRestricted,o.message&&(n=o.message),a=zr,s=nr(),zr&&r&&Q(r,n),zr&&t&&Z(t,n),zr=a,u.finishFunctionExpression(i,l,c,s)}function cr(){if(Jr.type===Er.Keyword)switch(Jr.value){case"const":case"let":return Ut(Jr.value);case"function":return ir();default:return rr()}return Jr.type!==Er.EOF?rr():void 0}function pr(){for(var e,t,r,n,o=[];Br>Fr&&(t=Jr,t.type===Er.StringLiteral)&&(e=cr(),o.push(e),e.expression.type===Or.Literal);)r=Ar.slice(t.start+1,t.end-1),"use strict"===r?(zr=!0,n&&Z(n,Mr.StrictOctalLiteral)):!n&&t.octal&&(n=t);for(var s=Cr;Br>Fr&&(e=cr(),"undefined"!=typeof e&&null!==e)&&(o.push(e),s!==Cr);)s=Cr;return o}function dr(){var e,t;return L(),t=new J,zr=!1,e=pr(),t.finishProgram(e)}function ur(){var e,t,r,n=[];for(e=0;e<$r.tokens.length;++e)t=$r.tokens[e],r={type:t.type,value:t.value},t.regex&&(r.regex={pattern:t.regex.pattern,flags:t.regex.flags}),$r.range&&(r.range=t.range),$r.loc&&(r.loc=t.loc),n.push(r);$r.tokens=n}function hr(e,t){var r,n;r=String,"string"==typeof e||e instanceof String||(e=r(e)),Ar=e,Cr=0,Pr=Ar.length>0?1:0,Ir=0,Fr=Cr,Gr=Pr,Wr=Ir,Br=Ar.length,Jr=null,Vr={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},$r={},t=t||{},t.tokens=!0,$r.tokens=[],$r.tokenize=!0,$r.openParenToken=-1,$r.openCurlyToken=-1,$r.range="boolean"==typeof t.range&&t.range,$r.loc="boolean"==typeof t.loc&&t.loc,"boolean"==typeof t.comment&&t.comment&&($r.comments=[]),"boolean"==typeof t.tolerant&&t.tolerant&&($r.errors=[]);try{if(L(),Jr.type===Er.EOF)return $r.tokens;for(U();Jr.type!==Er.EOF;)try{U()}catch(o){if($r.errors){$r.errors.push(o);break}throw o}ur(),n=$r.tokens,"undefined"!=typeof $r.comments&&(n.comments=$r.comments),"undefined"!=typeof $r.errors&&(n.errors=$r.errors)}catch(s){throw s}finally{$r={}}return n}function fr(e,t){var r,n;n=String,"string"==typeof e||e instanceof String||(e=n(e)),Ar=e,Cr=0,Pr=Ar.length>0?1:0,Ir=0,Fr=Cr,Gr=Pr,Wr=Ir,Br=Ar.length,Jr=null,Vr={allowIn:!0,labelSet:{},parenthesisCount:0,inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},$r={},"undefined"!=typeof t&&("boolean"==typeof t.deps&&t.deps&&($r.deps=[],$r.envs=Object.create(null)),$r.range="boolean"==typeof t.range&&t.range,$r.loc="boolean"==typeof t.loc&&t.loc,$r.attachComment="boolean"==typeof t.attachComment&&t.attachComment,$r.loc&&null!==t.source&&void 0!==t.source&&($r.source=n(t.source)),"boolean"==typeof t.tokens&&t.tokens&&($r.tokens=[]),"boolean"==typeof t.comment&&t.comment&&($r.comments=[]),"boolean"==typeof t.tolerant&&t.tolerant&&($r.errors=[],$r.parseStatement=rr,$r.parseExpression=Dt,rr=yr(rr),Dt=br(Dt)),$r.attachComment&&($r.range=!0,$r.comments=[],$r.bottomRightStack=[],$r.trailingComments=[],$r.leadingComments=[]),$r.directSourceFile=t.directSourceFile);
+try{r=dr(),"undefined"!=typeof $r.comments&&(r.comments=$r.comments),"undefined"!=typeof $r.tokens&&(ur(),r.tokens=$r.tokens),"undefined"!=typeof $r.errors&&(r.errors=$r.errors),"undefined"!=typeof $r.deps&&(r.dependencies=$r.deps,r.environments=$r.envs)}catch(o){throw o}finally{"undefined"!=typeof $r.errors&&(rr=$r.parseStatement,Dt=$r.parseExpression),$r={}}return r}function mr(e,t){try{et(e)}catch(r){if(!$r.errors)throw r;gr(r),t&&Ar[r.index]===t&&(Cr=r.index,L())}}function gr(e){for(var t=$r.errors.length,r=0;t>r;r++){var n=$r.errors[r];if(n.index===e.index&&n.message===e.message)return}$r.errors.push(e)}function br(e){return function(){try{return e.apply(null,arguments)}catch(t){gr(t)}}}function yr(e){return function(){$r.statementStart=Cr;try{return e.apply(null,arguments)}catch(t){gr(t)}}}function vr(e){for(var t=e;t>-1&&";"!==Ar[t]&&"\n"!==Ar[t];)t--;if(!(t<=$r.statementStart)){var r=!1;$r.lastRewindLocation?r=!0:$r.lastRewindLocation!==t&&(r=!0),r&&(Cr=t,wr(e),L(),$r.lastRewindLocation=Cr)}}function wr(e,t){for(var r=$r.tokens.length-1;r>-1;){var n=$r.tokens[r];if(n.range[0]",xr[Er.Identifier]="Identifier",xr[Er.Keyword]="Keyword",xr[Er.NullLiteral]="Null",xr[Er.NumericLiteral]="Numeric",xr[Er.Punctuator]="Punctuator",xr[Er.StringLiteral]="String",xr[Er.RegularExpression]="RegularExpression",jr=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="],Or={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",ArrowFunctionExpression:"ArrowFunctionExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},kr={ArrowParameterPlaceHolder:{type:"ArrowParameterPlaceHolder"}},Rr={Data:1,Get:2,Set:4},Mr={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",MissingToken:"Missing expected '%0'"},Dr={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢲऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԯԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠ-ࢲࣤ-ॣ०-९ॱ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఀ-ఃఅ-ఌఎ-ఐఒ-నప-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಁ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲഁ-ഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟ෦-෯ෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤞᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧ᪰-᪽ᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶ᳸᳹ᴀ-᷵᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚝꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꧠ-ꧾꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︭︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},V.prototype=J.prototype={processComment:function(){var e,t,r,n,o,s=$r.bottomRightStack,a=s[s.length-1];if(!(this.type===Or.Program&&this.body.length>0)){if($r.trailingComments.length>0){for(r=[],n=$r.trailingComments.length-1;n>=0;--n)o=$r.trailingComments[n],o.range[0]>=this.range[1]&&(r.unshift(o),$r.trailingComments.splice(n,1));$r.trailingComments=[]}else a&&a.trailingComments&&a.trailingComments[0].range[0]>=this.range[1]&&(r=a.trailingComments,delete a.trailingComments);if(a)for(;a&&a.range[0]>=this.range[0];)e=a,a=s.pop();if(e)e.leadingComments&&e.leadingComments[e.leadingComments.length-1].range[1]<=this.range[0]&&(this.leadingComments=e.leadingComments,e.leadingComments=void 0);else if($r.leadingComments.length>0)for(t=[],n=$r.leadingComments.length-1;n>=0;--n)o=$r.leadingComments[n],o.range[1]<=this.range[0]&&(t.unshift(o),$r.leadingComments.splice(n,1));t&&t.length>0&&(this.leadingComments=t),r&&r.length>0&&(this.trailingComments=r),s.push(this)}},finish:function(){$r.loc&&(this.loc.end={line:Lr,column:Ur-qr},$r.source&&(this.loc.source=$r.source)),$r.range&&(this.range[1]=Ur,this.start=this.range[0],this.end=Ur),$r.attachComment&&this.processComment()},finishArrayExpression:function(e){return this.type=Or.ArrayExpression,this.elements=e,this.finish(),this},finishArrowFunctionExpression:function(e,t,r,n){return this.type=Or.ArrowFunctionExpression,this.id=null,this.params=e,this.defaults=t,this.body=r,this.rest=null,this.generator=!1,this.expression=n,this.finish(),this},finishAssignmentExpression:function(e,t,r){return this.type=Or.AssignmentExpression,this.operator=e,this.left=t,this.right=r,this.finish(),this},finishBinaryExpression:function(e,t,r){return this.type="||"===e||"&&"===e?Or.LogicalExpression:Or.BinaryExpression,this.operator=e,this.left=t,this.right=r,this.finish(),this},finishBlockStatement:function(e){return this.type=Or.BlockStatement,this.body=e,this.finish(),this},finishBreakStatement:function(e){return this.type=Or.BreakStatement,this.label=e,this.finish(),this},finishCallExpression:function(e,t){return this.type=Or.CallExpression,this.callee=e,this.arguments=t,G(e,t),this.finish(),this},finishCatchClause:function(e,t){return this.type=Or.CatchClause,this.param=e,this.body=t,this.finish(),this},finishConditionalExpression:function(e,t,r){return this.type=Or.ConditionalExpression,this.test=e,this.consequent=t,this.alternate=r,this.finish(),this},finishContinueStatement:function(e){return this.type=Or.ContinueStatement,this.label=e,this.finish(),this},finishDebuggerStatement:function(){return this.type=Or.DebuggerStatement,this.finish(),this},finishDoWhileStatement:function(e,t){return this.type=Or.DoWhileStatement,this.body=e,this.test=t,this.finish(),this},finishEmptyStatement:function(){return this.type=Or.EmptyStatement,this.finish(),this},finishExpressionStatement:function(e){return this.type=Or.ExpressionStatement,this.expression=e,this.finish(),this},finishForStatement:function(e,t,r,n){return this.type=Or.ForStatement,this.init=e,this.test=t,this.update=r,this.body=n,this.finish(),this},finishForInStatement:function(e,t,r){return this.type=Or.ForInStatement,this.left=e,this.right=t,this.body=r?r:Sr(this,"Statement"),this.each=!1,this.finish(),this},finishFunctionDeclaration:function(e,t,r,n){return this.type=Or.FunctionDeclaration,this.id=e,this.params=t,this.defaults=r,this.body=n,this.rest=null,this.generator=!1,this.expression=!1,this.finish(),this},finishFunctionExpression:function(e,t,r,n){return this.type=Or.FunctionExpression,this.id=e,this.params=t,this.defaults=r,this.body=n,this.rest=null,this.generator=!1,this.expression=!1,this.finish(),this},finishIdentifier:function(e){return this.type=Or.Identifier,this.name=e,this.finish(),this},finishIfStatement:function(e,t,r){return this.type=Or.IfStatement,this.test=e,this.consequent=t?t:Sr(this,"Statement"),this.alternate=r,this.finish(),this},finishLabeledStatement:function(e,t){return this.type=Or.LabeledStatement,this.label=e,this.body=t,this.finish(),this},finishLiteral:function(e){return this.type=Or.Literal,this.value=e.value,this.raw=Ar.slice(e.start,e.end),e.regex&&(this.regex=e.regex),this.finish(),this},finishMemberExpression:function(e,t,r){return this.type=Or.MemberExpression,this.computed="["===e,this.object=t,this.property=r,this.finish(),this},finishNewExpression:function(e,t){return this.type=Or.NewExpression,this.callee=e,this.arguments=t,G(e,t),this.finish(),this},finishObjectExpression:function(e){return this.type=Or.ObjectExpression,this.properties=e,this.finish(),this},finishPostfixExpression:function(e,t){return this.type=Or.UpdateExpression,this.operator=e,this.argument=t,this.prefix=!1,this.finish(),this},finishProgram:function(e){return this.type=Or.Program,this.body=e,this.finish(),this},finishProperty:function(e,t,r,n,o){return this.type=Or.Property,this.key=t,this.value=r,this.kind=e,this.method=n,this.shorthand=o,this.finish(),this},finishReturnStatement:function(e){return this.type=Or.ReturnStatement,this.argument=e,this.finish(),this},finishSequenceExpression:function(e){return this.type=Or.SequenceExpression,this.expressions=e,this.finish(),this},finishSwitchCase:function(e,t){return this.type=Or.SwitchCase,this.test=e,this.consequent=t,this.finish(),this},finishSwitchStatement:function(e,t){return this.type=Or.SwitchStatement,this.discriminant=e,this.cases=t,this.finish(),this},finishThisExpression:function(){return this.type=Or.ThisExpression,this.finish(),this},finishThrowStatement:function(e){return this.type=Or.ThrowStatement,this.argument=e,this.finish(),this},finishTryStatement:function(e,t,r,n){return this.type=Or.TryStatement,this.block=e,this.guardedHandlers=t,this.handlers=r,this.finalizer=n,this.finish(),this},finishUnaryExpression:function(e,t){return this.type="++"===e||"--"===e?Or.UpdateExpression:Or.UnaryExpression,this.operator=e,this.argument=t,this.prefix=!0,this.finish(),this},finishVariableDeclaration:function(e,t){return this.type=Or.VariableDeclaration,this.declarations=e,this.kind=t,this.finish(),this},finishVariableDeclarator:function(e,t){return this.type=Or.VariableDeclarator,this.id=e,this.init=t,this.finish(),this},finishWhileStatement:function(e,t){return this.type=Or.WhileStatement,this.test=e,this.body=t?t:Sr(this,"Statement"),this.finish(),this},finishWithStatement:function(e,t){return this.type=Or.WithStatement,this.object=e,this.body=t?t:Sr(this,"Statement"),this.finish(),this}},e.version="2.0.0",e.tokenize=hr,e.parse=fr,e.isIdentifierPart=l,e.isIdentifierStart=i,e.isIdentifierChar=l,e.Syntax=function(){var e,t={};"function"==typeof Object.create&&(t=Object.create(null));for(e in Or)Or.hasOwnProperty(e)&&(t[e]=Or[e]);return"function"==typeof Object.freeze&&Object.freeze(t),t}()}),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define("acorn/dist/walk",[],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(t.acorn||(t.acorn={})).walk=e()}}(function(){return function e(t,r,n){function o(a,i){if(!r[a]){if(!t[a]){var l="function"==typeof require&&require;if(!i&&l)return l(a,!0);if(s)return s(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var p=r[a]={exports:{}};t[a][0].call(p.exports,function(e){var r=t[a][1][e];return o(r?r:e)},p,p.exports,e,t,r,n)}return r[a].exports}for(var s="function"==typeof require&&require,a=0;a=n)&&s[i](e,r,c),o(i,e)&&(null==t||e.start==t)&&(null==n||e.end==n))throw new m(e,r)}(e,a)}catch(l){if(l instanceof m)return l;throw l}}function c(e,t,n,o,s){n=i(n),o||(o=r.base);try{!function l(e,r,s){var a=s||e.type;if(!(e.start>t||e.end=t&&n(a,e))throw new m(e,r);o[a](e,r,l)}}(e,s)}catch(a){if(a instanceof m)return a;throw a}}function d(e,t,n,o,s){n=i(n),o||(o=r.base);var a=void 0;return function l(e,r,s){if(!(e.start>t)){var i=s||e.type;e.end<=t&&(!a||a.node.end ")){var g=this.pos;u=this.parseType(!0),u.call&&(n?(h=u,u=t.ANull,f=g):i=!0)}else u=t.ANull;return i?s(o,u):(n&&(m=this.base)?t.Fn.call(this.base,r,t.ANull,o,a,u):m=new t.Fn(r,t.ANull,o,a,u),h&&(m.computeRet=h),null!=f&&(m.computeRetSource=this.spec.slice(f,this.pos)),m)},parseType:function(e,r,n){var o=this.parseTypeMaybeProp(e,r,n);if(!this.eat("|"))return o;for(var s=[o],i=o.call;;){var l=this.parseTypeMaybeProp(e,r,n);if(s.push(l),l.call&&(i=!0),!this.eat("|"))break}if(i)return a(s);for(var c=new t.AVal,p=0;p$!]/)||this.error();return e.apply?function(r,n){return o(e(r,n),t)}:o(e,t)},parseTypeInner:function(e,r,n){if(this.eat("fn("))return this.parseFnType(e,r,n);if(this.eat("[")){var o=this.parseType(e);return this.eat("]")||this.error(),o.call?i(o):n&&this.base?(t.Arr.call(this.base,o),this.base):new t.Arr(o)}if(this.eat("+")){var s=this.word(/[\w$<>\.!]/),a=w(s+".prototype");return a instanceof t.Obj||(a=w(s)),a instanceof t.Obj?e&&this.eat("[")?this.parsePoly(a):n&&this.forceNew?new t.Obj(a):t.getInstance(a):a}if(e&&this.eat("!")){var l=this.word(/\d/);if(l)return l=Number(l),function(e,r){return r[l]||t.ANull};if(this.eat("this"))return function(e){return e};if(this.eat("custom:")){var c=this.word(/[\w$]/);return _[c]||function(){return t.ANull}}return this.fromWord("!"+this.word(/[\w$<>\.!]/))}return this.eat("?")?t.ANull:this.fromWord(this.word(/[\w$<>\.!`]/))},fromWord:function(e){var r=t.cx();switch(e){case"number":return r.num;case"string":return r.str;case"bool":return r.bool;case"":return r.topScope}return r.localDefs&&e in r.localDefs?r.localDefs[e]:w(e)},parsePoly:function(e){var r,n="";(r=this.spec.slice(this.pos).match(/^\s*(\w+)\s*=\s*/))&&(n=r[1],this.pos+=r[0].length);var o=this.parseType(!0);if(this.eat("]")||this.error(),o.call)return function(r,s){var a=t.getInstance(e);return o(r,s).propagate(a.defProp(n)),a};var s=t.getInstance(e);return o.propagate(s.defProp(n)),s}};var y,v=e.parseEffect=function(e,r){var o;if(0==e.indexOf("propagate ")){var s=new b(e,10),a=s.parseType(!0);s.eat(" ")||s.error();var i=s.parseType(!0);c(r,function(e,t){n(a,e,t).propagate(n(i,e,t))})}else if(0==e.indexOf("call ")){var l=5==e.indexOf("and return ",5),s=new b(e,l?16:5),p=s.parseType(!0),d=null,u=[];for(s.eat(" this=")&&(d=s.parseType(!0));s.eat(" ");)u.push(s.parseType(!0));c(r,function(e,r){for(var o=n(p,e,r),s=d?n(d,e,r):t.ANull,a=[],i=0;i"!=e&&s.propagate(new t.PropHasSubset(e,r))})})}},w=e.parsePath=function(e,r){var n=t.cx(),o=n.paths[e],s=e;if(null!=o)return o;n.paths[e]=t.ANull;var a=r||y||n.topScope;if(n.localDefs)for(var i in n.localDefs)if(0==e.indexOf(i)){if(e==i)return n.paths[e]=n.localDefs[e];if("."==e.charAt(i.length)){a=n.localDefs[i],e=e.slice(i.length+1);break}}for(var l=e.split("."),c=0;c=3&&"Literal"==n[1].type&&"string"==typeof n[1].value){var o=r[0],s=new t.AVal;o.propagate(new t.PropHasSubset(n[1].value,s,n[1])),r[2].propagate(new T(s))}return t.ANull}),t.registerFunction("Object_defineProperties",function(e,r,n){if(r.length>=2){var o=r[0];r[1].forAllProps(function(e,r,s){if(s){var a=new t.AVal;o.propagate(new t.PropHasSubset(e,a,n&&n[1])),r.propagate(new T(a))}})}return t.ANull});var E=t.constraint({construct:function(e,t,r){this.self=e,this.args=t,this.target=r
+},addType:function(e){if(e instanceof t.Fn){this.target.addType(new t.Fn(e.name,t.ANull,e.args.slice(this.args.length),e.argNames.slice(this.args.length),e.retval)),this.self.propagate(e.self);for(var r=0;r"),s=0;s=5)return t;if(!e||e==t)return e;if(!t)return e;if(e.constructor!=t.constructor)return!1;if(e.constructor!=it){if(e.constructor==st){var n=0,o=0,s=0;for(var l in e.props)n++,l in t.props&&a(e.props[l],t.props[l],r+1)&&s++;for(var l in t.props)o++;return n&&o&&so?e:t}return e.constructor==at&&e.args.length==t.args.length&&e.args.every(function(e,n){return a(e,t.args[n],r+1)})&&a(e.retval,t.retval,r+1)&&a(e.self,t.self,r+1)?e:!1}var c=e.getProp("").getType(!1);if(!c)return t;var p=t.getProp("").getType(!1);return!p||i(c,p,r+1)?t:void 0}function l(e){for(var t=0,r=0,n=0,o=null,s=0;s1)return null;if(o)return o;for(var l=0,c=null,s=0;s").isEmpty()?1:2;else if(r){p=1;for(var d=0;d=l&&(l=p,c=a)}return c}function c(e,t){lt.disabledComputing={fn:e,prev:lt.disabledComputing};try{return t()}finally{lt.disabledComputing=lt.disabledComputing.prev}}function p(e,t){var r=lt.props[e]||(lt.props[e]=[]);r.push(t)}function d(e){return lt.props[e]}function u(t){if(lt.workList)return t(lt.workList);var r=[],n=0,o=lt.workList=function(e,t,o){n=ct)throw new e.TimedOut;n=r[a+3]+1,r[a+1].addType(r[a],r[a+2])}return s}finally{lt.workList=null}}function h(e,t){e.fnType&&(e.fnType.instantiateScore=(e.fnType.instantiateScore||0)+t)}function f(e,t){try{return r.simple(e,{Expression:function(){if(--t<=0)throw ht}}),!0}catch(n){if(n==ht)return!1;throw n}}function m(e,t){var r=t.fnType.instantiateScore;return!lt.disabledComputing&&r&&t.fnType.args.length&&f(e,5*r)?(h(t.prev,r/2),g(e,t),!0):void(t.fnType.instantiateScore=null)}function g(e,t){for(var n=t.fnType,o=0;o3)&&e.forward)for(var s=0;s"));for(var i=t(r.self,"!this",0),l=0;!i&&l"):n.name}function w(e){switch(e){case"+":case"-":case"~":return lt.num;case"!":return lt.bool;case"typeof":return lt.str;case"void":case"delete":return z}}function _(e){switch(e){case"==":case"!=":case"===":case"!==":case"<":case">":case">=":case"<=":case"in":case"instanceof":return!0}}function S(e){if(e.regex)return Y(lt.protos.RegExp);switch(typeof e.value){case"boolean":return lt.bool;case"number":return lt.num;case"string":return lt.str;case"object":case"function":return e.value?Y(lt.protos.RegExp):z}}function T(e){return function(t,r,n,o,s){var a=e(t,r,n,s);return o&&a.propagate(o),a}}function E(e){return function(t,r,n,o,s){return o||(o=new F),e(t,r,n,o,s),o}}function x(e,t,r,n,o){var s=mt[e.type];return s?s(e,t,r,n,o):void 0}function j(e,t){var r=e&&e[t],n=Array.prototype.slice.call(arguments,2);if(r)for(var o=0;o-1}:function(n,o){return o&&o.start>=t&&o.end<=r&&e.indexOf(n.origin)>-1}:null==r?function(t){return t.origin==e}:function(n,o){return o&&o.start>=t&&o.end<=r&&n.origin==e}}function M(e){St=!0;var t=d(e);if(t)for(var r=0;rt?"?":e.toString(t,r)},z=e.ANull=o.mixin({addType:function(){},propagate:function(){},getProp:function(){return z},forAllProps:function(){},hasType:function(){return!1},isEmpty:function(){return!0},getFunctionType:function(){},getObjType:function(){},getType:function(){},gatherProperties:function(){},propagatesTo:function(){},typeHint:function(){},propHint:function(){},toString:function(){return"?"}}),C=100,P=90,I=10,N=5,U=5,L=90,q=2,F=e.AVal=function(){this.types=[],this.forward=null,this.maxWeight=0};F.prototype=s(z,{addType:function(e,t){if(t=t||C,this.maxWeightt||this.types.indexOf(e)>-1)return;this.signal("addType",e),this.types.push(e);var r=this.forward;r&&u(function(n){for(var o=0;o2)){t&&t!=C&&(e=new rt(e,t)),(this.forward||(this.forward=[])).push(e);var r=this.types;r.length&&u(function(n){for(var o=0;o-1},isEmpty:function(){return 0===this.types.length},getFunctionType:function(){for(var e=this.types.length-1;e>=0;--e)if(this.types[e]instanceof at)return this.types[e]},getObjType:function(){for(var e=null,t=this.types.length-1;t>=0;--t){var r=this.types[t];if(r instanceof st){if(r.name)return r;e||(e=r)}}return e},getType:function(e){return 0===this.types.length&&e!==!1?this.makeupType():1===this.types.length?this.types[0]:l(this.types)},toString:function(e,t){if(0==this.types.length)return A(this.makeupType(),e,t);if(1==this.types.length)return A(this.types[0],e,t);var r=G(this.types);return r.length>2?"?":r.map(function(r){return A(r,e,t)}).join("|")},computedPropType:function(){if(!this.propertyOf)return null;if(this.propertyOf.hasProp("")){var e=this.propertyOf.getProp("");return e==this?null:e.getType()}if(this.propertyOf.maybeProps&&this.propertyOf.maybeProps[""]==this){for(var t in this.propertyOf.props){var r=this.propertyOf.props[t];if(!r.isEmpty())return r}return null}},makeupType:function(){var e=this.computedPropType();if(e)return e;if(!this.forward)return null;for(var t=this.forward.length-1;t>=0;--t){var r=this.forward[t].typeHint();if(r&&!r.isEmpty())return St=!0,r}for(var n=Object.create(null),o=null,t=0;t"!=s&&"✖"!=s&&s!=lt.completingProperty&&(n[s]=!0,o=s)}if(!o)return null;var a=d(o);if(a){var i=[];e:for(var t=0;t"!=this.prop&&/[^\w_]/.test(this.prop)?void 0:{target:this.target,pathExt:"."+this.prop}}}),B=e.PropHasSubset=W({construct:function(e,t,r){this.prop=e,this.type=t,this.originNode=r},addType:function(e,t){if(e instanceof st){var r=e.defProp(this.prop,this.originNode);r.origin||(r.origin=this.origin),this.type.propagate(r,t)}},propHint:function(){return this.prop}}),J=W({construct:function(e){this.c=e},addType:function(e){e instanceof st&&e.forAllProps(this.c)}}),V=e.IsCallee=W({construct:function(e,t,r,n){this.self=e,this.args=t,this.argNodes=r,this.retval=n,this.disabled=lt.disabledComputing},addType:function(e,t){if(e instanceof at){for(var r=0;r8||this.target.addType(e==lt.protos.Array?new it:Y(e,this.ctor)))}}),Q=W({construct:function(e){this.fn=e},addType:function(e){if(e instanceof st&&!e.hasCtor){e.hasCtor=this.fn;var t=new tt(e,this.fn);t.addType(this.fn),e.forAllProps(function(e,r,n){n&&r.propagate(t)})}}}),Z=W({construct:function(e,t){this.other=e,this.target=t},addType:function(e,t){e==lt.str?this.target.addType(lt.str,t):e==lt.num&&this.other.hasType(lt.num)&&this.target.addType(lt.num,t)},typeHint:function(){return this.other}}),et=e.IfObj=W({construct:function(e){this.target=e},addType:function(e,t){e instanceof st&&this.target.addType(e,t)},propagatesTo:function(){return this.target}}),tt=W({construct:function(e,t){this.obj=e,this.ctor=t},addType:function(e){e instanceof at&&e.self&&e.self.isEmpty()&&e.self.addType(Y(this.obj,this.ctor),q)}}),rt=W({construct:function(e,t){this.inner=e,this.weight=t},addType:function(e,t){this.inner.addType(e,Math.min(t,this.weight))},propagatesTo:function(){return this.inner.propagatesTo()},typeHint:function(){return this.inner.typeHint()},propHint:function(){return this.inner.propHint()}}),nt=e.Type=function(){};nt.prototype=s(z,{constructor:nt,propagate:function(e,t){e.addType(this,t)},hasType:function(e){return e==this},isEmpty:function(){return!1},typeHint:function(){return this},getType:function(){return this}});var ot=e.Prim=function(e,t){this.name=t,this.proto=e};ot.prototype=s(nt.prototype,{constructor:ot,toString:function(){return this.name},getProp:function(e){return this.proto.hasProp(e)||z},gatherProperties:function(e,t){this.proto&&this.proto.gatherProperties(e,t)}});var st=e.Obj=function(e,t){if(this.props||(this.props=Object.create(null)),this.proto=e===!0?lt.protos.Object:e,e&&!t&&e.name&&!(this instanceof at)){var r=/^(.*)\.prototype$/.exec(this.proto.name);r&&(t=r[1])}this.name=t,this.maybeProps=null,this.origin=lt.curOrigin};st.prototype=s(nt.prototype,{constructor:st,toString:function(e){if(null==e&&(e=0),0>=e&&this.name)return this.name;var t=[],r=!1;for(var n in this.props)if(""!=n){if(t.length>5){r=!0;break}t.push(e?n+": "+A(this.props[n],e-1,this):n)}return t.sort(),r&&t.push("..."),"{"+t.join(", ")+"}"},hasProp:function(e,t){var r=this.props[e];if(t!==!1)for(var n=this.proto;n&&!r;n=n.proto)r=n.props[e];return r},defProp:function(e,t){var r=this.hasProp(e,!1);if(r)return t&&!r.originNode&&(r.originNode=t),r;if("__proto__"==e||"✖"==e)return z;var n=this.maybeProps&&this.maybeProps[e];return n?(delete this.maybeProps[e],this.maybeUnregProtoPropHandler()):(n=new F,n.propertyOf=this),this.props[e]=n,n.originNode=t,n.origin=lt.curOrigin,this.broadcastProp(e,n,!0),n},getProp:function(e){var t=this.hasProp(e,!0)||this.maybeProps&&this.maybeProps[e];if(t)return t;if("__proto__"==e||"✖"==e)return z;var r=this.ensureMaybeProps()[e]=new F;return r.propertyOf=this,r},broadcastProp:function(e,t,r){if(r&&(this.signal("addProp",e,t),this instanceof ut||p(e,this)),this.onNewProp)for(var n=0;n"!=r&&e(r,this,t);this.proto&&this.proto.gatherProperties(e,t+1)},getObjType:function(){return this}});var at=e.Fn=function(e,t,r,n,o){st.call(this,lt.protos.Function,e),this.self=t,this.args=r,this.argNames=n,this.retval=o};at.prototype=s(st.prototype,{constructor:at,toString:function(e){null==e&&(e=0);for(var t="fn(",r=0;r-3?A(this.args[r],e-1,this):"?"}return t+=")",this.retval.isEmpty()||(t+=" -> "+(e>-3?A(this.retval,e-1,this):"?")),t},getProp:function(e){if("prototype"==e){var t=this.hasProp(e,!1);if(!t){t=this.defProp(e);var r=new st(!0,this.name&&this.name+".prototype");r.origin=this.origin,t.addType(r,I)}return t}return st.prototype.getProp.call(this,e)},defProp:function(e,t){if("prototype"==e){var r=this.hasProp(e,!1);return r?r:(r=st.prototype.defProp.call(this,e,t),r.origin=this.origin,r.propagate(new Q(this)),r)}return st.prototype.defProp.call(this,e,t)},getFunctionType:function(){return this}});var it=e.Arr=function(e){st.call(this,lt.protos.Array);var t=this.defProp("");e&&e.propagate(t)};it.prototype=s(st.prototype,{constructor:it,toString:function(e){return null==e&&(e=0),"["+(e>-3?A(this.getProp(""),e-1,this):"?")+"]"}}),e.Context=function(t,r){this.parent=r,this.props=Object.create(null),this.protos=Object.create(null),this.origins=[],this.curOrigin="ecma5",this.paths=Object.create(null),this.definitions=Object.create(null),this.purgeGen=0,this.workList=null,this.disabledComputing=null,e.withContext(this,function(){if(lt.protos.Object=new st(null,"Object.prototype"),lt.topScope=new ut,lt.topScope.name="",lt.protos.Array=new st(!0,"Array.prototype"),lt.protos.Function=new at("Function.prototype",z,[],[],z),lt.protos.Function.proto=lt.protos.Object,lt.protos.RegExp=new st(!0,"RegExp.prototype"),lt.protos.String=new st(!0,"String.prototype"),lt.protos.Number=new st(!0,"Number.prototype"),lt.protos.Boolean=new st(!0,"Boolean.prototype"),lt.str=new ot(lt.protos.String,"string"),lt.bool=new ot(lt.protos.Boolean,"bool"),lt.num=new ot(lt.protos.Number,"number"),lt.curOrigin=null,t)for(var e=0;en)return t();ct=r;try{return t()}finally{ct=n}},e.addOrigin=function(e){lt.origins.indexOf(e)<0&<.origins.push(e)};var pt=20,dt=1e-4,ut=e.Scope=function(e){st.call(this,e||!0),this.prev=e};ut.prototype=s(st.prototype,{constructor:ut,defVar:function(e,t){for(var r=this;;r=r.proto){var n=r.props[e];if(n)return n;if(!r.prev)return r.defProp(e,t)}}});var ht={},ft=r.make({Function:function(e,t,r){var n=e.body.scope=new ut(t);n.originNode=e;for(var o=[],s=[],a=0;an;++n)x(e.expressions[n],t,r,z);return x(e.expressions[o],t,r)}),UnaryExpression:T(function(e,t,r){return x(e.argument,t,r,z),w(e.operator)}),UpdateExpression:T(function(e,t,r){return x(e.argument,t,r,z),lt.num}),BinaryExpression:T(function(e,t,r){if("+"==e.operator){var n=x(e.left,t,r),o=x(e.right,t,r);if(n.hasType(lt.str)||o.hasType(lt.str))return lt.str;if(n.hasType(lt.num)&&o.hasType(lt.num))return lt.num;var s=new F;return n.propagate(new Z(o,s)),o.propagate(new Z(n,s)),s}return x(e.left,t,r,z),x(e.right,t,r,z),_(e.operator)?lt.bool:lt.num}),AssignmentExpression:T(function(e,t,r){var n,o,s;if("MemberExpression"==e.left.type?(s=v(e.left,t,r),"Identifier"==e.left.object.type&&(o=e.left.object.name+"."+s)):o=e.left.name,"="!=e.operator&&"+="!=e.operator?(x(e.right,t,r,z),n=lt.num):n=x(e.right,t,r,null,o),"MemberExpression"==e.left.type){var a=x(e.left.object,t,r);if("prototype"==s&&h(t,20),""==s){var i=e.left.property.name,l=t.props[i],c=l&&l.iteratesOver;if(c){h(t,20);var p="MemberExpression"==e.right.type&&e.right.computed&&e.right.property.name==i;return c.forAllProps(function(e,t,r){r&&"prototype"!=e&&""!=e&&a.propagate(new B(e,p?t:z))}),n}}a.propagate(new B(s,n,e.left.property))}else n.propagate(t.defVar(e.left.name,e.left));return n}),LogicalExpression:E(function(e,t,r,n){x(e.left,t,r,n),x(e.right,t,r,n)}),ConditionalExpression:E(function(e,t,r,n){x(e.test,t,r,z),x(e.consequent,t,r,n),x(e.alternate,t,r,n)}),NewExpression:E(function(e,t,r,n,o){"Identifier"==e.callee.type&&e.callee.name in t.props&&h(t,20);for(var s=0,a=[];s-1&&h(t,30),a.propagate(new $(i,s,e.arguments,n))}else{var l=x(e.callee,t,r);t.fnType&&t.fnType.args.indexOf(l)>-1&&h(t,30);var c=l.getFunctionType();c&&c.instantiateScore&&t.fnType&&h(t,c.instantiateScore/5),l.propagate(new V(lt.topScope,s,e.arguments,n))}}),MemberExpression:E(function(e,t,r,n){var o=v(e,t),s=x(e.object,t,r),a=s.getProp(o);if(""==o){var i=x(e.property,t,r);if(!i.hasType(lt.num))return a.propagate(n,N)}a.propagate(n)}),Identifier:T(function(e,t){return"arguments"!=e.name||!t.fnType||e.name in t.props||t.defProp(e.name,t.fnType.originNode).addType(new it(t.fnType.arguments=new F)),t.getProp(e.name)}),ThisExpression:T(function(e,t){return t.fnType?t.fnType.self:lt.topScope}),Literal:T(function(e){return S(e)})},gt=r.make({Expression:function(e,t,r){x(e,t,r,z)},FunctionDeclaration:function(e,t,r){var n=e.body.scope,o=n.fnType;r(e.body,t,"ScopeBody"),m(e,n)||b(n);var s=t.getProp(e.id.name);s.addType(o)},VariableDeclaration:function(e,t,r){for(var n=0;n0&&(k(o.errors),o.errors=o.errors.map(O)),j(r,"postParse",o,e),o};e.analyze=function(t,n,o,s){"string"==typeof t&&(t=yt(t)),n||(n="file#"+lt.origins.length),e.addOrigin(lt.curOrigin=n),o||(o=lt.topScope),r.recursive(t,o,null,ft),j(s,"preInfer",t,o),r.recursive(t,o,null,gt),j(s,"postInfer",t,o),lt.curOrigin=null},e.purge=function(e,t,r){var n=R(e,t,r);++lt.purgeGen,lt.topScope.purge(n);for(var o in lt.props){for(var s=lt.props[o],a=0;a"==r?z:M(r)},Identifier:function(e,t){return t.hasProp(e.name)||z},ThisExpression:function(e,t){return t.fnType?t.fnType.self:lt.topScope},Literal:function(e){return S(e)}},wt=e.searchVisitor=r.make({Function:function(e,t,r){var n=e.body.scope;e.id&&r(e.id,n);for(var o=0;ot?!1:"Identifier"==r.type&&"✖"==r.name?!1:vt.hasOwnProperty(r.type)};return r.findNodeAround(e,n,a,wt,o||lt.topScope)},e.expressionType=function(e){return D(e.node,e.state)},e.parentNode=function(e,t){function n(t,s,a){if(t.start<=e.start&&t.end>=e.end){var i=o[o.length-1];if(t==e)throw{found:i};i!=t&&o.push(t),r.base[a||t.type](t,s,n),i!=t&&o.pop()}}var o=[];try{n(t,null)}catch(s){if(s.found)return s.found;throw s}};var _t={ArrayExpression:function(e,t,r){return r(e,!0).getProp("")},ObjectExpression:function(e,t,r){for(var n=0;ny(e,r)&&(o.parent=r,o.excluded&&(o.excluded=null)));var i=new s(t,r);e.files.push(i),e.fileMap[t]=i,null!=n?a(i,n,e):e.options.async?(e.startAsyncAction(),e.options.getFile(t,function(t,r){"object"==typeof r&&(r=r.contents),a(i,r||"",e),e.finishAsyncAction(t)})):a(i,e.options.getFile(t)||"",e)}function p(e,t,r){var n=function(){e.off("everythingFetched",n),clearTimeout(o),d(e,t,r)};e.on("everythingFetched",n);var o=setTimeout(n,e.options.fetchTimeout)}function d(e,r,n){if(e.pending)return p(e,r,n);var o=e.fetchError;if(o)return e.fetchError=null,n(o);e.needsPurge.length>0&&t.withContext(e.cx,function(){t.purge(e.needsPurge),e.needsPurge.length=0});for(var s=!0,a=0;at?e:e.slice(0,t)}function h(e,t,r){var n=Math.max(0,r-500),o=null;if(!/^\s*$/.test(e))for(;;){var s=t.indexOf(e,n);if(0>s||s>r+500)break;(null==o||Math.abs(o-r)>Math.abs(s-r))&&(o=s),n=s+e.length}return o}function f(e){for(var t=0;e;++t,e=e.prev);return t}function m(e){var t=new Error(e);return t.name="TernError",t}function g(e,r,n){var s=n.match(/^#(\d+)$/);if(!s)return e.findFile(n);var a=r[s[1]];if(!a||"delete"==a.type)throw m("Reference to unknown file "+n);if("full"==a.type)return e.findFile(a.name);var i=a.backing=e.findFile(a.name),l=a.offset;a.offsetLines&&(l={line:a.offsetLines,ch:0}),a.offset=l=Y(i,null==a.offsetLines?a.offset:{line:a.offsetLines,ch:0},!0);var c,p,d=u(a.text),g=h(d,i.text,l),b=null==g?Math.max(0,i.text.lastIndexOf("\n",l)):g;return t.withContext(e.cx,function(){t.purge(a.name,b,b+a.text.length);var r,n=a.text;if(r=n.match(/(?:"([^"]*)"|([\w$]+))\s*:\s*function\b/)){var s=o.findNodeAround(a.backing.ast,b,"ObjectExpression");s&&s.node.objType&&(c={type:s.node.objType,prop:r[2]||r[1]})}if(g&&(r=d.match(/^(.*?)\bfunction\b/))){for(var l=r[1].length,u="",h=0;l>h;++h)u+=" ";n=u+n.slice(l),p=!0}var m=t.scopeAt(i.ast,b,i.scope),y=t.scopeAt(i.ast,b+n.length,i.scope),v=a.scope=f(m)h;++h)T.args[h].propagate(E.args[h]);T.self.propagate(E.self),E.retval.propagate(T.retval)}}}),a}function b(e){var t=0;return o.simple(e,{Expression:function(){++t}}),t}function y(e,t){for(var r=0;t;)t=e.findFile(t).parent,++r;return r}function v(e,t){for(;;){var r=e.findFile(t.parent);if(!r.parent)break;t=r}return t.name}function w(e,t){var r=v(e,t),n=b(t.ast),o=e.budgets[r];return null==o&&(o=e.budgets[r]=e.options.dependencyBudget),n>o?!1:(e.budgets[r]=o-n,!0)}function _(e){return"number"==typeof e||"object"==typeof e&&"number"==typeof e.line&&"number"==typeof e.ch}function S(e){if(e.query){if("string"!=typeof e.query.type)return".query.type must be a string";if(e.query.start&&!_(e.query.start))return".query.start must be a position";if(e.query.end&&!_(e.query.end))return".query.end must be a position"}if(e.files){if(!Array.isArray(e.files))return"Files property must be an array";for(var t=0;ts;){if(++s,o=r.indexOf("\n",o)+1,0===o)return null;s%X===0&&n.push(o)}return o}function E(e,t){if(!e)return{line:0,ch:0};for(var r,n,o=e.lineOffsets||(e.lineOffsets=[0]),s=e.text,a=o.length-1;a>=0;--a)o[a]<=t&&(r=a*X,n=o[a]);for(;;){var i=s.indexOf("\n",n);if(i>=t||0>i)break;n=i+1,++r}return{line:r,ch:t-n}}function x(e){for(var t in e)null==e[t]&&delete e[t];return e}function j(e,t,r){null!=r&&(e[t]=r)}function O(e,t){"string"!=typeof e&&(e=e.name,t=t.name);var r=/^[A-Z]/.test(e),n=/^[A-Z]/.test(t);return r==n?t>e?-1:e==t?0:1:r?1:-1}function k(e,t,r){return"Literal"==e.type&&"string"==typeof e.value&&e.start==t-1&&e.end<=r+1}function R(e,t){for(var r=0;r=t)return n}}function M(e,r,o){function s(n,o,s,a){if((!w&&r.omitObjectPrototype===!1||o!=e.cx.protos.Object||u)&&!(r.filter!==!1&&u&&0!==(r.caseInsensitive?n.toLowerCase():n).indexOf(u)||d&&d.props[n])){for(var i=0;i=2&&r.guess!==!1)for(var g in e.cx.props)s(g,e.cx.props[g][0],0);f="memberCompletion"}else t.forAllLocalsAt(o.ast,l,o.scope,s),r.includeKeywords&&Q.forEach(function(e){s(e,null,0,function(e){e.isKeyword=!0})}),f="variableCompletion";return e.passes[f]&&e.passes[f].forEach(function(e){e(o,l,c,h)}),r.sort!==!1&&h.sort(O),e.cx.completingProperty=null,{start:K(r,o,l),end:K(r,o,c),isProperty:!!g,isObjectKey:!!y,completions:h}}function D(e,t){var r=t.prefix,n=[];for(var o in e.cx.props)""==o||r&&0!==o.indexOf(r)||n.push(o);return t.sort!==!1&&n.sort(O),{completions:n}}function A(e,t,r){var n=Z(e,t,r);if(n)return n;throw m("No expression at the given position.")}function z(e){return e&&(e=e.getType())&&e instanceof t.Obj?e:null}function C(e,r,n,o){var s;if(o&&(t.resetGuessing(),s=t.expressionType(o)),e.passes.typeAt){var a=Y(n,r.end);e.passes.typeAt.forEach(function(e){s=e(n,a,o,s)})}if(!s)throw m("No type found at the given position.");var i;if("ObjectExpression"==o.node.type&&null!=r.end&&(i=R(o.node,Y(n,r.end)))){var l=i.key.name,c=z(t.typeFromContext(n.ast,o));if(c&&c.hasProp(l))s=c.hasProp(l);else{var p=z(s);p&&p.hasProp(l)&&(s=p.hasProp(l))}}return s}function P(e,r,n){var o,s=Z(n,r),a=C(e,r,n,s),i=a;if(a=r.preferFunction?a.getFunctionType()||a.getType():a.getType(),s&&("Identifier"==s.node.type?o=s.node.name:"MemberExpression"!=s.node.type||s.node.computed||(o=s.node.property.name)),null!=r.depth&&"number"!=typeof r.depth)throw m(".query.depth must be a number");var l={guess:t.didGuess(),type:t.toString(i,r.depth),name:a&&a.name,exprName:o};return a&&U(r,a,l),!l.doc&&i.doc&&(l.doc=I(r,i.doc)),x(l)}function I(e,t){if(!t)return null;if("full"==e.docFormat)return t;var r=/.\n[\s@\n]/.exec(t);if(r&&(t=t.slice(0,r.index+1)),t=t.replace(/\n\s*/g," "),t.length<100)return t;var n=/[\.!?] [A-Z]/g;n.lastIndex=80;var o=n.exec(t);return o&&(t=t.slice(0,o.index+1)),t}function N(e,r,n){var o=Z(n,r),s=C(e,r,n,o),a={url:s.url,doc:I(r,s.doc),type:t.toString(s)},i=s.getType();return i&&U(r,i,a),x(a)}function U(e,r,n){n.url||(n.url=r.url),n.doc||(n.doc=I(e,r.doc)),n.origin||(n.origin=r.origin);var o,s=t.cx().protos;!n.url&&!n.doc&&r.proto&&(o=r.proto.hasCtor)&&r.proto!=s.Object&&r.proto!=s.Function&&r.proto!=s.Array&&(n.url=o.url,n.doc=I(e,o.doc))}function L(e,t,r){var n=Z(r,t),o=C(e,t,r,n),s=et(o),a={url:o.url,doc:I(t,o.doc),origin:o.origin};if(o.types)for(var i=o.types.length-1;i>=0;--i){var l=o.types[i];U(t,l,a),s||(s=et(l))}if(s&&s.node){var c=s.node.sourceFile||e.findFile(s.origin),p=K(t,c,s.node.start),d=K(t,c,s.node.end);a.start=p,a.end=d,a.file=s.origin;var u=Math.max(0,s.node.start-50);a.contextOffset=s.node.start-u,a.context=c.text.slice(u,u+50)}else s&&(a.file=s.origin,tt(e,t,s,a));return x(a)}function q(e,r,n,o,s){function a(e){return function(t,n){if(s)for(var o=n;o!=l;o=o.prev){var a=o.hasProp(s);if(a)throw m("Renaming `"+i+"` to `"+s+"` would make a variable at line "+(E(e,t.start).line+1)+" point to the definition at line "+(E(e,a.name.start).line+1))}p.push({file:e.name,start:K(r,e,t.start),end:K(r,e,t.end)})}}for(var i=o.node.name,l=o.state;l&&!(i in l.props);l=l.prev);if(!l)throw m("Could not find a definition for "+i+" "+!!e.cx.topScope.props.x);var c,p=[];if(l.originNode){if(c="local",s){for(var d=l.prev;d&&!(s in d.props);d=d.prev);d&&t.findRefs(l.originNode,l,s,d,function(e){throw m("Renaming `"+i+"` to `"+s+"` would shadow the definition used at line "+(E(n,e.start).line+1))})}t.findRefs(l.originNode,l,i,l,a(n))}else{c="global";for(var u=0;u=s)return F(e,t,n,i)}throw m("Not at a variable or property name.")}function W(e,t,r){if("string"!=typeof t.newName)throw m(".query.newName should be a string");var n=A(r,t);if(!n)throw m("Could not find an expression to rename.");if("Identifier"!=n.node.type)switch(n.node.type){case"MemberExpression":throw m("Rename is not supported on member expressions.");case"ThisExpression":throw m("Rename is not supported on this expressions.");case"ObjectExpression":throw m("Rename is not supported on object properties.");default:throw m("Rename is only supported on variables.")}var o=q(e,t,r,n,t.newName),s=o.refs;delete o.refs,o.files=e.files.map(function(e){return e.name});for(var a=o.changes=[],i=0;i4e4&&(n.reset(),d(n,null,function(){}))})},findFile:function(e){return this.fileMap[e]},flush:function(e){var r=this.cx;d(this,null,function(n){return n?e(n):void t.withContext(r,e)})},startAsyncAction:function(){++this.pending},finishAsyncAction:function(e){e&&(this.asyncError=e),0===--this.pending&&this.signal("everythingFetched")}});var X=25,Y=e.resolvePos=function(e,t,r){if("number"!=typeof t){var n=T(e,t.line);if(null==n){if(!r)throw m("File doesn't contain a line "+t.line);t=e.text.length}else t=n+t.ch}if(t>e.text.length){if(!r)throw m("Position "+t+" is outside of file.");t=e.text.length}return t},K=e.outputPos=function(e,t,r){if(e.lineCharPositions){var n=E(t,r);return"part"==t.type&&(n.line+=null!=t.offsetLines?t.offsetLines:E(t.backing,t.offset).line),n}return r+("part"==t.type?t.offset:0)},Q="break do instanceof typeof case else new var catch finally return void continue for switch while debugger function this with default if throw delete in try".split(" "),Z=e.findQueryExpr=function(e,r,n){if(null==r.end)throw m("missing .query.end field");if(r.variable){var o=t.scopeAt(e.ast,Y(e,r.end),e.scope);return{node:{type:"Identifier",name:r.variable,start:r.end,end:r.end+1},state:o}}var s=r.start&&Y(e,r.start),a=Y(e,r.end),i=t.findExpressionAt(e.ast,s,a,e.scope);return i?i:(i=t.findExpressionAround(e.ast,s,a,e.scope),i&&("ObjectExpression"==i.node.type||n||(null==s?a:s)-i.node.start<20||i.node.end-a<20)?i:null)},et=e.getSpan=function(e){if(e.origin){if(e.originNode){var t=e.originNode;return/^Function/.test(t.type)&&t.id&&(t=t.id),{origin:e.origin,node:t}}return e.span?{origin:e.origin,span:e.span}:void 0}},tt=e.storeSpan=function(e,t,r,n){if(n.origin=r.origin,r.span){var o=/^(\d+)\[(\d+):(\d+)\]-(\d+)\[(\d+):(\d+)\]$/.exec(r.span);n.start=t.lineCharPositions?{line:Number(o[2]),ch:Number(o[3])}:Number(o[1]),n.end=t.lineCharPositions?{line:Number(o[5]),ch:Number(o[6])}:Number(o[4])}else{var s=e.findFile(r.origin);n.start=K(t,s,r.node.start),n.end=K(t,s,r.node.end)}};e.version="0.12.0",e.findDef=L,e.findExpr=Z,e.findExprType=C,e.resolveFile=g,e.storeTypeDocs=U,e.parseDoc=I,e.resolvePos=Y}),function(e){return"object"==typeof exports&&"object"==typeof module?e(exports):"function"==typeof define&&define.amd?define("tern/lib/comment",["exports"],e):void e(tern.comment||(tern.comment={}))}(function(e){function t(e){return 14>e&&e>8||32===e||160===e}function r(e,r){for(;r>0;--r){var n=e.charCodeAt(r-1);if(10==n)break;if(!t(n))return!1}return!0}e.commentsBefore=function(e,n){var o,s=null,a=0;e:for(;n>0;){var i=e.charCodeAt(n-1);if(10==i)for(var l=--n,c=!1;l>0;--l){if(i=e.charCodeAt(l-1),47==i&&47==e.charCodeAt(l-2)){if(!r(e,l-2))break e;var p=e.slice(l,n);!a&&o?s[0]=p+"\n"+s[0]:(s||(s=[])).unshift(p),o=!0,a=0,n=l-2;break}if(10==i){if(!c&&++a>1)break e;break}c||t(i)||(c=!0)}else if(47==i&&42==e.charCodeAt(n-2)){for(var l=n-2;l>1;--l)if(42==e.charCodeAt(l-1)&&47==e.charCodeAt(l-2)){if(!r(e,l-2))break e;(s||(s=[])).unshift(e.slice(l,n-2)),o=!1,a=0;break}n=l-2}else{if(!t(i))break;--n}}return s},e.commentAfter=function(e,r){for(;ro?e.length:o)}t(n)&&++r}},e.ensureCommentsBefore=function(t,r){return r.hasOwnProperty("commentsBefore")?r.commentsBefore:r.commentsBefore=e.commentsBefore(t,r.start)}}),function(e){return"object"==typeof exports&&"object"==typeof module?e(require("../lib/infer"),require("../lib/tern"),require("../lib/comment"),require("acorn"),require("acorn/dist/walk")):"function"==typeof define&&define.amd?define("tern/plugin/doc_comment",["../lib/infer","../lib/tern","../lib/comment","esprima/esprima","acorn/dist/walk"],e):void e(tern,tern,tern.comment,acorn,acorn.walk)}(function(e,t,r,n,o){"use strict";function s(e,t){function n(e){r.ensureCommentsBefore(t,e)}o.simple(e,{VariableDeclaration:n,FunctionDeclaration:n,AssignmentExpression:function(e){"="==e.operator&&n(e)},ObjectExpression:function(e){for(var t=0;t=3&&"string"==typeof e.arguments[1].value}function i(t,r){v(t.sourceFile.text,r),o.simple(t,{VariableDeclaration:function(e,t){e.commentsBefore&&p(e,e.commentsBefore,t,t.getProp(e.declarations[0].id.name))},FunctionDeclaration:function(e,t){e.commentsBefore&&p(e,e.commentsBefore,t,t.getProp(e.id.name),e.body.scope.fnType)},AssignmentExpression:function(t,r){t.commentsBefore&&p(t,t.commentsBefore,r,e.expressionType({node:t.left,state:r}))},ObjectExpression:function(e,t){for(var r=0;r=0;i--){var l=c(r[i].split(/\r\n?|\n/)).join("\n");if(l){o instanceof e.AVal&&(o.doc=l),s&&(s.doc=l);break}}}function d(e,t){for(;/\s/.test(e.charAt(t));)++t;return t}function u(e){if(!n.isIdentifierStart(e.charCodeAt(0)))return!1;for(var t=1;tl)return null;var c=t.slice(r,l);if(!u(c))return null;o.push(c),r=l+1;var p=f(e,t,r);if(!p)return null;r=p.end,a=a||p.madeUp,s.push(p.type),r=d(t,r);var h=t.charAt(r);if(++r,h==n)break;if(","!=h)return null}return{labels:o,types:s,end:r,madeUp:a}}function f(t,r,n){for(var o,s=!1,a=!1;;){var i=m(t,r,n);if(!i)return null;if(a=a||i.madeUp,s?i.type.propagate(s):o=i.type,n=d(r,i.end),"|"!=r.charAt(n))break;n++,s||(s=new e.AVal,o.propagate(s),o=s)}var l=!1;return"="==r.charAt(n)&&(++n,l=!0),{type:o,end:n,isOptional:l,madeUp:a}}function m(t,r,o){o=d(r,o);var s,a=!1;if(r.indexOf("function(",o)==o){var i=h(t,r,o+9,")"),l=e.ANull;if(!i)return null;if(o=d(r,i.end),":"==r.charAt(o)){++o;var c=f(t,r,o+1);if(!c)return null;o=c.end,l=c.type,a=c.madeUp}s=new e.Fn(null,e.ANull,i.types,i.labels,l)}else if("["==r.charAt(o)){var p=f(t,r,o+1);if(!p)return null;if(o=d(r,p.end),a=p.madeUp,"]"!=r.charAt(o))return null;++o,s=new e.Arr(p.type)}else if("{"==r.charAt(o)){var u=h(t,r,o+1,"}");if(!u)return null;s=new e.Obj(!0);for(var m=0;m"!=r.charAt(o++))return null;p=w.type}s=new e.Arr(p)}else if(/^object$/i.test(v)){if(s=new e.Obj(!0),"."==r.charAt(o)&&"<"==r.charAt(o+1)){var _=f(t,r,o+2);if(!_)return null;if(o=d(r,_.end),a=a||_.madeUp,","!=r.charAt(o++))return null;var S=f(t,r,o);if(!S)return null;if(o=d(r,S.end),a=_.madeUp||S.madeUp,">"!=r.charAt(o++))return null;S.type.propagate(s.defProp(""))}}else{for(;46==r.charCodeAt(o)||n.isIdentifierChar(r.charCodeAt(o));)++o;var T,E=r.slice(y,o),x=e.cx(),j=x.parent&&x.parent.jsdocTypedefs;j&&E in j?s=j[E]:(T=e.def.parsePath(E,t).getObjType())?s=g(T,E):(x.jsdocPlaceholders||(x.jsdocPlaceholders=Object.create(null)),s=E in x.jsdocPlaceholders?x.jsdocPlaceholders[E]:x.jsdocPlaceholders[E]=new e.Obj(null,E),a=!0)}}return{type:s,end:o,madeUp:a}}function g(t,r){if(t instanceof e.Fn&&/^[A-Z]/.test(r)){var n=t.getProp("prototype").getObjType();if(n instanceof e.Obj)return e.getInstance(n)}return t}function b(e,t,r){if(r=d(t,r||0),"{"!=t.charAt(r))return null;var n=f(e,t,r+1);if(!n)return null;var o=d(t,n.end);return"}"!=t.charAt(o)?null:(n.end=o+1,n)}function y(e,t,r,n){for(var o,s,a,i,l,c,p=n.length-1;p>=0;p--)for(var d,u=n[p],h=/(?:\n|$|\*)\s*@(type|param|arg(?:ument)?|returns?|this)\s+(.*)/g;d=h.exec(u);)if("this"==d[1]&&(c=f(t,d[2],0)))l=c,i=!0;else if(c=b(t,d[2]))switch(i=!0,d[1]){case"returns":case"return":a=c;break;case"type":o=c;break;case"param":case"arg":case"argument":var m=d[2].slice(c.end).match(/^\s*(\[?)\s*([^\]\s=]+)\s*(?:=[^\]]+\s*)?(\]?).*/);if(!m)continue;var g=m[2]+(c.isOptional||"["===m[1]&&"]"===m[3]?"?":"");(s||(s=Object.create(null)))[g]=c}i&&_(o,l,s,a,e,r)}function v(t,r){for(var n,o=e.cx(),s=/\s@typedef\s+(.*)/g;n=s.exec(t);){var a=b(r,n[1]),i=a&&n[1].slice(a.end).match(/^\s*(\S+)/);i&&(o.parent.jsdocTypedefs[i[1]]=a.type)}}function w(t,r){var n=e.cx().parent._docComment.weight;t.type.propagate(r,n||(t.madeUp?S:void 0))}function _(t,r,n,o,s,a){var i;if("VariableDeclaration"==s.type){var l=s.declarations[0];l.init&&"FunctionExpression"==l.init.type&&(i=l.init.body.scope.fnType)}else"FunctionDeclaration"==s.type?i=s.body.scope.fnType:"AssignmentExpression"==s.type?"FunctionExpression"==s.right.type&&(i=s.right.body.scope.fnType):"CallExpression"==s.type||"FunctionExpression"==s.value.type&&(i=s.value.body.scope.fnType);if(i&&(n||o||r)){if(n)for(var c=0;ct.name?1:0}),n.splice(0,0,{proposal:"",description:"Templates",style:"noemphasis_title",unselectable:!0})),n},removePrefix:function(t,r){var n=r.overwrite=r.proposal.substring(0,t.length)!==t;n||(r.proposal=e(t,r.proposal))},isValid:function(){return!0}},{Template:t,TemplateContentAssist:r}}),define("tern/plugin/resolver",["orion/editor/templates"],function(e){function t(e,t){for(var n=Object.keys(d),o=0;o0){for(var o=0;o0){var t=e.parents.pop();switch(t.type){case"MemberExpression":return{kind:"member"};case"VariableDeclarator":return null;case"FunctionDelcaration":case"FunctionExpression":if(offset=t.value.range[0]&&offset-1<=t.value.range[1]?{kind:"prop"}:null;case"SwitchStatement":return{kind:"swtch"}}}return{kind:"top"}}function p(e,t){var r=c(t);if(r&&r.kind){for(var n=[],o=e.length,s=0;o>s;s++){var a=e[s];a.nodes&&a.nodes[r.kind]&&n.push(a)}return n.map(l,this)}}var d=Object.create(null);return{doPostParse:s,doPreInfer:o,getResolved:i,getTemplatesForNode:p}}),function(e){return"object"==typeof exports&&"object"==typeof module?e(require("../lib/infer"),require("../lib/tern"),require):"function"==typeof define&&define.amd?define("tern/plugin/orionAmqp",["../lib/infer","../lib/tern","./resolver"],e):void e(infer,tern,resolver)}(function(e,t,r){function n(n,s,a,i){var l=t.resolvePos(n,a),c=e.findExpressionAround(n.ast,null,l,n.scope),p=r.getTemplatesForNode(o,c);if(p&&p.length>0)for(var d=0;d +Connection"}},"Exchange.!3":{type:"string"},"createExchangeErrorHandlerFor.!ret":"fn(err: ?)","Connection.prototype._bodyToBuffer.!ret":"[Connection.prototype._bodyToBuffer.!ret.]","Connection.prototype._bodyToBuffer.!ret.":{contentType:"string"},"Connection.prototype._parseURLOptions.!ret":{ssl:{enabled:"bool"}},"Connection.prototype._sendHeader.!2":{reserved1:"number",routingKey:"string",noWait:"bool"},"serializer.serializeFields.!2":{reserved1:"number",routingKey:"string",noWait:"bool"},"Queue.prototype.subscribeRaw.!0":{state:"string"},"Message.!1":{parseError:"+Error",rawData:"string"},"parseTable.!ret":{"!doc":"XXX check if bitIndex greater than 7?"},"parseFields.!1":"[?]","parseFields.!ret":{}},methods:{"":{"!doc":"debug(name);"},"!doc":"methods keyed on their name"},Channel:{prototype:{closeOK:"fn()",reconnect:"fn()",_taskPush:"fn(reply: ?, cb: ?)",_tasksFlush:"fn()",_handleTaskReply:"fn(channel: ?, method: ?, args: ?) -> bool",_onChannelMethod:"fn(channel: ?, method: ?, args: ?)",close:"fn(reason: ?)"},"!type":"fn(connection: +Connection, channel: number)","!doc":"This class is not exposed to the user."},Exchange:{prototype:{_onMethod:"fn(channel: ?, method: ?, args: ?) -> bool",publish:{"!type":"fn(routingKey: ?, data: ?, options: ?, callback: ?)","!doc":"exchange.publish('routing.key', 'body'); the third argument can specify additional options - mandatory (boolean, default false) - immediate (boolean, default false) - contentType (default 'application/octet-stream') - contentEncoding - headers - deliveryMode - priority (0-9) - correlationId - replyTo - expiration - messageId - timestamp - userId - appId - clusterId the callback is optional and is only used when confirm is turned on for the exchange"},_awaitConfirm:{"!type":"fn(task: ?, callback: ?)","!doc":"registers tasks for confirms"},cleanup:{"!type":"fn()","!doc":"do any necessary cleanups eg."},destroy:"fn(ifUnused: ?)",unbind:"fn()",bind:"fn()",bind_headers:"fn()"},"!type":"fn(connection: +Connection, channel: number, name: ?, options: Exchange.!3, openCallback: ?)",binds:"number",exchangeBinds:"number",sourceExchanges:{"":"+Exchange"},_sequence:"number",_unAcked:{},_addedExchangeErrorHandler:"bool",state:"string",channel:"number",connection:"+Connection",_tasks:"[?]"},createExchangeErrorHandlerFor:{"!type":"fn(exchange: +Exchange) -> fn(err: ?)","!doc":"creates an error handler scoped to the given `exchange`"},Connection:{prototype:{setOptions:"fn(options: ?)",setImplOptions:"fn(options: ?)",connect:"fn()",reconnect:"fn()",disconnect:"fn()",addAllListeners:"fn()",heartbeat:"fn()",exchange:{"!type":"fn(name: ?, options: Exchange.!3, openCallback: ?) -> +Exchange","!doc":"connection.exchange('my-exchange', { type: 'topic' }); Options - type 'fanout', 'direct', or 'topic' (default) - passive (boolean) - durable (boolean) - autoDelete (boolean, default true)"},exchangeClosed:{"!type":"fn(name: ?)","!doc":"remove an exchange when it's closed (called from Exchange)"},queue:{"!type":"fn(name: ?) -> +Queue","!doc":"Options - passive (boolean) - durable (boolean) - exclusive (boolean) - autoDelete (boolean, default true)"},queueClosed:{"!type":"fn(name: ?)","!doc":"remove a queue when it's closed (called from Queue)"},publish:{"!type":"fn(routingKey: ?, body: ?, options: ?, callback: ?)","!doc":"Publishes a message to the default exchange."},_bodyToBuffer:"fn(body: ?) -> [?]",_inboundHeartbeatTimerReset:"fn()",_outboundHeartbeatTimerReset:"fn()",_saslResponse:"fn() -> ?|string",_onMethod:"fn(channel: number, method: methods., args: parseFields.!ret)",_parseURLOptions:{"!type":"fn(connectionString: ?) -> Connection.prototype._parseURLOptions.!ret","!doc":"Generate connection options from URI string formatted with amqp scheme."},_chooseHost:{"!type":"fn() -> !this.options.host","!doc":"If you pass a array of hosts, lets choose a random host or the preferred host number, or then next one."},_createSocket:"fn()",end:"fn()",_getSSLOptions:"fn() -> !this.sslConnectionOptions",_startHandshake:{"!type":"fn()","!doc":"Time to start the AMQP 7-way connection initialization handshake! 1."},_sendBody:{"!type":"fn(channel: number, body: ?, properties: ?)","!doc":"Parse helpers "},_sendHeader:{"!type":"fn(channel: number, size: ?, properties: ?)","!doc":"connection: the connection channel: the channel to send this on size: size in bytes of the following message properties: an object containing any of the following: - contentType (default 'application/octet-stream') - contentEncoding - headers - deliveryMode - priority (0-9) - correlationId - replyTo - expiration - messageId - timestamp - userId - appId - clusterId"},_sendMethod:"fn(channel: number, method: ?, args: ?)",generateChannelId:{"!type":"fn() -> !this.channelCounter","!doc":"tries to find the next available id slot for a channel"}},"!type":"fn(connectionArgs: ?, options: ?, readyCallback: ?)",connectionAttemptScheduled:{"!type":"bool","!doc":"Set to false, so that if we fail in the reconnect attempt, we can schedule another one."},_defaultExchange:"+Exchange",channelCounter:"number",_blocked:"bool",channels:{"!doc":"In the case where this is a reconnection, do not trample on the existing channels.","":"+Queue"},exchanges:{"":"+Exchange"},parser:{"!type":"+AMQPParser","!doc":"Reset parser state"},readyEmitted:{"!type":"bool","!doc":"Set 'ready' flag for auth failure detection."},hosti:{"!type":"number","!doc":"If this is already set, it looks like we want to choose another one."},"":"fn()",sslConnectionOptions:{}},serializer:{serializeFloat:"fn(b: ?, size: number, value: ?, bigEndian: ?)",serializeInt:"fn(b: ?, size: number, int: number)",serializeShortString:"fn(b: ?, string: ?)",serializeLongString:"fn(b: ?, string: ?)",serializeDate:"fn(b: ?, date: ?)",serializeBuffer:"fn(b: ?, buffer: ?)",serializeBase64:"fn(b: ?, buffer: ?)",isBigInt:"fn(value: ?) -> bool",getCode:"fn(dec: ?) -> string",isFloat:"fn(value: ?) -> bool",serializeValue:"fn(b: ?, value: ?)",serializeTable:"fn(b: ?, object: ?)",serializeArray:"fn(b: ?, arr: ?)",serializeFields:"fn(buffer: ?, fields: ?, args: ?, strict: bool)"},methodTable:{"":{"":"methods."},"!doc":"a look up table for methods recieved indexed on class id, method id"},classes:{"!doc":"classes keyed on their index"},Queue:{prototype:{subscribeRaw:"fn(options: Queue.consumerTagListeners., messageListener: Queue.consumerTagListeners.)",unsubscribe:"fn(consumerTag: ?)",subscribe:"fn(options: ?, messageListener: ?)",shift:{"!type":"fn(reject: ?, requeue: ?)","!doc":"Acknowledges the last message"},bind:"fn(exchange: string, routingKey: string, callback: string)",unbind:"fn(exchange: string, routingKey: string)",bind_headers:"fn()",unbind_headers:"fn()",destroy:"fn(options: ?)",purge:"fn()",_onMethod:"fn(channel: ?, method: ?, args: ?)",_onContentHeader:"fn(channel: number, classInfo: ?, weight: number, properties: parseFields.!ret, size: number)",_onContent:"fn(channel: number, data: ?)",flow:"fn(active: ?)",subscribeJSON:"Queue.prototype.subscribe"},"!type":"fn(connection: +Connection, channel: number, name: ?, options: ?, callback: ?)",name:"string",_bindings:{"":{"":"number"}},consumerTagListeners:{"":{state:"string"}},consumerTagOptions:{"":"Queue.consumerTagListeners."},options:{autoDelete:"bool",closeChannelOnUnsubscribe:"bool"},state:"string",_bindCallback:"string",_sequence:"number",confirm:"bool",currentMessage:"+Message"},AMQPParser:{prototype:{throwError:{"!type":"fn(error: string)","!doc":"If there's an error in the parser, call the onError handler or throw"},execute:{"!type":"fn(data: ?)","!doc":"Everytime data is recieved on the socket, pass it to this function for parsing."},_parseMethodFrame:"fn(channel: number, buffer: ?)",_parseHeaderFrame:"fn(channel: number, buffer: ?)"},"!type":"fn(version: string, type: string)","!doc":"An interruptible AMQP parser.",isClient:"bool",state:"string",parse:"fn(data: ?) -> AMQPParser.parse",onMethod:"fn(channel: number, method: methods., args: parseFields.!ret)",onContent:"fn(channel: number, data: ?)",onContentHeader:"fn(channel: number, classInfo: ?, weight: number, properties: parseFields.!ret, size: number)",onHeartBeat:"fn()",onError:"fn(e: string)"},maxFrameBuffer:{"!type":"number","!doc":"parser"},channelMax:{"!type":"number","!doc":"copying qpid)"},defaultPorts:{amqp:"number",amqps:"number"},defaultOptions:{host:"string",port:"number",login:"string",password:"string",authMechanism:"string",vhost:"string",connectionTimeout:"number",ssl:{enabled:"bool"}},defaultSslOptions:{port:"number",ssl:{rejectUnauthorized:"bool"}},defaultImplOptions:{defaultExchangeName:"string",reconnect:"bool",reconnectBackoffStrategy:"string",reconnectExponentialLimit:"number",reconnectBackoffTime:"number"},defaultClientProperties:{platform:"string",product:"string"},Message:{prototype:{acknowledge:{"!type":"fn(all: ?)","!doc":"Acknowledge receipt of message."},reject:{"!type":"fn(requeue: ?)","!doc":"Reject an incoming message."}},"!type":"fn(queue: +Queue, args: ?)","!doc":"Properties: - routingKey - size - deliveryTag - contentType (default 'application/octet-stream') - contentEncoding - headers - deliveryMode - priority (0-9) - correlationId - replyTo - experation - messageId - timestamp - userId - appId - clusterId",queue:"+Queue",read:"number",size:"number"},parseShortString:"fn(buffer: ?)",parseLongString:"fn(buffer: ?)",parseSignedInteger:"fn(buffer: ?) -> !0.",parseValue:"fn(buffer: ?) -> !0.",parseTable:"fn(buffer: ?) -> parseTable.!ret",parseFields:"fn(buffer: ?, fields: [?]) -> parseFields.!ret",Error:{name:"string"},createConnection:"fn(options: Object, implOptions: Object, readyCallback: fn()) -> +Connection"}}),function(e){return"object"==typeof exports&&"object"==typeof module?e(require("../lib/infer"),require("../lib/tern"),require("../lib/comment"),require("acorn/dist/walk")):"function"==typeof define&&define.amd?define("tern/plugin/angular",["../lib/infer","../lib/tern","../lib/comment","acorn/dist/walk"],e):void e(tern,tern,tern.comment,acorn.walk)}(function(e,t,r,n){"use strict";function o(){this.fields=Object.create(null),this.forward=[]}function s(t){var r=e.cx().definitions.angular.service;return r.hasProp(t)?r.getProp(t):void 0}function a(t,r){var n=s(r);return n?n:t.injector&&t.injector?t.injector.get(r):e.ANull}function i(t,r,n,o){var s=[];if("FunctionExpression"==n.type)for(var i=0;i5&&(o=o.slice(0,s+1)),o=o.trim().replace(/\s*\n\s*\*\s*|\s{1,}/g," "),e.arguments[0].angularDoc=o}}}})}function u(t){var r=e.cx(),n=t["!name"],o=r.definitions[n];if("angular"!=n){var s=o&&o["!ng"];if(s)for(var a in s.props){var i=s.props[a].getType(),l=p(a.replace(/`/g,"."),i.metaData&&i.metaData.includes||[]);l.origin=n;for(var d in i.props){var u=i.props[d],h=u.getType();h&&(/^_inject_/.test(d)?(h.name||(h.name=d.slice(8)),l.injector.set(d.slice(8),h,u.doc,u.span)):i.props[d].propagate(l.defProp(d)))}}}else{var f=c(r),m=r.parent._angular.nakedModules;if(f)for(var g=0;g-1){var i=s.replace(/\./g,"`");if(n.defProp(i).addType(a),a.condenseForceInclude=!0,++o,a.injector)for(var l in a.injector.fields){var c=a.injector.fields[l];c.local&&(t.roots["!ng."+i+"._inject_"+l]=c)}}}o&&(t.roots["!ng"]=n)}function f(t){var r=e.cx().parent._angular.modules;for(var n in t.types){var o;if(o=n.match(/^!ng\.([^\.]+)\._inject_([^\.]+)^/)){var s=r[o[1].replace(/`/g,".")],a=s.injector.fields[o[2]],i=t.types[n];a.span&&(i.span=a.span),a.doc&&(i.doc=a.doc)}}}function m(e){e._angular={modules:Object.create(null),pendingImports:Object.create(null),nakedModules:[]}}var g=e.constraint({construct:function(e){this.doc=e},addType:function(e){e.doc||(e.doc=this.doc)}});o.prototype.get=function(t){if("$scope"==t)return new e.Obj(s("$rootScope").getType(),"$scope");if(t in this.fields)return this.fields[t];var r=this.fields[t]=new e.AVal;return r},o.prototype.set=function(t,r,n,o,s){if(!("$scope"==t||s&&s>10)){var a=this.fields[t]||(this.fields[t]=new e.AVal);s||(a.local=!0),a.origin||(a.origin=e.cx().curOrigin),"string"!=typeof o||a.span?o&&"object"==typeof o&&!a.originNode&&(a.originNode=o):a.span=o,n&&(a.doc=n,a.propagate(new g(n))),r.propagate(a);for(var i=0;i1){var o=i(n,t[1],r[1]);n.injector&&"Literal"==r[0].type&&n.injector.set(r[0].value,o,r[0].angularDoc,r[0])}}),e.registerFunction("angular_regFieldNew",function(e,t,r){var n=e.getType();if(n&&r&&r.length>1){var o=i(n,t[1],r[1],!0);n.injector&&"Literal"==r[0].type&&n.injector.set(r[0].value,o,r[0].angularDoc,r[0])}}),e.registerFunction("angular_regField",function(e,t,r){var n=e.getType();n&&n.injector&&r&&r[0]&&"Literal"==r[0].type&&t[1]&&n.injector.set(r[0].value,t[1],r[0].angularDoc,r[0])}),e.registerFunction("angular_module",function(t,r,n){var o,s=n&&n[0]&&"Literal"==n[0].type&&n[0].value;return"string"==typeof s&&(o=e.cx().parent._angular.modules[s]),o||(o=p(s,l(n&&n[1]))),o});var b=e.constraint({construct:function(e,t,r){this.self=e,this.args=t,this.target=r},addType:function(t){if(t instanceof e.Fn){this.target.addType(new e.Fn(t.name,t.self,t.args.slice(this.args.length),t.argNames.slice(this.args.length),t.retval)),this.self.propagate(t.self);for(var r=0;r ?",put:"fn(key: string, value: ?) -> !1",get:"fn(key: string) -> ?",remove:"fn(key: string)",removeAll:"fn()",destroy:"fn()"},eventObj:{targetScope:"service.$rootScope",currentScope:"service.$rootScope",name:"string",stopPropagation:"fn()",preventDefault:"fn()",defaultPrevented:"bool"},directiveObj:{multiElement:{"!type":"bool","!url":"https://docs.angularjs.org/api/ng/service/$compile#-multielement-","!doc":"When this property is set to true, the HTML compiler will collect DOM nodes between nodes with the attributes directive-name-start and directive-name-end, and group them together as the directive elements. It is recommended that this feature be used on directives which are not strictly behavioural (such as ngClick), and which do not manipulate or replace child nodes (such as ngInclude)."},priority:{"!type":"number","!url":"https://docs.angularjs.org/api/ng/service/$compile#-priority-","!doc":"When there are multiple directives defined on a single DOM element, sometimes it is necessary to specify the order in which the directives are applied. The priority is used to sort the directives before their compile functions get called. Priority is defined as a number. Directives with greater numerical priority are compiled first. Pre-link functions are also run in priority order, but post-link functions are run in reverse order. The order of directives with the same priority is undefined. The default priority is 0."},terminal:{"!type":"bool","!url":"https://docs.angularjs.org/api/ng/service/$compile#-terminal-","!doc":"If set to true then the current priority will be the last set of directives which will execute (any directives at the current priority will still execute as the order of execution on same priority is undefined). Note that expressions and other directives used in the directive's template will also be excluded from execution."},scope:{"!type":"?","!url":"https://docs.angularjs.org/api/ng/service/$compile#-scope-","!doc":"If set to true, then a new scope will be created for this directive. If multiple directives on the same element request a new scope, only one new scope is created. The new scope rule does not apply for the root of the template since the root of the template always gets a new scope. If set to {} (object hash), then a new 'isolate' scope is created. The 'isolate' scope differs from normal scope in that it does not prototypically inherit from the parent scope. This is useful when creating reusable components, which should not accidentally read or modify data in the parent scope."},bindToController:{"!type":"bool","!url":"https://docs.angularjs.org/api/ng/service/$compile#-bindtocontroller-","!doc":"When an isolate scope is used for a component (see above), and controllerAs is used, bindToController: true will allow a component to have its properties bound to the controller, rather than to scope. When the controller is instantiated, the initial values of the isolate scope bindings are already available."},controller:{"!type":"fn()","!url":"https://docs.angularjs.org/api/ng/service/$compile#-require-","!doc":"Controller constructor function. The controller is instantiated before the pre-linking phase and it is shared with other directives (see require attribute). This allows the directives to communicate with each other and augment each other's behavior."},require:{"!type":"string","!url":"https://docs.angularjs.org/api/ng/service/$compile#-controller-","!doc":"Require another directive and inject its controller as the fourth argument to the linking function. The require takes a string name (or array of strings) of the directive(s) to pass in. If an array is used, the injected argument will be an array in corresponding order. If no such directive can be found, or if the directive does not have a controller, then an error is raised."},controllerAs:{"!type":"string","!url":"https://docs.angularjs.org/api/ng/service/$compile#-controlleras-","!doc":"Controller alias at the directive scope. An alias for the controller so it can be referenced at the directive template. The directive needs to define a scope for this configuration to be used. Useful in the case when directive is used as component."},restrict:{"!type":"string","!url":"https://docs.angularjs.org/api/ng/service/$compile#-restrict-","!doc":"String of subset of EACM which restricts the directive to a specific directive declaration style. If omitted, the defaults (elements and attributes) are used. E - Element name (default): . A - Attribute (default):
. C - Class:
. M - Comment: "},templateNamespace:{"!type":"string","!url":"https://docs.angularjs.org/api/ng/service/$compile#-templatenamespace-","!doc":"String representing the document type used by the markup in the template. AngularJS needs this information as those elements need to be created and cloned in a special way when they are defined outside their usual containers like and ."},template:{"!type":"string","!url":"https://docs.angularjs.org/api/ng/service/$compile#-template-","!doc":"HTML markup that may: Replace the contents of the directive's element (default). Replace the directive's element itself (if replace is true - DEPRECATED). Wrap the contents of the directive's element (if transclude is true)."},templateUrl:{"!type":"string","!url":"https://docs.angularjs.org/api/ng/service/$compile#-templateurl-","!doc":"This is similar to template but the template is loaded from the specified URL, asynchronously."},transclude:{"!type":"bool","!url":"https://docs.angularjs.org/api/ng/service/$compile#-transclude-","!doc":"Extract the contents of the element where the directive appears and make it available to the directive. The contents are compiled and provided to the directive as a transclusion function."},compile:{"!type":"fn(tElement: +Element, tAttrs: +Attr)","!url":"https://docs.angularjs.org/api/ng/service/$compile#-transclude-","!doc":"The compile function deals with transforming the template DOM. Since most directives do not do template transformation, it is not used often."},link:{"!type":"fn(scope: ?, iElement: +Element, iAttrs: +Attr, controller: ?, transcludeFn: fn())","!url":"https://docs.angularjs.org/api/ng/service/$compile#-link-","!doc":"The link function is responsible for registering DOM listeners as well as updating the DOM. It is executed after the template has been cloned. This is where most of the directive logic will be put."}},Module:{"!url":"http://docs.angularjs.org/api/angular.Module","!doc":"Interface for configuring angular modules.",prototype:{animation:{"!type":"fn(name: string, animationFactory: fn()) -> !this","!url":"http://docs.angularjs.org/api/angular.Module#animation","!doc":"Defines an animation hook that can be later used with $animate service and directives that use this service."},config:{"!type":"fn(configFn: fn()) -> !this","!effects":["custom angular_callInject 0"],"!url":"http://docs.angularjs.org/api/angular.Module#config","!doc":"Use this method to register work which needs to be performed on module loading."},constant:"service.$provide.constant",controller:{"!type":"fn(name: string, constructor: fn()) -> !this","!effects":["custom angular_regFieldCall"],"!url":"http://docs.angularjs.org/api/ng.$controllerProvider","!doc":"Register a controller."},directive:{"!type":"fn(name: string, directiveFactory: fn() -> directiveObj) -> !this","!effects":["custom angular_regFieldCall"],"!url":"http://docs.angularjs.org/api/ng.$compileProvider#directive","!doc":"Register a new directive with the compiler."},factory:"service.$provide.factory",filter:{"!type":"fn(name: string, filterFactory: fn()) -> !this","!effects":["custom angular_callInject 1"],"!url":"http://docs.angularjs.org/api/ng.$filterProvider","!doc":"Register filter factory function."},provider:"service.$provide.provider",run:{"!type":"fn(initializationFn: fn()) -> !this","!effects":["custom angular_callInject 0"],"!url":"http://docs.angularjs.org/api/angular.Module#run","!doc":"Register work which should be performed when the injector is done loading all modules."},service:"service.$provide.service",value:"service.$provide.value",name:{"!type":"string","!url":"http://docs.angularjs.org/api/angular.Module#name","!doc":"Name of the module."},requires:{"!type":"[string]","!url":"http://docs.angularjs.org/api/angular.Module#requires","!doc":"List of module names which must be loaded before this module."}}},Promise:{"!url":"http://docs.angularjs.org/api/ng.$q","!doc":"Allow for interested parties to get access to the result of the deferred task when it completes.",prototype:{then:"fn(successCallback: fn(value: ?), errorCallback: fn(reason: ?), notifyCallback: fn(value: ?)) -> +Promise","catch":"fn(errorCallback: fn(reason: ?))","finally":"fn(callback: fn()) -> +Promise",success:"fn(callback: fn(data: ?, status: number, headers: ?, config: ?)) -> +Promise",error:"fn(callback: fn(data: ?, status: number, headers: ?, config: ?)) -> +Promise"}},Deferred:{"!url":"http://docs.angularjs.org/api/ng.$q",prototype:{resolve:"fn(value: ?)",reject:"fn(reason: ?)",notify:"fn(value: ?)",promise:"+Promise"}},ResourceClass:{"!url":"http://docs.angularjs.org/api/ngResource.$resource",prototype:{$promise:"+Promise",$save:"fn()"}},Resource:{"!url":"http://docs.angularjs.org/api/ngResource.$resource",prototype:{get:"fn(params: ?, callback: fn()) -> +ResourceClass",save:"fn(params: ?, callback: fn()) -> +ResourceClass",query:"fn(params: ?, callback: fn()) -> +ResourceClass",remove:"fn(params: ?, callback: fn()) -> +ResourceClass","delete":"fn(params: ?, callback: fn()) -> +ResourceClass"}},service:{$anchorScroll:{"!type":"fn()","!url":"http://docs.angularjs.org/api/ng.$anchorScroll","!doc":"Checks current value of $location.hash() and scroll to related element."},$animate:{"!url":"http://docs.angularjs.org/api/ng.$animate","!doc":"Rudimentary DOM manipulation functions to insert, remove, move elements within the DOM.",addClass:{"!type":"fn(element: +Element, className: string, done?: fn()) -> !this","!url":"http://docs.angularjs.org/api/ng.$animate#addClass","!doc":"Adds the provided className CSS class value to the provided element."},enter:{"!type":"fn(element: +Element, parent: +Element, after: +Element, done?: fn()) -> !this","!url":"http://docs.angularjs.org/api/ng.$animate#enter","!doc":"Inserts the element into the DOM either after the after element or within the parent element."},leave:{"!type":"fn(element: +Element, done?: fn()) -> !this","!url":"http://docs.angularjs.org/api/ng.$animate#leave","!doc":"Removes the element from the DOM."},move:{"!type":"fn(element: +Element, parent: +Element, after: +Element, done?: fn()) -> !this","!url":"http://docs.angularjs.org/api/ng.$animate#move","!doc":"Moves element to be placed either after the after element or inside of the parent element."},removeClass:{"!type":"fn(element: +Element, className: string, done?: fn()) -> !this","!url":"http://docs.angularjs.org/api/ng.$animate#removeClass","!doc":"Removes the provided className CSS class value from the provided element."}},$cacheFactory:{"!type":"fn(cacheId: string, options?: ?) -> cacheObj","!url":"http://docs.angularjs.org/api/ng.$cacheFactory","!doc":"Factory that constructs cache objects and gives access to them."},$compile:{"!type":"fn(element: +Element, transclude: fn(scope: ?), maxPriority: number)","!url":"http://docs.angularjs.org/api/ng.$compile","!doc":"Compiles a piece of HTML string or DOM into a template and produces a template function."},$controller:{"!type":"fn(controller: fn(), locals: ?) -> ?","!url":"http://docs.angularjs.org/api/ng.$controller","!doc":"Instantiates controllers."},$document:{"!type":"jQuery.fn","!url":"http://docs.angularjs.org/api/ng.$document","!doc":"A jQuery (lite)-wrapped reference to the browser's window.document element."},$exceptionHandler:{"!type":"fn(exception: +Error, cause?: string)","!url":"http://docs.angularjs.org/api/ng.$exceptionHandler","!doc":"Any uncaught exception in angular expressions is delegated to this service."},$filter:{"!type":"fn(name: string) -> fn(input: string) -> string","!url":"http://docs.angularjs.org/api/ng.$filter","!doc":"Retrieve a filter function."},$http:{"!type":"fn(config: ?) -> service.$q","!url":"http://docs.angularjs.org/api/ng.$http","!doc":"Facilitates communication with remote HTTP servers.","delete":"fn(url: string, config?: ?) -> +Promise",get:"fn(url: string, config?: ?) -> +Promise",head:"fn(url: string, config?: ?) -> +Promise",jsonp:"fn(url: string, config?: ?) -> +Promise",post:"fn(url: string, data: ?, config?: ?) -> +Promise",put:"fn(url: string, data: ?, config?: ?) -> +Promise"},$interpolate:{"!type":"fn(text: string, mustHaveExpression?: bool, trustedContext?: string) -> fn(context: ?) -> string","!url":"http://docs.angularjs.org/api/ng.$interpolate","!doc":"Compiles a string with markup into an interpolation function."},$locale:{"!url":"http://docs.angularjs.org/api/ng.$locale",id:"string"},$location:{"!url":"http://docs.angularjs.org/api/ng.$location","!doc":"Parses the URL in the browser address bar.",absUrl:{"!type":"fn() -> string","!url":"http://docs.angularjs.org/api/ng.$location#absUrl","!doc":"Return full url representation."},hash:{"!type":"fn(value?: string) -> string","!url":"http://docs.angularjs.org/api/ng.$location#hash","!doc":"Get or set the hash fragment."},host:{"!type":"fn() -> string","!url":"http://docs.angularjs.org/api/ng.$location#host","!doc":"Return host of current url."},path:{"!type":"fn(value?: string) -> string","!url":"http://docs.angularjs.org/api/ng.$location#path","!doc":"Get or set the URL path."},port:{"!type":"fn() -> number","!url":"http://docs.angularjs.org/api/ng.$location#port","!doc":"Returns the port of the current url."},protocol:{"!type":"fn() -> string","!url":"http://docs.angularjs.org/api/ng.$location#protocol","!doc":"Return protocol of current url."},replace:{"!type":"fn()","!url":"http://docs.angularjs.org/api/ng.$location#replace","!doc":"Changes to $location during current $digest will be replacing current history record, instead of adding new one."},search:{"!type":"fn(search: string, paramValue?: string) -> string","!url":"http://docs.angularjs.org/api/ng.$location#search","!doc":"Get or set the URL query."},url:{"!type":"fn(url: string, replace?: string) -> string","!url":"http://docs.angularjs.org/api/ng.$location#url","!doc":"Get or set the current url."}},$log:{"!url":"http://docs.angularjs.org/api/ng.$log","!doc":"Simple service for logging.",debug:{"!type":"fn(message: string)","!url":"http://docs.angularjs.org/api/ng.$log#debug","!doc":"Write a debug message."},error:{"!type":"fn(message: string)","!url":"http://docs.angularjs.org/api/ng.$log#error","!doc":"Write an error message."},info:{"!type":"fn(message: string)","!url":"http://docs.angularjs.org/api/ng.$log#info","!doc":"Write an info message."},log:{"!type":"fn(message: string)","!url":"http://docs.angularjs.org/api/ng.$log#log","!doc":"Write a log message."},warn:{"!type":"fn(message: string)","!url":"http://docs.angularjs.org/api/ng.$log#warn","!doc":"Write a warning message."}},$parse:{"!type":"fn(expression: string) -> fn(context: ?, locals: ?) -> ?","!url":"http://docs.angularjs.org/api/ng.$parse","!doc":"Converts Angular expression into a function."},$q:{"!type":"fn(executor: fn(resolve: fn(value: ?) -> +Promise, reject: fn(value: ?) -> +Promise)) -> +Promise","!url":"http://docs.angularjs.org/api/ng.$q","!doc":"A promise/deferred implementation.",all:{"!type":"fn(promises: [+Promise]) -> +Promise","!url":"http://docs.angularjs.org/api/ng.$q#all","!doc":"Combines multiple promises into a single promise."},defer:{"!type":"fn() -> +Deferred","!url":"http://docs.angularjs.org/api/ng.$q#defer","!doc":"Creates a Deferred object which represents a task which will finish in the future."},reject:{"!type":"fn(reason: ?) -> +Promise","!url":"http://docs.angularjs.org/api/ng.$q#reject","!doc":"Creates a promise that is resolved as rejected with the specified reason."},when:{"!type":"fn(value: ?) -> +Promise","!url":"http://docs.angularjs.org/api/ng.$q#when","!doc":"Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise."}},$rootElement:{"!type":"+Element","!url":"http://docs.angularjs.org/api/ng.$rootElement","!doc":"The root element of Angular application."},$rootScope:{"!url":"http://docs.angularjs.org/api/ng.$rootScope",$apply:{"!type":"fn(expression: string)","!url":"http://docs.angularjs.org/api/ng.$rootScope.Scope#$apply","!doc":"Execute an expression in angular from outside of the angular framework."},$broadcast:{"!type":"fn(name: string, args?: ?) -> eventObj","!url":"http://docs.angularjs.org/api/ng.$rootScope.Scope#$broadcast","!doc":"Dispatches an event name downwards to all child scopes."},$destroy:{"!type":"fn()","!url":"http://docs.angularjs.org/api/ng.$rootScope.Scope#$destroy","!doc":"Removes the current scope (and all of its children) from the parent scope."},$digest:{"!type":"fn()","!url":"http://docs.angularjs.org/api/ng.$rootScope.Scope#$digest","!doc":"Processes all of the watchers of the current scope and its children."},$emit:{"!type":"fn(name: string, args?: ?) -> eventObj","!url":"http://docs.angularjs.org/api/ng.$rootScope.Scope#$emit","!doc":"Dispatches an event name upwards through the scope hierarchy."},$eval:{"!type":"fn(expression: string) -> ?","!url":"http://docs.angularjs.org/api/ng.$rootScope.Scope#$eval","!doc":"Executes the expression on the current scope and returns the result."},$evalAsync:{"!type":"fn(expression: string)","!url":"http://docs.angularjs.org/api/ng.$rootScope.Scope#$evalAsync","!doc":"Executes the expression on the current scope at a later point in time."},$new:{"!type":"fn(isolate: bool) -> service.$rootScope","!url":"http://docs.angularjs.org/api/ng.$rootScope.Scope#$new","!doc":"Creates a new child scope."},$on:{"!type":"fn(name: string, listener: fn(event: ?)) -> fn()","!url":"http://docs.angularjs.org/api/ng.$rootScope.Scope#$on","!doc":"Listens on events of a given type."},$watch:{"!type":"fn(watchExpression: string, listener?: fn(), objectEquality?: bool) -> fn()","!url":"http://docs.angularjs.org/api/ng.$rootScope.Scope#$watch","!doc":"Registers a listener callback to be executed whenever the watchExpression changes."},$watchCollection:{"!type":"fn(obj: string, listener: fn()) -> fn()","!url":"http://docs.angularjs.org/api/ng.$rootScope.Scope#$watchCollection","!doc":"Shallow watches the properties of an object and fires whenever any of the properties."},$id:{"!type":"number","!url":"http://docs.angularjs.org/api/ng.$rootScope.Scope#$id","!doc":"Unique scope ID."}},$sce:{HTML:"string",CSS:"string",URL:"string",RESOURCE_URL:"string",JS:"string",getTrusted:"fn(type: string, maybeTrusted: ?) -> !1",getTrustedCss:"fn(maybeTrusted: ?) -> !0",getTrustedHtml:"fn(maybeTrusted: ?) -> !0",getTrustedJs:"fn(maybeTrusted: ?) -> !0",getTrustedResourceUrl:"fn(maybeTrusted: ?) -> !0",getTrustedUrl:"fn(maybeTrusted: ?) -> !0",parse:"fn(type: string, expression: string) -> fn(context: ?, locals: ?) -> ?",parseAsCss:"fn(expression: string) -> fn(context: ?, locals: ?) -> ?",parseAsHtml:"fn(expression: string) -> fn(context: ?, locals: ?) -> ?",parseAsJs:"fn(expression: string) -> fn(context: ?, locals: ?) -> ?",parseAsResourceUrl:"fn(expression: string) -> fn(context: ?, locals: ?) -> ?",parseAsUrl:"fn(expression: string) -> fn(context: ?, locals: ?) -> ?",trustAs:"fn(type: string, value: ?) -> !1",trustAsHtml:"fn(value: ?) -> !0",trustAsJs:"fn(value: ?) -> !0",trustAsResourceUrl:"fn(value: ?) -> !0",trustAsUrl:"fn(value: ?) -> !0",isEnabled:"fn() -> bool"},$templateCache:{"!url":"http://docs.angularjs.org/api/ng.$templateCache","!proto":"cacheObj"},$timeout:{"!type":"fn(fn: fn(), delay?: number, invokeApply?: bool) -> +Promise","!url":"http://docs.angularjs.org/api/ng.$timeout","!doc":"Angular's wrapper for window.setTimeout.",cancel:"fn(promise: +Promise)"},$window:"",$injector:{"!url":"http://docs.angularjs.org/api/AUTO.$injector","!doc":"Retrieve object instances as defined by provider.",annotate:{"!type":"fn(f: fn()) -> [string]","!url":"http://docs.angularjs.org/api/AUTO.$injector#annotate","!doc":"Returns an array of service names which the function is requesting for injection."},get:{"!type":"fn(name: string) -> ?","!url":"http://docs.angularjs.org/api/AUTO.$injector#get","!doc":"Return an instance of a service."},has:{"!type":"fn(name: string) -> bool","!url":"http://docs.angularjs.org/api/AUTO.$injector#has","!doc":"Allows the user to query if the particular service exist."},instantiate:{"!type":"fn(type: fn(), locals?: ?) -> +!0","!url":"http://docs.angularjs.org/api/AUTO.$injector#instantiate","!doc":"Create a new instance of JS type."},invoke:{"!type":"fn(type: fn(), self?: ?, locals?: ?) -> !0.!ret","!url":"http://docs.angularjs.org/api/AUTO.$injector#invoke","!doc":"Invoke the method and supply the method arguments from the $injector."}},$provide:{"!url":"http://docs.angularjs.org/api/AUTO.$provide","!doc":"Use $provide to register new providers with the $injector.",constant:{"!type":"fn(name: string, value: ?) -> !this","!effects":["custom angular_regField"],"!url":"http://docs.angularjs.org/api/AUTO.$provide#constant","!doc":"A constant value."},decorator:{"!type":"fn(name: string, decorator: fn())","!effects":["custom angular_regFieldCall"],"!url":"http://docs.angularjs.org/api/AUTO.$provide#decorator","!doc":"Decoration of service, allows the decorator to intercept the service instance creation."},factory:{"!type":"fn(name: string, providerFunction: fn()) -> !this","!effects":["custom angular_regFieldCall"],"!url":"http://docs.angularjs.org/api/AUTO.$provide#factory","!doc":"A short hand for configuring services if only $get method is required."},provider:{"!type":"fn(name: string, providerType: fn()) -> !this","!effects":["custom angular_regFieldCall"],"!url":"http://docs.angularjs.org/api/AUTO.$provide#provider","!doc":"Register a provider for a service."},service:{"!type":"fn(name: string, constructor: fn()) -> !this","!effects":["custom angular_regFieldNew"],"!url":"http://docs.angularjs.org/api/AUTO.$provide#provider","!doc":"Register a provider for a service."},value:{"!type":"fn(name: string, object: ?) -> !this","!effects":["custom angular_regField"],"!url":"http://docs.angularjs.org/api/AUTO.$providevalue","!doc":"A short hand for configuring services if the $get method is a constant."}},$cookies:{"!url":"http://docs.angularjs.org/api/ngCookies.$cookies","!doc":"Provides read/write access to browser's cookies.",text:"string"},$resource:{"!type":"fn(url: string, paramDefaults?: ?, actions?: ?) -> +Resource","!url":"http://docs.angularjs.org/api/ngResource.$resource","!doc":"Creates a resource object that lets you interact with RESTful server-side data sources."},$route:{"!url":"http://docs.angularjs.org/api/ngRoute.$route","!doc":"Deep-link URLs to controllers and views.",reload:{"!type":"fn()","!url":"http://docs.angularjs.org/api/ngRoute.$route#reload","!doc":"Reload the current route even if $location hasn't changed."},current:{"!url":"http://docs.angularjs.org/api/ngRoute.$route#current","!doc":"Reference to the current route definition.",controller:"?",locals:"?"},routes:"[?]"},$sanitize:{"!type":"fn(string) -> string","!url":"http://docs.angularjs.org/api/ngSanitize.$sanitize","!doc":"Sanitize HTML input."},$swipe:{"!url":"http://docs.angularjs.org/api/ngTouch.$swipe","!doc":"A service that abstracts the messier details of hold-and-drag swipe behavior.",bind:{"!type":"fn(element: +Element, handlers: ?)","!url":"http://docs.angularjs.org/api/ngTouch.$swipe#bind","!doc":"Abstracts the messier details of hold-and-drag swipe behavior."}}}},angular:{bind:{"!type":"fn(self: ?, fn: fn(), args?: ?) -> !custom:angular_bind","!url":"http://docs.angularjs.org/api/angular.bind","!doc":"Returns a function which calls function fn bound to self."},bootstrap:{"!type":"fn(element: +Element, modules?: [string]) -> service.$injector","!url":"http://docs.angularjs.org/api/angular.bootstrap","!doc":"Use this function to manually start up angular application."},copy:{"!type":"fn(source: ?, target?: ?) -> !0","!url":"http://docs.angularjs.org/api/angular.copy","!doc":"Creates a deep copy of source, which should be an object or an array."},element:{"!type":"fn(element: +Element) -> jQuery.fn","!url":"http://docs.angularjs.org/api/angular.element","!doc":"Wraps a raw DOM element or HTML string as a jQuery element."},equals:{"!type":"fn(o1: ?, o2: ?) -> bool","!url":"http://docs.angularjs.org/api/angular.equals","!doc":"Determines if two objects or two values are equivalent."},extend:{"!type":"fn(dst: ?, src: ?) -> !0","!url":"http://docs.angularjs.org/api/angular.extend","!doc":"Extends the destination object dst by copying all of the properties from the src object(s) to dst."},forEach:{"!type":"fn(obj: ?, iterator: fn(value: ?, key: ?), context?: ?) -> !0","!effects":["call !1 this=!2 !0. number"],"!url":"http://docs.angularjs.org/api/angular.forEach","!doc":"Invokes the iterator function once for each item in obj collection, which can be either an object or an array."},fromJson:{"!type":"fn(json: string) -> ?","!url":"http://docs.angularjs.org/api/angular.fromJson","!doc":"Deserializes a JSON string."},identity:{"!type":"fn(val: ?) -> !0","!url":"http://docs.angularjs.org/api/angular.identity","!doc":"A function that returns its first argument."},injector:{"!type":"fn(modules: [string]) -> service.$injector","!url":"http://docs.angularjs.org/api/angular.injector","!doc":"Creates an injector function"},isArray:{"!type":"fn(val: ?) -> bool","!url":"http://docs.angularjs.org/api/angular.isArray","!doc":"Determines if a reference is an Array."},isDate:{"!type":"fn(val: ?) -> bool","!url":"http://docs.angularjs.org/api/angular.isDate","!doc":"Determines if a reference is a date."},isDefined:{"!type":"fn(val: ?) -> bool","!url":"http://docs.angularjs.org/api/angular.isDefined","!doc":"Determines if a reference is defined."},isElement:{"!type":"fn(val: ?) -> bool","!url":"http://docs.angularjs.org/api/angular.isElement","!doc":"Determines if a reference is a DOM element."},isFunction:{"!type":"fn(val: ?) -> bool","!url":"http://docs.angularjs.org/api/angular.isFunction","!doc":"Determines if a reference is a function."},isNumber:{"!type":"fn(val: ?) -> bool","!url":"http://docs.angularjs.org/api/angular.isNumber","!doc":"Determines if a reference is a number."},isObject:{"!type":"fn(val: ?) -> bool","!url":"http://docs.angularjs.org/api/angular.isObject","!doc":"Determines if a reference is an object."},isString:{"!type":"fn(val: ?) -> bool","!url":"http://docs.angularjs.org/api/angular.isString","!doc":"Determines if a reference is a string."},isUndefined:{"!type":"fn(val: ?) -> bool","!url":"http://docs.angularjs.org/api/angular.isUndefined","!doc":"Determines if a reference is undefined."},lowercase:{"!type":"fn(val: string) -> string","!url":"http://docs.angularjs.org/api/angular.lowercase","!doc":"Converts the specified string to lowercase."},module:{"!type":"fn(name: string, deps: [string]) -> !custom:angular_module","!url":"http://docs.angularjs.org/api/angular.module","!doc":"A global place for creating, registering and retrieving Angular modules."},Module:"Module",noop:{"!type":"fn()","!url":"http://docs.angularjs.org/api/angular.noop","!doc":"A function that performs no operations."},toJson:{"!type":"fn(val: ?) -> string","!url":"http://docs.angularjs.org/api/angular.toJson","!doc":"Serializes input into a JSON-formatted string."},uppercase:{"!type":"fn(string) -> string","!url":"http://docs.angularjs.org/api/angular.uppercase","!doc":"Converts the specified string to uppercase."},version:{"!url":"http://docs.angularjs.org/api/angular.version",full:"string",major:"number",minor:"number",dot:"number",codename:"string"}}}
+}),function(e){return"object"==typeof exports&&"object"==typeof module?e(require("../lib/infer"),require("../lib/tern"),require):"function"==typeof define&&define.amd?define("tern/plugin/orionExpress",["../lib/infer","../lib/tern","./resolver"],e):void e(infer,tern,resolver)}(function(e,t,r){function n(n,s,a,i){var l=t.resolvePos(n,a),c=e.findExpressionAround(n.ast,null,l,n.scope),p=r.getTemplatesForNode(o,c);if(p&&p.length>0)for(var d=0;d IRoute",get:"fn(handler: [RequestHandler]) -> IRoute",post:"fn(handler: [RequestHandler]) -> IRoute",put:"fn(handler: [RequestHandler]) -> IRoute","delete":"fn(handler: [RequestHandler]) -> IRoute",patch:"fn(handler: [RequestHandler]) -> IRoute",options:"fn(handler: [RequestHandler]) -> IRoute"},Router:{"!type":"fn(options?: ?) -> Router",prototype:{param:"fn(name: string, handler: RequestParamHandler) -> T",all:"?",get:"?",post:"?",put:"?","delete":"?",patch:"?",options:"?",route:"fn(path: string) -> IRoute",use:"fn(handler: [RequestHandler]) -> T"}},CookieOptions:{maxAge:"number",signed:"bool",expires:"Date",httpOnly:"bool",path:"string",domain:"string",secure:"bool"},Errback:{},Request:{get:"fn(name: string) -> string",header:"fn(name: string) -> string",headers:{},accepts:"fn(type: string) -> string",acceptsCharset:"fn(charset: string) -> bool",acceptsLanguage:"fn(lang: string) -> bool",range:"fn(size: number) -> [?]",accepted:"[MediaType]",acceptedLanguages:"[?]",acceptedCharsets:"[?]",param:"fn(name: string, defaultValue?: ?) -> string",is:"fn(type: string) -> bool",protocol:"string",secure:"bool",ip:"string",ips:"[string]",subdomains:"[string]",path:"string",hostname:"string",host:"string",fresh:"bool",stale:"bool",xhr:"bool",body:"?",cookies:"?",method:"string",params:"?",user:"?",authenticatedUser:"?",files:"?",clearCookie:"fn(name: string, options?: ?) -> Response",query:"?",route:"?",signedCookies:"?",originalUrl:"string",url:"string"},MediaType:{value:"string",quality:"number",type:"string",subtype:"string"},Send:{},Response:{status:"fn(code: number) -> Response",sendStatus:"fn(code: number) -> Response",links:"fn(links: ?) -> Response",send:"Send",json:"Send",jsonp:"Send",sendFile:"fn(path: string)",sendfile:"fn(path: string)",download:"fn(path: string)",contentType:"fn(type: string) -> Response",type:"fn(type: string) -> Response",format:"fn(obj: ?) -> Response",attachment:"fn(filename?: string) -> Response",set:"fn(field: ?) -> Response",header:"fn(field: ?) -> Response",headersSent:"bool",get:"fn(field: string) -> string",clearCookie:"fn(name: string, options?: ?) -> Response",cookie:"fn(name: string, val: string, options: CookieOptions) -> Response",location:"fn(url: string) -> Response",redirect:"fn(url: string)",render:"fn(view: string, options?: Object, callback?: fn(err: Error, html: string))",locals:"?",charset:"string"},ErrorRequestHandler:{},RequestHandler:{},Handler:{},RequestParamHandler:{},Application:{init:"fn()",defaultConfiguration:"fn()",engine:"fn(ext: string, fn: Function) -> Application",set:"fn(setting: string, val: ?) -> Application",get:{},path:"fn() -> string",enabled:"fn(setting: string) -> bool",disabled:"fn(setting: string) -> bool",enable:"fn(setting: string) -> Application",disable:"fn(setting: string) -> Application",configure:"fn(fn: Function) -> Application",render:"fn(name: string, options?: Object, callback?: fn(err: Error, html: string))",listen:"fn(port: number, hostname: string, backlog: number, callback?: Function) -> http.Server",route:"fn(path: string) -> IRoute",router:"string",settings:"?",resource:"?",map:"?",locals:"?",routes:"?"},Express:{version:"string",mime:"string",createApplication:"fn() -> Application",createServer:"fn() -> Application",application:"?",request:"Request",response:"Response"},"static":"fn(root: string, options?: ?) -> RequestHandler"},"!name":"express","!define":{"!node":{express:{"!type":"fn() -> express.Application","!url":"http://expressjs.com","!doc":"Creates an express application.",Router:{"!type":"fn(options?: express.RouterOptions) -> +express.Router"}}}}}}),function(e){return"object"==typeof exports&&"object"==typeof module?e(require("../lib/infer"),require("../lib/tern"),require):"function"==typeof define&&define.amd?define("tern/plugin/orionMongoDB",["../lib/infer","../lib/tern","./resolver"],e):void e(infer,tern,resolver)}(function(e,t,r){function n(n,s,a,i){var l=t.resolvePos(n,a),c=e.findExpressionAround(n.ast,null,l,n.scope),p=r.getTemplatesForNode(o,c);if(p&&p.length>0)for(var d=0;d ?"}},Db:{"!type":"fn(databaseName: string, serverConfig: Server, dbOptions?: DbCreateOptions)",prototype:{db:"fn(dbName: string) -> Db",open:"fn(callback: fn(err: Error, db: Db))",close:"fn(forceClose?: bool, callback?: fn(err: Error, result: ?))",admin:"fn(callback: fn(err: Error, result: ?)) -> ?",collectionsInfo:"fn(collectionName: string, callback?: fn(err: Error, result: ?))",collectionNames:"fn(collectionName: string, options: ?, callback?: fn(err: Error, result: ?))",collection:"fn(collectionName: string) -> Collection",collections:"fn(callback: fn(err: Error, collections: [Collection]))",eval:"fn(code: ?, parameters: [?], options?: ?, callback?: fn(err: Error, result: ?))",logout:"fn(options: ?, callback?: fn(err: Error, result: ?))",authenticate:"fn(userName: string, password: string, callback?: fn(err: Error, result: ?))",addUser:"fn(username: string, password: string, callback?: fn(err: Error, result: ?))",removeUser:"fn(username: string, callback?: fn(err: Error, result: ?))",createCollection:"fn(collectionName: string, callback?: fn(err: Error, result: Collection))",command:"fn(selector: Object, callback?: fn(err: Error, result: ?))",dropCollection:"fn(collectionName: string, callback?: fn(err: Error, result: ?))",renameCollection:"fn(fromCollection: string, toCollection: string, callback?: fn(err: Error, result: ?))",lastError:"fn(options: Object, connectionOptions: ?, callback: fn(err: Error, result: ?))",previousError:"fn(options: Object, callback: fn(err: Error, result: ?))",executeDbCommand:"fn(command_hash: ?, callback?: fn(err: Error, result: ?))",executeDbAdminCommand:"fn(command_hash: ?, callback?: fn(err: Error, result: ?))",resetErrorHistory:"fn(callback?: fn(err: Error, result: ?))",createIndex:"fn(collectionName: ?, fieldOrSpec: ?, options: IndexOptions, callback: Function)",ensureIndex:"fn(collectionName: ?, fieldOrSpec: ?, options: IndexOptions, callback: Function)",cursorInfo:"fn(options: ?, callback: Function)",dropIndex:"fn(collectionName: string, indexName: string, callback: Function)",reIndex:"fn(collectionName: string, callback: Function)",indexInformation:"fn(collectionName: string, options: ?, callback: Function)",dropDatabase:"fn(callback: fn(err: Error, result: ?))",stats:"fn(options: ?, callback: Function)",_registerHandler:"fn(db_command: ?, raw: ?, connection: ?, exhaust: ?, callback: Function)",_reRegisterHandler:"fn(newId: ?, object: ?, callback: Function)",_callHandler:"fn(id: ?, document: ?, err: ?) -> ?",_hasHandler:"fn(id: ?) -> ?",_removeHandler:"fn(id: ?) -> ?",_findHandler:"fn(id: ?) -> ret",__executeQueryCommand:"fn(self: ?, db_command: ?, options: ?, callback: ?)",DEFAULT_URL:"string",connect:"fn(url: string, options: Object, callback: fn(err: Error, result: ?))",addListener:"fn(event: string, handler: fn(param: ?)) -> ?"}},SocketOptions:{timeout:"number",noDelay:"bool",keepAlive:"number",encoding:"string"},ServerOptions:{auto_reconnect:"bool",poolSize:"number",socketOptions:"?"},PKFactory:{counter:"number",createPk:"fn()"},DbCreateOptions:{w:"?",wtimeout:"number",fsync:"bool",journal:"bool",readPreference:"string",native_parser:"bool",forceServerObjectId:"bool",pkFactory:"PKFactory",serializeFunctions:"bool",raw:"bool",recordQueryStats:"bool",retryMiliSeconds:"number",numberOfRetries:"number",logger:"Object",slaveOk:"number",promoteLongs:"bool"},ReadPreference:{PRIMARY:"string",PRIMARY_PREFERRED:"string",SECONDARY:"string",SECONDARY_PREFERRED:"string",NEAREST:"string",prototype:{}},CollectionCreateOptions:{readPreference:"string",slaveOk:"bool",serializeFunctions:"bool",raw:"bool",pkFactory:"PKFactory"},CollStats:{ns:"string",count:"number",size:"number",avgObjSize:"number",storageSize:"number",numExtents:"number",nindexes:"number",lastExtentSize:"number",paddingFactor:"number",flags:"number",totalIndexSize:"number",indexSizes:{_id_:"number",username:"number"}},Collection:{insert:"fn(query: ?, callback: fn(err: Error, result: ?))",remove:"fn(selector: Object, callback?: fn(err: Error, result: ?))",rename:"fn(newName: String, callback?: fn(err: Error, result: ?))",save:"fn(doc: ?, callback: fn(err: Error, result: ?))",update:"fn(selector: Object, document: ?, callback?: fn(err: Error, result: ?))",distinct:"fn(key: string, query: Object, callback: fn(err: Error, result: ?))",count:"fn(callback: fn(err: Error, result: ?))",drop:"fn(callback?: fn(err: Error, result: ?))",findAndModify:"fn(query: Object, sort: [?], doc: Object, callback: fn(err: Error, result: ?))",findAndRemove:"fn(query: Object, sort?: [?], callback?: fn(err: Error, result: ?))",find:"fn(callback?: fn(err: Error, result: Cursor)) -> Cursor",findOne:"fn(callback?: fn(err: Error, result: ?)) -> Cursor",createIndex:"fn(fieldOrSpec: ?, callback: fn(err: Error, indexName: string))",ensureIndex:"fn(fieldOrSpec: ?, callback: fn(err: Error, indexName: string))",indexInformation:"fn(options: ?, callback: Function)",dropIndex:"fn(name: string, callback: Function)",dropAllIndexes:"fn(callback: Function)",reIndex:"fn(callback: Function)",mapReduce:"fn(map: Function, reduce: Function, options: MapReduceOptions, callback: Function)",group:"fn(keys: Object, condition: Object, initial: Object, reduce: Function, finalize: Function, command: bool, options: Object, callback: Function)",options:"fn(callback: Function)",isCapped:"fn(callback: Function)",indexExists:"fn(indexes: string, callback: Function)",geoNear:"fn(x: number, y: number, callback: Function)",geoHaystackSearch:"fn(x: number, y: number, callback: Function)",indexes:"fn(callback: Function)",aggregate:"fn(pipeline: [?], callback: fn(err: Error, results: ?))",stats:"fn(options: Object, callback: fn(err: Error, results: CollStats))",hint:"?"},MapReduceOptions:{out:"Object",query:"Object",sort:"Object",limit:"number",keeptemp:"bool",finalize:"?",scope:"Object",jsMode:"bool",verbose:"bool",readPreference:"string"},IndexOptions:{w:"?",wtimeout:"number",fsync:"bool",journal:"bool",unique:"bool",sparse:"bool",background:"bool",dropDups:"bool",min:"number",max:"number",v:"number",expireAfterSeconds:"number",name:"string"},Cursor:{INIT:"number",OPEN:"number",CLOSED:"number",GET_MORE:"number",prototype:{rewind:"fn() -> Cursor",toArray:"fn(callback: fn(err: Error, results: [?]))",each:"fn(callback: fn(err: Error, item: ?))",count:"fn(applySkipLimit: bool, callback: fn(err: Error, count: number))",sort:"fn(keyOrList: ?, callback?: fn(err: Error, result: ?)) -> Cursor",limit:"fn(limit: number, callback?: fn(err: Error, result: ?)) -> Cursor",setReadPreference:"fn(preference: string, callback?: Function) -> Cursor",skip:"fn(skip: number, callback?: fn(err: Error, result: ?)) -> Cursor",batchSize:"fn(batchSize: number, callback?: fn(err: Error, result: ?)) -> Cursor",nextObject:"fn(callback: fn(err: Error, doc: ?))",explain:"fn(callback: fn(err: Error, result: ?))",stream:"fn() -> CursorStream",close:"fn(callback: fn(err: Error, result: ?))",isClosed:"fn() -> bool"}},CursorStream:{"!type":"fn(cursor: Cursor)",prototype:{pause:"fn() -> ?",resume:"fn() -> ?",destroy:"fn() -> ?"}},CollectionFindOptions:{limit:"number",sort:"?",fields:"Object",skip:"number",hint:"Object",explain:"bool",snapshot:"bool",timeout:"bool",tailtable:"bool",tailableRetryInterval:"number",numberOfRetries:"number",awaitdata:"bool",oplogReplay:"bool",exhaust:"bool",batchSize:"number",returnKey:"bool",maxScan:"number",min:"number",max:"number",showDiskLoc:"bool",comment:"String",raw:"bool",readPreference:"String",partial:"bool"},MongoCollectionOptions:{safe:"?",serializeFunctions:"?",raw:"bool",pkFactory:"?",readPreference:"string"}},"!name":"mongodb","!define":{"!node":{mongodb:{"!doc":"MongoDB","!url":"https://www.mongodb.org/",MongoClient:"mongodb.MongoClient",Db:"mongodb.Db",Server:"mongodb.Server",SocketOptions:"mongodb.SocketOptions",ServerOptions:"mongodb.ServerOptions",CollectionFindOptions:"mongodb.CollectionFindOptions",MongoCollectionOptions:"mongodb.MongoCollectionOptions",IndexOptions:"mongodb.IndexOptions",CollectionCreateOptions:"mongodb.CollectionCreateOptions",DbCreateOptions:"mongodb.DbCreateOptions",MapReduceOptions:"mongodb.MapReduceOptions",CollStats:"mongodb.CollStats",ReadPreference:"mongodb.ReadPreference",Collection:"mongodb.Collection",Cursor:"mongodb.Cursor",PKFactory:"mongodb.PKFactory"}}}}}),function(e){return"object"==typeof exports&&"object"==typeof module?e(require("../lib/infer"),require("../lib/tern"),require):"function"==typeof define&&define.amd?define("tern/plugin/orionMySQL",["../lib/infer","../lib/tern","./resolver"],e):void e(infer,tern,resolver)}(function(e,t,r){function n(n,s,a,i){var l=t.resolvePos(n,a),c=e.findExpressionAround(n.ast,null,l,n.scope),p=r.getTemplatesForNode(o,c);if(p&&p.length>0)for(var d=0;d Connection",createPool:"fn(config: PoolConfig) -> Pool",createPoolCluster:"fn(config?: PoolClusterConfig) -> PoolCluster",escape:"fn(value: ?) -> string",format:"fn(sql: string) -> string",MySql:{createConnection:"fn(connectionUri: string) -> Connection",createPool:"fn(config: PoolConfig) -> Pool",createPoolCluster:"fn(config?: PoolClusterConfig) -> PoolCluster",escape:"fn(value: ?) -> string",format:"fn(sql: string) -> string"},ConnectionStatic:{createQuery:"fn(sql: string) -> Query"},Connection:{config:"ConnectionConfig",threadId:"number",beginTransaction:"fn(callback: fn(err: Error))",connect:"fn()",commit:"fn(callback: fn(err: Error))",changeUser:"fn(options: ConnectionOptions)",query:"QueryFunction",end:"fn()",destroy:"fn()",pause:"fn()",release:"fn()",resume:"fn()",escape:"fn(value: ?) -> string",escapeId:"fn(value: string) -> string",format:"fn(sql: string) -> string",on:"fn(ev: string, callback: fn(args: [?])) -> Connection",rollback:"fn(callback: fn())"},Pool:{config:"PoolConfig",getConnection:"fn(callback: fn(err: Error, connection: Connection))",query:"QueryFunction",end:"fn()",on:"fn(ev: string, callback: fn(args: [?])) -> Pool"},PoolCluster:{config:"PoolClusterConfig",add:"fn(config: PoolConfig)",end:"fn()",getConnection:"fn(callback: fn(err: Error, connection: Connection))",of:"fn(pattern: string) -> Pool",on:"fn(ev: string, callback: fn(args: [?])) -> PoolCluster"},Query:{sql:"string",start:"fn()",determinePacket:"fn(firstByte: number, parser: ?) -> ?",stream:"fn(options: StreamOptions) -> stream.Readable",pipe:"fn(callback: fn(args: [?])) -> Query",on:"fn(ev: string, callback: fn(args: [?])) -> Query"},QueryFunction:{},QueryOptions:{sql:"string",timeout:"number",nestTables:"?",typeCast:"?"},StreamOptions:{highWaterMark:"number",objectMode:"?"},ConnectionOptions:{user:"string",password:"string",database:"string",charset:"string"},ConnectionConfig:{host:"string",port:"number",localAddress:"string",socketPath:"string",timezone:"string",connectTimeout:"number",stringifyObjects:"bool",insecureAuth:"bool",typeCast:"?",queryFormat:"fn(query: string, values: ?)",supportBigNumbers:"bool",bigNumberStrings:"bool",dateStrings:"bool",debug:"?",trace:"bool",multipleStatements:"bool",flags:"?",ssl:"?"},PoolConfig:{acquireTimeout:"number",waitForConnections:"bool",connectionLimit:"number",queueLimit:"number"},PoolClusterConfig:{canRetry:"bool",removeNodeErrorCount:"number",defaultSelector:"string"},SslCredentials:{pfx:"string",key:"string",passphrase:"string",cert:"string",ca:"?",crl:"?",ciphers:"string"},Error:{code:"string",errno:"number",sqlStateMarker:"string",sqlState:"string",fieldCount:"number",stack:"string",fatal:"bool"}},"!name":"mysql","!define":{"!node":{mysql:{createConnection:"fn(connectionUri: string) -> mysql.Connection",createPool:"fn(config: mysql.PoolConfig) -> mysql.Pool",createPoolCluster:"fn(config?: mysql.PoolClusterConfig) -> mysql.PoolCluster",escape:"fn(value: ?) -> string",format:"fn(sql: string) -> string"}}}}}),function(e){return"object"==typeof exports&&"object"==typeof module?e(require("../lib/infer"),require("../lib/tern"),require):"function"==typeof define&&define.amd?define("tern/plugin/node",["../lib/infer","../lib/tern","./resolver"],e):void e(tern,tern)}(function(e,t,r,n){"use strict";function o(e,t){if("/"==t[0])return t;var r,n=e.lastIndexOf("/");for(n>=0&&(t=e.slice(0,n+1)+t);r=/[^\/]*[^\/\.][^\/]*\/\.\.\//.exec(t);)t=t.slice(0,r.index)+t.slice(r.index+r[0].length);return t.replace(/(^|[^\.])\.\//g,"$1")}function s(e,t){return"/"!=e[e.length-1]&&(e+="/"),0==t.indexOf(e)?t.slice(e.length):t}function a(t,r){return t.modules[r]||(t.modules[r]=new e.AVal)}function i(t,r,n){var o=new e.Scope(t);o.originNode=n,e.cx().definitions.node.require.propagate(o.defProp("require"));var s=new e.Obj(e.cx().definitions.node.Module.getProp("prototype").getType());s.propagate(o.defProp("module"));var a=new e.Obj(!0,"exports");s.origin=a.origin=r,s.originNode=a.originNode=o.originNode,a.propagate(o.defProp("exports"));var i=o.exports=s.defProp("exports");return a.propagate(i,y),o}function l(e,t){return e.addFile(t,null,e._node.currentOrigin),a(e._node,t)}function c(e){return e.replace(/\\/g,"/")}function p(e,t){return o(c(e.options.projectDir||"")+"/",c(t))}function d(t){var r=e.cx().parent._node.modules,n=t.roots["!node"]=new e.Obj(null);for(var o in r){var s=r[o],a=s.origin||o,i=n.defProp(a.replace(/\./g,"`"));s.propagate(i),i.origin=s.origin}}function u(t){var r=e.cx(),n=r.definitions[t["!name"]]["!node"],t=r.parent._node;if(n)for(var o in n.props){var s=o.replace(/`/g,"."),i=a(t,s);i.origin=s,n.props[o].propagate(i)}}function h(e,t,r,n){if(!r)return n;var o="Literal"===r.node.type&&"string"==typeof r.node.value,s=!!r.node.required;if(o&&s){n=Object.create(n);var a;r.node.required&&(a=r.node.required.getType())&&(n.origin=a.origin,n.originNode=a.originNode)}return n}function f(r,n){var o=t.resolvePos(r,n.end),s=e.findExpressionAround(r.ast,null,o,r.scope,"CallExpression");if(s){var a=s.node;if(!("Identifier"!=a.callee.type||"require"!=a.callee.name||a.arguments.length<1)){var i=a.arguments[0];if(!("Literal"!=i.type||"string"!=typeof i.value||i.start>o||i.end