You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2018/03/15 14:34:59 UTC

[sling-org-apache-sling-scripting-esx] branch master created (now 721a649)

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-esx.git.


      at 721a649  Added LICENSE file

This branch includes the following new commits:

     new 398819a  SLING-6680 - new esx/Nashorn script engine, contributed by Senol Tas, thanks!
     new 40079be  SLING-6680 - pom tweaks and remove @author tag that we don't use in Sling code
     new 2581f14  SLING-6680 - start with a low release number
     new 0f56f84  SLING-6680 - gitignore
     new 6731b2b  SLING-6680 - mark this experimental
     new e2db3d3  SLING-6763 - remove org.apache.sling.commons.json and add sling-babel, contributed by Senol Tas, thanks!
     new 3ed041d  SLING-6763 - suggest the new org.apache.sling.fragment.nashorn fragment bundle instead of editing sling.properties + tweaks
     new 998e309  SLING-6763 - fix example
     new 4efc4d5  SLING-7167 Adjust READMEs
     new 721a649  Added LICENSE file

The 10 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


-- 
To stop receiving notification emails like this one, please contact
rombert@apache.org.

[sling-org-apache-sling-scripting-esx] 02/10: SLING-6680 - pom tweaks and remove @author tag that we don't use in Sling code

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-esx.git

commit 40079be5c34a2bf5e9c5993868c336200c55632e
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Mar 24 15:14:38 2017 +0000

    SLING-6680 - pom tweaks and remove @author tag that we don't use in Sling code
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1788469 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            | 35 +++++-----------------
 .../org/apache/sling/scripting/esx/Require.java    |  7 +----
 2 files changed, 8 insertions(+), 34 deletions(-)

diff --git a/pom.xml b/pom.xml
index 367ad76..352e97d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,10 +30,16 @@
     <groupId>org.apache.sling</groupId>
     <artifactId>org.apache.sling.scripting.esx</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0-SNAPSHOT</version>
+    <version>1.0.0-SNAPSHOT</version>
     <name>Apache Sling Scripting ESX</name>
     <description>Support NodeJS like scripting and module resolution</description>
 
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <sling.java.version>8</sling.java.version>
+    </properties>
+
     <build>
         <resources>
             <!-- filter meta information to get some properties into the files -->
@@ -163,7 +169,6 @@
             <version>2.0.19-SNAPSHOT</version>
             <scope>provided</scope>
         </dependency>
-        
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
@@ -189,30 +194,4 @@
             <type>jar</type>
         </dependency>
     </dependencies>
-    <properties>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-        <sling.java.version>8</sling.java.version>
-    </properties>
-    <profiles>
-        <profile>
-            <id>autoInstallBundle</id>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>org.apache.sling</groupId>
-                        <artifactId>maven-sling-plugin</artifactId>
-                        <executions>
-                            <execution>
-                                <id>install-bundle</id>
-                                <goals>
-                                    <goal>install</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>                    
-                </plugins>
-            </build>
-        </profile>
-    </profiles>
 </project>
diff --git a/src/main/java/org/apache/sling/scripting/esx/Require.java b/src/main/java/org/apache/sling/scripting/esx/Require.java
index 7d13380..a13040b 100644
--- a/src/main/java/org/apache/sling/scripting/esx/Require.java
+++ b/src/main/java/org/apache/sling/scripting/esx/Require.java
@@ -19,11 +19,6 @@ package org.apache.sling.scripting.esx;
 import java.io.IOException;
 import javax.script.ScriptException;
 
-/**
- *
- * @author stas
- */
-@FunctionalInterface
 public interface Require {
     public Object require(String id) throws ScriptException, IOException;
-}
\ No newline at end of file
+}

-- 
To stop receiving notification emails like this one, please contact
rombert@apache.org.

[sling-org-apache-sling-scripting-esx] 06/10: SLING-6763 - remove org.apache.sling.commons.json and add sling-babel, contributed by Senol Tas, thanks!

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-esx.git

commit e2db3d30a67c124d50b131fe9167ce64ccbb1767
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Tue Apr 11 09:30:28 2017 +0000

    SLING-6763 - remove org.apache.sling.commons.json and add sling-babel, contributed by Senol Tas, thanks!
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1790947 13f79535-47bb-0310-9956-ffa450edef68
---
 .gitignore                                         |     1 +
 README.md                                          |    22 +-
 .../lib}/index.js                                  |    20 +-
 .../lib/sling-sandbox-plugin}/index.js             |    34 +-
 babel-plugin-sling-sandbox/package.json            |    22 +
 .../webpack.config.js                              |    35 +-
 .../page/helper/pathinfo/index.js => gulpfile.js   |    21 +-
 package.json                                       |    17 +
 pom.xml                                            |    43 +-
 .../scripting/esx/EsxScriptEngineFactory.java      |     7 +
 .../org/apache/sling/scripting/esx/Module.java     |    89 +-
 .../esx/services/ScriptSandboxService.java}        |    15 +-
 .../services/impl/ScriptSandboxServiceImpl.java    |   104 +
 src/main/resources/internal/sling-babel.js         | 92949 +++++++++++++++++++
 .../components/esx_modules/BlogComponent/index.js  |   110 +-
 .../calculator/calculator.js}                      |    16 +-
 .../components/esx_modules/calculator/package.json |     3 +
 .../{page/helper => esx_modules}/pathinfo/index.js |     0
 .../esx/demo/components/hbstemplates/layout.html   |    14 +-
 .../libs/esx/demo/components/page/page.esx         |    41 +-
 .../index.js => templates/listing-small.html}      |    23 +-
 .../libs/esx/demo/components/post/post.esx         |    21 +-
 src/main/resources/libs/esx/demo/content/demo.xml  |     4 +
 src/main/resources/libs/esx/demo/package.json      |     1 +
 24 files changed, 93377 insertions(+), 235 deletions(-)

diff --git a/.gitignore b/.gitignore
index 49a77af..1deaec1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ target
 .project
 settings.xml
 node_modules
+node
diff --git a/README.md b/README.md
index 1e3d320..3c74d20 100644
--- a/README.md
+++ b/README.md
@@ -27,7 +27,7 @@ This module implements a Nashorn Apache Sling Script Engine for the "esx" extens
 
 It requires a function named `render` in the `esx` script that processes the request.
 
-To activate this script engine you must first **enable Nashorn support** in the 
+To activate this script engine you must first **enable Nashorn support** in the
 `sling.properties` file of your Sling instance:
 
 ```
@@ -45,27 +45,27 @@ First create a node with some content:
 	  -Ftitle="Hello ESX" \
 	  -Ftext="Here's some example text" \
 	  http://localhost:8080/apps/foo
-	  
+
 Then create an ESX script to render it:
 
     $ cat << EOF > /tmp/foo.esx
     var foo = {
       render: function () {
-        var output  = "<h1>" + currentNode.properties.title + "</h1>";             
+        var output  = '<h1>\${currentNode.properties.title}</h1>';
         output += currentNode.properties.text;
         return output;     
       }
     }  
     module.exports = foo;
     EOF
-	
+
     $ curl -u admin:admin -T /tmp/foo.esx http://localhost:8080/apps/foo/foo.esx
-   
+
     $ curl http://localhost:8080/apps/foo.html
     <h1>Hello ESX</h1>Here's some example text
-  	  
 
-An ESX file is a regular java script file. 
+
+An ESX file is a regular java script file.
 
 The NodeJS module resolution (https://nodejs.org/api/modules.html) is implemented to give access to the
 rich collection of Node modules.
@@ -97,12 +97,8 @@ We have borrowed the requirejs loader plugin syntax instead (see http://requirej
 - json loader  (e.g. ```require("./dict/en.json```)
   - the json as a whole will be exported as a javascript Object
 
-## Installing Demo Application
-Currently the demo application is bundles with the engine bundle. To install the engine with the demo application, follow this steps:
-- switch to directory src/main/resources/libs/esx/demo
-- run: npm install
-- go back to package root directory
-- run mvn clean install sling:installĀ“
+##  Demo Application
+Currently the demo application is bundles with the engine bundle.
 
 open http://localhost:8080/libs/esx/demo/content/demo.html
 
diff --git a/src/main/resources/libs/esx/demo/components/page/helper/pathinfo/index.js b/babel-plugin-sling-sandbox/lib/index.js
similarity index 71%
copy from src/main/resources/libs/esx/demo/components/page/helper/pathinfo/index.js
copy to babel-plugin-sling-sandbox/lib/index.js
index fba66fa..8aca061 100644
--- a/src/main/resources/libs/esx/demo/components/page/helper/pathinfo/index.js
+++ b/babel-plugin-sling-sandbox/lib/index.js
@@ -14,17 +14,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-var _ = require('underscore');
-var pathInfo = sling.request.requestPathInfo;
+var SlingSandbox = require("./sling-sandbox-plugin");
+var Babel = require("babel-standalone");
+var template = require("babel-template");
 
-/**
- *
- * @param {string} selector to be searched for
- * @return {boolean}
- */
-function hasSelector(selector) {
-    return _.contains(pathInfo.selectors, selector);
-}
-
-exports.extension = pathInfo.extension;
-exports.hasSelector = hasSelector;
\ No newline at end of file
+require("babel-types");
+require("babel-plugin-transform-react-jsx");
+Babel.registerPlugin("SlingSandbox". SlingSandbox);
+module.exports = Babel;
\ No newline at end of file
diff --git a/src/main/resources/libs/esx/demo/components/page/helper/pathinfo/index.js b/babel-plugin-sling-sandbox/lib/sling-sandbox-plugin/index.js
similarity index 58%
copy from src/main/resources/libs/esx/demo/components/page/helper/pathinfo/index.js
copy to babel-plugin-sling-sandbox/lib/sling-sandbox-plugin/index.js
index fba66fa..e00d272 100644
--- a/src/main/resources/libs/esx/demo/components/page/helper/pathinfo/index.js
+++ b/babel-plugin-sling-sandbox/lib/sling-sandbox-plugin/index.js
@@ -14,17 +14,23 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-var _ = require('underscore');
-var pathInfo = sling.request.requestPathInfo;
-
-/**
- *
- * @param {string} selector to be searched for
- * @return {boolean}
- */
-function hasSelector(selector) {
-    return _.contains(pathInfo.selectors, selector);
-}
-
-exports.extension = pathInfo.extension;
-exports.hasSelector = hasSelector;
\ No newline at end of file
+module.exports = function (babel) {
+  const { types: t } = babel;
+ 
+  return {
+    visitor: {
+        BlockStatement(path) {
+            var threadInterrupted =  t.callExpression(
+                    t.memberExpression(
+                        t.identifier('SlingSandbox'),
+                        t.identifier('checkInterrupted'))
+                , []);
+          
+          path.unshiftContainer('body',
+            t.expressionStatement(
+                threadInterrupted
+            )                                                              );
+        }
+    }
+  };
+}
\ No newline at end of file
diff --git a/babel-plugin-sling-sandbox/package.json b/babel-plugin-sling-sandbox/package.json
new file mode 100644
index 0000000..afab249
--- /dev/null
+++ b/babel-plugin-sling-sandbox/package.json
@@ -0,0 +1,22 @@
+{
+  "name": "babel-plugin-sling-sandbox",
+  "version": "0.0.1",
+  "description": "Babel Sandbox Plugin for Apache Sling ESX scripting",
+  "main": "lib/index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1",
+    "postinstall": "webpack"
+  },
+  "author": "",
+  "license": "Apache-2.0",
+  "dependencies": {
+    "babel-core": "^6.24.1",
+    "babel-loader": "^6.4.1",
+    "babel-plugin-transform-react-jsx": "^6.24.1",
+    "babel-preset-es2015": "^6.24.1",
+    "babel-standalone": "^6.24.0",
+    "babel-template": "^6.24.1",
+    "babel-types": "^6.24.1",
+    "webpack": "^2.3.3"
+  }
+}
diff --git a/src/main/resources/libs/esx/demo/components/page/helper/pathinfo/index.js b/babel-plugin-sling-sandbox/webpack.config.js
similarity index 61%
copy from src/main/resources/libs/esx/demo/components/page/helper/pathinfo/index.js
copy to babel-plugin-sling-sandbox/webpack.config.js
index fba66fa..ddae5c4 100644
--- a/src/main/resources/libs/esx/demo/components/page/helper/pathinfo/index.js
+++ b/babel-plugin-sling-sandbox/webpack.config.js
@@ -14,17 +14,24 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-var _ = require('underscore');
-var pathInfo = sling.request.requestPathInfo;
-
-/**
- *
- * @param {string} selector to be searched for
- * @return {boolean}
- */
-function hasSelector(selector) {
-    return _.contains(pathInfo.selectors, selector);
-}
-
-exports.extension = pathInfo.extension;
-exports.hasSelector = hasSelector;
\ No newline at end of file
+module.exports = {
+    entry: "./lib/index.js",
+    output: {
+        filename: "../src/main/resources/internal/sling-babel.js",
+        library: "SlingBabel",
+        libraryTarget: "this"
+    },
+    module: {
+        loaders: [
+            {
+                test: /\.js$/,
+                exclude: /(node_modules|bower_components)/,
+                loader: "babel-loader",
+                query: {
+                    presets: ["es2015"]
+                }
+            }
+            
+        ]
+    }    
+}
\ No newline at end of file
diff --git a/src/main/resources/libs/esx/demo/components/page/helper/pathinfo/index.js b/gulpfile.js
similarity index 69%
copy from src/main/resources/libs/esx/demo/components/page/helper/pathinfo/index.js
copy to gulpfile.js
index fba66fa..2fc9001 100644
--- a/src/main/resources/libs/esx/demo/components/page/helper/pathinfo/index.js
+++ b/gulpfile.js
@@ -14,17 +14,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-var _ = require('underscore');
-var pathInfo = sling.request.requestPathInfo;
+var gulp = require("gulp");
+var gutil = require("gulp-util");
+var install = require("gulp-install");
+var webpack = require("webpack");
+var webpackConfig = require("./babel-plugin-sling-sandbox/webpack.config.js");
 
-/**
- *
- * @param {string} selector to be searched for
- * @return {boolean}
- */
-function hasSelector(selector) {
-    return _.contains(pathInfo.selectors, selector);
-}
 
-exports.extension = pathInfo.extension;
-exports.hasSelector = hasSelector;
\ No newline at end of file
+gulp.task('default', function() {
+      gulp.src(["babel-plugin-sling-sandbox/package.json","src/**/package.json"])
+        .pipe(install());
+});
\ No newline at end of file
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..c5bdafb
--- /dev/null
+++ b/package.json
@@ -0,0 +1,17 @@
+{
+  "name": "esx",
+  "version": "1.0.0",
+  "description": "<!-- /*  * Licensed to the Apache Software Foundation (ASF) under one or more  * contributor license agreements.  See the NOTICE file distributed with  * this work for additional information regarding copyright ownership.  * The ASF licenses this file to You under the Apache License, Version 2.0  * (the \"License\"); you may not use this file except in compliance with  * the License.  You may obtain a copy of the License at  *  *      http://www.apache.org/licenses/LICE [...]
+  "main": "gulpfile.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "author": "",
+  "license": "ISC",
+  "dependencies": {
+    "gulp": "^3.9.1",
+    "gulp-install": "^1.1.0",
+    "gulp-util": "^3.0.8",
+    "webpack": "^2.3.3"
+  }
+}
diff --git a/pom.xml b/pom.xml
index 566b389..1991e18 100644
--- a/pom.xml
+++ b/pom.xml
@@ -62,12 +62,44 @@
                 <groupId>org.apache.rat</groupId>
                 <artifactId>apache-rat-plugin</artifactId>
                 <configuration>
-                    <excludes>
-                        <exclude>src/main/resources/libs/esx/demo/node_modules/**</exclude>
+                    <excludes>                        
+                        <exclude>**/node_modules/**</exclude>
+                        <exclude>node</exclude>
                     </excludes>
                 </configuration>
             </plugin>
             <plugin>
+               <groupId>com.github.eirslett</groupId>
+               <artifactId>frontend-maven-plugin</artifactId>
+               <version>1.4</version>
+               <executions>
+                <execution>
+                        <id>install node and npm</id>
+                        <goals>
+                            <goal>install-node-and-npm</goal>
+                        </goals>
+                        <phase>generate-resources</phase>
+                 </execution>
+                <execution>
+                    <id>npm install</id>
+                    <goals>
+                        <goal>npm</goal>
+                    </goals>
+                </execution>                 
+                <execution>
+                    <id>gulp build</id>
+                    <goals>
+                        <goal>gulp</goal>
+                    </goals>
+                    <phase>generate-resources</phase>
+                </execution>                 
+                 </executions>
+                    <configuration>
+                        <nodeVersion>v7.8.0</nodeVersion>
+                    </configuration>               
+                
+             </plugin>            
+            <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-scr-plugin</artifactId>
                 <version>1.21.0</version>
@@ -163,12 +195,7 @@
             <version>2.1.8</version>
             <scope>provided</scope>
         </dependency>
-        <dependency>
-            <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.commons.json</artifactId>
-            <version>2.0.19-SNAPSHOT</version>
-            <scope>provided</scope>
-        </dependency>
+
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
diff --git a/src/main/java/org/apache/sling/scripting/esx/EsxScriptEngineFactory.java b/src/main/java/org/apache/sling/scripting/esx/EsxScriptEngineFactory.java
index e588d18..c63aada 100644
--- a/src/main/java/org/apache/sling/scripting/esx/EsxScriptEngineFactory.java
+++ b/src/main/java/org/apache/sling/scripting/esx/EsxScriptEngineFactory.java
@@ -29,6 +29,7 @@ import org.apache.felix.scr.annotations.Properties;
 import org.apache.felix.scr.annotations.Property;
 import org.apache.felix.scr.annotations.Reference;
 import org.apache.felix.scr.annotations.Service;
+import org.apache.sling.scripting.esx.services.ScriptSandboxService;
 import org.osgi.framework.Constants;
 import org.osgi.service.component.ComponentContext;
 
@@ -49,6 +50,9 @@ public class EsxScriptEngineFactory extends AbstractScriptEngineFactory {
     @Reference
     ScriptModuleCache moduleCache;
 
+    @Reference
+    ScriptSandboxService sandboxService;
+
     public EsxScriptEngineFactory() {
         setNames("esx", "ESX");
         setExtensions("esx", "ESX");
@@ -69,6 +73,9 @@ public class EsxScriptEngineFactory extends AbstractScriptEngineFactory {
         return new EsxScriptEngine(this);
     }
 
+    public ScriptSandboxService getSandboxService() {
+        return sandboxService;
+    }
     /**
      * 
      * @return 
diff --git a/src/main/java/org/apache/sling/scripting/esx/Module.java b/src/main/java/org/apache/sling/scripting/esx/Module.java
index d3aeb4a..11ddd02 100644
--- a/src/main/java/org/apache/sling/scripting/esx/Module.java
+++ b/src/main/java/org/apache/sling/scripting/esx/Module.java
@@ -23,9 +23,11 @@ import java.io.InputStreamReader;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.util.logging.Level;
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.nodetype.NodeType;
+import javax.script.Invocable;
 import javax.script.ScriptException;
 import javax.script.SimpleBindings;
 import jdk.nashorn.api.scripting.JSObject;
@@ -38,8 +40,6 @@ import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.resource.ResourceUtil;
 import org.apache.sling.api.resource.ValueMap;
 import org.apache.sling.api.scripting.SlingScriptHelper;
-import org.apache.sling.commons.json.JSONException;
-import org.apache.sling.commons.json.JSONObject;
 import org.apache.sling.scripting.esx.plugins.ConsoleLog;
 import org.apache.sling.scripting.esx.plugins.SimpleResource;
 import org.slf4j.Logger;
@@ -106,25 +106,36 @@ public class Module extends SimpleBindings implements Require {
         put(CONTEXT_FIELD_CONSOLE, new ConsoleLog((String) get(CONTEXT_FIELD_FILENAME)));
     }
 
+    private ScriptObjectMirror decorateScript(String source)
+            throws ScriptException {
+        return decorateScript(source, true);
+    }
+
     /**
      *
      * @param source
      * @return
      * @throws ScriptException
      */
-    private ScriptObjectMirror decoreateScript(String source)
+    private ScriptObjectMirror decorateScript(String source, boolean es6)
             throws ScriptException {
-
-        String polyfill = "";
-
-        if ("polyfill".equals(get(CONTEXT_FIELD_ID))) {
-            //polyfill = "require('/libs/esx/esx_modules/polyfills/index.js')(this).bind(this)";
+        String filename = (String) get("filename");
+        if (filename.indexOf("node_modules") == -1 && es6) {
+            try {
+                source = factory.getSandboxService().compileSource(source);
+            } catch (ScriptException e) {
+                log.error("Could not transpile script", e);
+                throw new ScriptException("could not load " + get("filename"));
+            }
         }
+
+        // TODO: refactor polyfill for window, global and make require outside the wrapper as function parameter        
         source = "//@sourceURL=" + (String) get("filename") + "\n"
-                + "(function (exports, require, module, __filename,"
+                + "(function (exports, Require, module, __filename,"
                 + " __dirname, currentNode, console, properties, sling, simpleResource) { "
-                + "var window = this;"
-                + "var global = this;"
+                + "var window = (this.window == 'undefined' || this.window == null) ? this : this.window;"
+                + "var global = (global == 'undefined') ? this : global;"
+                + "function require(id) {  return Require.require(id); } require.resolve = function (id) { return Require.resolve(id, currentNode.resource, 1);  };"
                 + source
                 + "})";
 
@@ -162,7 +173,7 @@ public class Module extends SimpleBindings implements Require {
 
         if (function == null) {
             if (moduleScript.isJsFile()) {
-                function = decoreateScript(
+                function = Module.this.decorateScript(
                         //readScript(moduleResource)//  
                         readScript(moduleResource)
                 );
@@ -170,9 +181,9 @@ public class Module extends SimpleBindings implements Require {
 
             if (moduleScript.isJsonFile()) {
                 String jsonfile = readScript(moduleResource);
-                function = decoreateScript(
+                function = decorateScript(
                         "module.exports = " + jsonfile
-                );
+                , false);
             }
 
             if (moduleScript.isResourceFile()) {
@@ -182,21 +193,25 @@ public class Module extends SimpleBindings implements Require {
 
                 put("children", children);
 
-                ValueMap map = moduleResource.adaptTo(ValueMap.class);
-
-                JSONObject values = new JSONObject(map);
-
-                String jsonprop = values.toString();
+                /*ValueMap map = moduleResource.adaptTo(ValueMap.class);
 
+                 Invocable invocable = (Invocable) factory.getNashornEngine();
+                 Object jsonprop = null;
+                 try {
+                 jsonprop = invocable.invokeMethod(factory.getNashornEngine().eval("JSON"), "stringify", map);
+                 } catch (NoSuchMethodException ex) {
+                 throw new ScriptException(ex);
+                 }
+                 */
                 SimpleResource simpleResource = moduleResource.adaptTo(SimpleResource.class);
                 put("simpleResource", simpleResource);
+                /*   String source = "exports.properties =  " + jsonprop + ";"
+                 + "exports.path = currentNode.resource.path;"
+                 + "exports.simpleResource = this.simpleResource;"
+                 + "exports.children = this.children;";*/
+                String source = "module.exports = this.simpleResource;";
 
-                String source = "exports.properties =  " + jsonprop + ";"
-                        + "exports.path = currentNode.resource.path;"
-                        + "exports.simpleResource = this.simpleResource;"
-                        + "exports.children = this.children;";
-
-                function = decoreateScript(source);
+                function = decorateScript(source, false);
             }
             if (!moduleScript.isResourceFile()) {
                 factory.getModuleCache().put(moduleScript.getResource().getPath(), function);
@@ -211,7 +226,7 @@ public class Module extends SimpleBindings implements Require {
             log.debug("sourcE: ");
             source = "module.exports = \"" + source + "\";";
             log.debug(source);
-            function = decoreateScript(source);
+            function = Module.this.decorateScript(source);
             factory.getModuleCache().put(moduleScript.getResource().getPath(), function);
         }
         JSObject process = (JSObject) factory.getNashornEngine().eval("Object");
@@ -226,7 +241,9 @@ public class Module extends SimpleBindings implements Require {
                 log.debug("module id {} resource is null", get(CONTEXT_FIELD_ID));
             }
 
-            function.call(this, get(CONTEXT_FIELD_EXPORTS), (Require) this::require, this, get(CONTEXT_FIELD_FILENAME),
+            // changed require to be generated within the wrapper
+            // TODO: need to be refactored
+            function.call(this, get(CONTEXT_FIELD_EXPORTS), this, this, get(CONTEXT_FIELD_FILENAME),
                     ((Resource) get(CONTEXT_FIELD_MODULE_RESOURCE)).getParent().getPath(), currentNode,
                     (ConsoleLog) get(CONTEXT_FIELD_CONSOLE),
                     null,
@@ -418,24 +435,20 @@ public class Module extends SimpleBindings implements Require {
                     try {
                         String jsonData = IOUtils.toString(is);
 
-                        JSONObject json;
+                        Invocable invocable = (Invocable) factory.getNashornEngine();
+                        JSObject jsonprop = null;
                         try {
-                            json = new JSONObject(jsonData);
-                        } catch (JSONException ex) {
+                            jsonprop = (JSObject) invocable.invokeMethod(factory.getNashornEngine().eval("JSON"), "parse", jsonData);
+                        } catch (NoSuchMethodException ex) {
                             throw new ScriptException(ex);
                         }
 
-                        if (json.has("main")) {
-                            String packageModule;
-                            try {
-                                packageModule = json.getString("main");
-                            } catch (JSONException ex) {
-                                throw new ScriptException(ex);
-                            }
+                        Object main = jsonprop.getMember("main");
+                        if (main != null) {
+                            String packageModule = (String) main;
 
                             String mainpath = normalizePath(packageModule,
                                     path);
-
                             return loadAsFile(packageModule, mainpath, currentResource, loader);
                         }
 
diff --git a/src/main/resources/libs/esx/demo/components/page/helper/pathinfo/index.js b/src/main/java/org/apache/sling/scripting/esx/services/ScriptSandboxService.java
similarity index 72%
copy from src/main/resources/libs/esx/demo/components/page/helper/pathinfo/index.js
copy to src/main/java/org/apache/sling/scripting/esx/services/ScriptSandboxService.java
index fba66fa..e76ad78 100644
--- a/src/main/resources/libs/esx/demo/components/page/helper/pathinfo/index.js
+++ b/src/main/java/org/apache/sling/scripting/esx/services/ScriptSandboxService.java
@@ -14,17 +14,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-var _ = require('underscore');
-var pathInfo = sling.request.requestPathInfo;
+package org.apache.sling.scripting.esx.services;
+
+import javax.script.ScriptException;
 
 /**
  *
- * @param {string} selector to be searched for
- * @return {boolean}
+ * @author senol
  */
-function hasSelector(selector) {
-    return _.contains(pathInfo.selectors, selector);
+public interface ScriptSandboxService {
+    public String compileSource(String source) throws ScriptException;
 }
-
-exports.extension = pathInfo.extension;
-exports.hasSelector = hasSelector;
\ No newline at end of file
diff --git a/src/main/java/org/apache/sling/scripting/esx/services/impl/ScriptSandboxServiceImpl.java b/src/main/java/org/apache/sling/scripting/esx/services/impl/ScriptSandboxServiceImpl.java
new file mode 100644
index 0000000..d9ea47b
--- /dev/null
+++ b/src/main/java/org/apache/sling/scripting/esx/services/impl/ScriptSandboxServiceImpl.java
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.scripting.esx.services.impl;
+
+import java.io.IOException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.script.Invocable;
+import javax.script.ScriptEngine;
+import javax.script.ScriptException;
+import jdk.nashorn.api.scripting.JSObject;
+import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.sling.api.SlingConstants;
+import org.apache.sling.scripting.esx.ScriptModuleCache;
+import org.apache.sling.scripting.esx.services.ScriptSandboxService;
+import org.osgi.service.component.ComponentContext;
+import org.osgi.service.event.EventHandler;
+import org.slf4j.LoggerFactory;
+
+@Component
+@Service(value = {ScriptSandboxService.class})
+@Property(name = org.osgi.service.event.EventConstants.EVENT_TOPIC,
+        value = {SlingConstants.TOPIC_RESOURCE_CHANGED, SlingConstants.TOPIC_RESOURCE_REMOVED})
+public class ScriptSandboxServiceImpl implements ScriptSandboxService {
+
+    private final org.slf4j.Logger log = LoggerFactory.getLogger(getClass());
+    private final String SLING_BABEL_SOURCE_CODE = "/resources/internal/sling-babel.js";
+
+    private String slingBabelSource = null;
+    private ScriptEngine scriptEngine;
+    private Object babelOptions = null;
+    private Object babel = null;
+
+    @Override
+    public String compileSource(String source) throws ScriptException {      
+        Invocable inv = (Invocable) scriptEngine;
+        JSObject rs;
+        try {       
+            rs = (JSObject) inv.invokeMethod(babel, "transform", source, babelOptions);
+            return rs.getMember("code").toString(); 
+        } catch (ScriptException ex) {
+            throw new ScriptException(ex);
+        } catch (NoSuchMethodException ex) {
+            throw new ScriptException(ex);
+        }
+    }
+
+    /**
+     *
+     * @param context
+     */
+    @Activate
+    protected void activate(ComponentContext context) {
+        try {
+            this.slingBabelSource = "//@sourceURL=" + getClass().getCanonicalName() + "\n load( { name : \"" + getClass().getCanonicalName() + "\", script: \""
+                    + StringEscapeUtils.escapeEcmaScript(new String(IOUtils.toByteArray(
+                                            context.getBundleContext().getBundle()
+                                            .getEntry(this.SLING_BABEL_SOURCE_CODE).openStream())))
+                    + "\"} )";
+        } catch (Exception ex) {
+           log.error("failed to load babel source", ex);
+        }
+        
+        String options = "var config = { "
+                + "    presets: [\"es2015\"], "
+                + "    compact: 'true',"
+                + "    plugins: [[\"transform-react-jsx\", { pragma : \"SlingEsx.createElement\"}]] "
+                //+ // disabled sandbox plugin for 
+                //"    \"plugins\": [\"SlingSandbox, [\"transform-react-jsx\", { \"pragma\" : \"SlingEsx.createElement\"}]] \n" +        
+                + "    }"; 
+        NashornScriptEngineFactory factory = new NashornScriptEngineFactory();
+        this.scriptEngine = factory.getScriptEngine();
+        try {
+            log.info("trying to load babel into the system");
+            this.scriptEngine.eval(options);
+            this.babelOptions = this.scriptEngine.get("config");
+            scriptEngine.eval(slingBabelSource);
+            this.babel = this.scriptEngine.get("SlingBabel");
+            log.info("Babel loaded");
+        } catch (ScriptException ex) {
+            log.error("coudlnt load babel options", ex);
+        }
+    }
+}
diff --git a/src/main/resources/internal/sling-babel.js b/src/main/resources/internal/sling-babel.js
new file mode 100644
index 0000000..1cdc032
--- /dev/null
+++ b/src/main/resources/internal/sling-babel.js
@@ -0,0 +1,92949 @@
+this["SlingBabel"] =
+/******/ (function(modules) { // webpackBootstrap
+/******/ 	// The module cache
+/******/ 	var installedModules = {};
+/******/
+/******/ 	// The require function
+/******/ 	function __webpack_require__(moduleId) {
+/******/
+/******/ 		// Check if module is in cache
+/******/ 		if(installedModules[moduleId])
+/******/ 			return installedModules[moduleId].exports;
+/******/
+/******/ 		// Create a new module (and put it into the cache)
+/******/ 		var module = installedModules[moduleId] = {
+/******/ 			i: moduleId,
+/******/ 			l: false,
+/******/ 			exports: {}
+/******/ 		};
+/******/
+/******/ 		// Execute the module function
+/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+/******/
+/******/ 		// Flag the module as loaded
+/******/ 		module.l = true;
+/******/
+/******/ 		// Return the exports of the module
+/******/ 		return module.exports;
+/******/ 	}
+/******/
+/******/
+/******/ 	// expose the modules object (__webpack_modules__)
+/******/ 	__webpack_require__.m = modules;
+/******/
+/******/ 	// expose the module cache
+/******/ 	__webpack_require__.c = installedModules;
+/******/
+/******/ 	// identity function for calling harmony imports with the correct context
+/******/ 	__webpack_require__.i = function(value) { return value; };
+/******/
+/******/ 	// define getter function for harmony exports
+/******/ 	__webpack_require__.d = function(exports, name, getter) {
+/******/ 		if(!__webpack_require__.o(exports, name)) {
+/******/ 			Object.defineProperty(exports, name, {
+/******/ 				configurable: false,
+/******/ 				enumerable: true,
+/******/ 				get: getter
+/******/ 			});
+/******/ 		}
+/******/ 	};
+/******/
+/******/ 	// getDefaultExport function for compatibility with non-harmony modules
+/******/ 	__webpack_require__.n = function(module) {
+/******/ 		var getter = module && module.__esModule ?
+/******/ 			function getDefault() { return module['default']; } :
+/******/ 			function getModuleExports() { return module; };
+/******/ 		__webpack_require__.d(getter, 'a', getter);
+/******/ 		return getter;
+/******/ 	};
+/******/
+/******/ 	// Object.prototype.hasOwnProperty.call
+/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
+/******/
+/******/ 	// __webpack_public_path__
+/******/ 	__webpack_require__.p = "";
+/******/
+/******/ 	// Load entry module and return exports
+/******/ 	return __webpack_require__(__webpack_require__.s = 145);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.__esModule = true;
+exports.createTypeAnnotationBasedOnTypeof = exports.removeTypeDuplicates = exports.createUnionTypeAnnotation = exports.valueToNode = exports.toBlock = exports.toExpression = exports.toStatement = exports.toBindingIdentifierName = exports.toIdentifier = exports.toKeyAlias = exports.toSequenceExpression = exports.toComputedKey = exports.isNodesEquivalent = exports.isImmutable = exports.isScope = exports.isSpecifierDefault = exports.isVar = exports.isBlockScoped = exports.isLet = exports.is [...]
+
+var _getOwnPropertySymbols = __webpack_require__(148);
+
+var _getOwnPropertySymbols2 = _interopRequireDefault(_getOwnPropertySymbols);
+
+var _getIterator2 = __webpack_require__(1);
+
+var _getIterator3 = _interopRequireDefault(_getIterator2);
+
+var _keys = __webpack_require__(33);
+
+var _keys2 = _interopRequireDefault(_keys);
+
+var _stringify = __webpack_require__(32);
+
+var _stringify2 = _interopRequireDefault(_stringify);
+
+var _constants = __webpack_require__(58);
+
+Object.defineProperty(exports, "STATEMENT_OR_BLOCK_KEYS", {
+  enumerable: true,
+  get: function get() {
+    return _constants.STATEMENT_OR_BLOCK_KEYS;
+  }
+});
+Object.defineProperty(exports, "FLATTENABLE_KEYS", {
+  enumerable: true,
+  get: function get() {
+    return _constants.FLATTENABLE_KEYS;
+  }
+});
+Object.defineProperty(exports, "FOR_INIT_KEYS", {
+  enumerable: true,
+  get: function get() {
+    return _constants.FOR_INIT_KEYS;
+  }
+});
+Object.defineProperty(exports, "COMMENT_KEYS", {
+  enumerable: true,
+  get: function get() {
+    return _constants.COMMENT_KEYS;
+  }
+});
+Object.defineProperty(exports, "LOGICAL_OPERATORS", {
+  enumerable: true,
+  get: function get() {
+    return _constants.LOGICAL_OPERATORS;
+  }
+});
+Object.defineProperty(exports, "UPDATE_OPERATORS", {
+  enumerable: true,
+  get: function get() {
+    return _constants.UPDATE_OPERATORS;
+  }
+});
+Object.defineProperty(exports, "BOOLEAN_NUMBER_BINARY_OPERATORS", {
+  enumerable: true,
+  get: function get() {
+    return _constants.BOOLEAN_NUMBER_BINARY_OPERATORS;
+  }
+});
+Object.defineProperty(exports, "EQUALITY_BINARY_OPERATORS", {
+  enumerable: true,
+  get: function get() {
+    return _constants.EQUALITY_BINARY_OPERATORS;
+  }
+});
+Object.defineProperty(exports, "COMPARISON_BINARY_OPERATORS", {
+  enumerable: true,
+  get: function get() {
+    return _constants.COMPARISON_BINARY_OPERATORS;
+  }
+});
+Object.defineProperty(exports, "BOOLEAN_BINARY_OPERATORS", {
+  enumerable: true,
+  get: function get() {
+    return _constants.BOOLEAN_BINARY_OPERATORS;
+  }
+});
+Object.defineProperty(exports, "NUMBER_BINARY_OPERATORS", {
+  enumerable: true,
+  get: function get() {
+    return _constants.NUMBER_BINARY_OPERATORS;
+  }
+});
+Object.defineProperty(exports, "BINARY_OPERATORS", {
+  enumerable: true,
+  get: function get() {
+    return _constants.BINARY_OPERATORS;
+  }
+});
+Object.defineProperty(exports, "BOOLEAN_UNARY_OPERATORS", {
+  enumerable: true,
+  get: function get() {
+    return _constants.BOOLEAN_UNARY_OPERATORS;
+  }
+});
+Object.defineProperty(exports, "NUMBER_UNARY_OPERATORS", {
+  enumerable: true,
+  get: function get() {
+    return _constants.NUMBER_UNARY_OPERATORS;
+  }
+});
+Object.defineProperty(exports, "STRING_UNARY_OPERATORS", {
+  enumerable: true,
+  get: function get() {
+    return _constants.STRING_UNARY_OPERATORS;
+  }
+});
+Object.defineProperty(exports, "UNARY_OPERATORS", {
+  enumerable: true,
+  get: function get() {
+    return _constants.UNARY_OPERATORS;
+  }
+});
+Object.defineProperty(exports, "INHERIT_KEYS", {
+  enumerable: true,
+  get: function get() {
+    return _constants.INHERIT_KEYS;
+  }
+});
+Object.defineProperty(exports, "BLOCK_SCOPED_SYMBOL", {
+  enumerable: true,
+  get: function get() {
+    return _constants.BLOCK_SCOPED_SYMBOL;
+  }
+});
+Object.defineProperty(exports, "NOT_LOCAL_BINDING", {
+  enumerable: true,
+  get: function get() {
+    return _constants.NOT_LOCAL_BINDING;
+  }
+});
+exports.is = is;
+exports.isType = isType;
+exports.validate = validate;
+exports.shallowEqual = shallowEqual;
+exports.appendToMemberExpression = appendToMemberExpression;
+exports.prependToMemberExpression = prependToMemberExpression;
+exports.ensureBlock = ensureBlock;
+exports.clone = clone;
+exports.cloneWithoutLoc = cloneWithoutLoc;
+exports.cloneDeep = cloneDeep;
+exports.buildMatchMemberExpression = buildMatchMemberExpression;
+exports.removeComments = removeComments;
+exports.inheritsComments = inheritsComments;
+exports.inheritTrailingComments = inheritTrailingComments;
+exports.inheritLeadingComments = inheritLeadingComments;
+exports.inheritInnerComments = inheritInnerComments;
+exports.inherits = inherits;
+exports.assertNode = assertNode;
+exports.isNode = isNode;
+exports.traverseFast = traverseFast;
+exports.removeProperties = removeProperties;
+exports.removePropertiesDeep = removePropertiesDeep;
+
+var _retrievers = __webpack_require__(97);
+
+Object.defineProperty(exports, "getBindingIdentifiers", {
+  enumerable: true,
+  get: function get() {
+    return _retrievers.getBindingIdentifiers;
+  }
+});
+Object.defineProperty(exports, "getOuterBindingIdentifiers", {
+  enumerable: true,
+  get: function get() {
+    return _retrievers.getOuterBindingIdentifiers;
+  }
+});
+
+var _validators = __webpack_require__(180);
+
+Object.defineProperty(exports, "isBinding", {
+  enumerable: true,
+  get: function get() {
+    return _validators.isBinding;
+  }
+});
+Object.defineProperty(exports, "isReferenced", {
+  enumerable: true,
+  get: function get() {
+    return _validators.isReferenced;
+  }
+});
+Object.defineProperty(exports, "isValidIdentifier", {
+  enumerable: true,
+  get: function get() {
+    return _validators.isValidIdentifier;
+  }
+});
+Object.defineProperty(exports, "isLet", {
+  enumerable: true,
+  get: function get() {
+    return _validators.isLet;
+  }
+});
+Object.defineProperty(exports, "isBlockScoped", {
+  enumerable: true,
+  get: function get() {
+    return _validators.isBlockScoped;
+  }
+});
+Object.defineProperty(exports, "isVar", {
+  enumerable: true,
+  get: function get() {
+    return _validators.isVar;
+  }
+});
+Object.defineProperty(exports, "isSpecifierDefault", {
+  enumerable: true,
+  get: function get() {
+    return _validators.isSpecifierDefault;
+  }
+});
+Object.defineProperty(exports, "isScope", {
+  enumerable: true,
+  get: function get() {
+    return _validators.isScope;
+  }
+});
+Object.defineProperty(exports, "isImmutable", {
+  enumerable: true,
+  get: function get() {
+    return _validators.isImmutable;
+  }
+});
+Object.defineProperty(exports, "isNodesEquivalent", {
+  enumerable: true,
+  get: function get() {
+    return _validators.isNodesEquivalent;
+  }
+});
+
+var _converters = __webpack_require__(170);
+
+Object.defineProperty(exports, "toComputedKey", {
+  enumerable: true,
+  get: function get() {
+    return _converters.toComputedKey;
+  }
+});
+Object.defineProperty(exports, "toSequenceExpression", {
+  enumerable: true,
+  get: function get() {
+    return _converters.toSequenceExpression;
+  }
+});
+Object.defineProperty(exports, "toKeyAlias", {
+  enumerable: true,
+  get: function get() {
+    return _converters.toKeyAlias;
+  }
+});
+Object.defineProperty(exports, "toIdentifier", {
+  enumerable: true,
+  get: function get() {
+    return _converters.toIdentifier;
+  }
+});
+Object.defineProperty(exports, "toBindingIdentifierName", {
+  enumerable: true,
+  get: function get() {
+    return _converters.toBindingIdentifierName;
+  }
+});
+Object.defineProperty(exports, "toStatement", {
+  enumerable: true,
+  get: function get() {
+    return _converters.toStatement;
+  }
+});
+Object.defineProperty(exports, "toExpression", {
+  enumerable: true,
+  get: function get() {
+    return _converters.toExpression;
+  }
+});
+Object.defineProperty(exports, "toBlock", {
+  enumerable: true,
+  get: function get() {
+    return _converters.toBlock;
+  }
+});
+Object.defineProperty(exports, "valueToNode", {
+  enumerable: true,
+  get: function get() {
+    return _converters.valueToNode;
+  }
+});
+
+var _flow = __webpack_require__(178);
+
+Object.defineProperty(exports, "createUnionTypeAnnotation", {
+  enumerable: true,
+  get: function get() {
+    return _flow.createUnionTypeAnnotation;
+  }
+});
+Object.defineProperty(exports, "removeTypeDuplicates", {
+  enumerable: true,
+  get: function get() {
+    return _flow.removeTypeDuplicates;
+  }
+});
+Object.defineProperty(exports, "createTypeAnnotationBasedOnTypeof", {
+  enumerable: true,
+  get: function get() {
+    return _flow.createTypeAnnotationBasedOnTypeof;
+  }
+});
+
+var _toFastProperties = __webpack_require__(352);
+
+var _toFastProperties2 = _interopRequireDefault(_toFastProperties);
+
+var _clone = __webpack_require__(130);
+
+var _clone2 = _interopRequireDefault(_clone);
+
+var _uniq = __webpack_require__(347);
+
+var _uniq2 = _interopRequireDefault(_uniq);
+
+__webpack_require__(175);
+
+var _definitions = __webpack_require__(8);
+
+var _react2 = __webpack_require__(179);
+
+var _react = _interopRequireWildcard(_react2);
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var t = exports;
+
+function registerType(type) {
+  var is = t["is" + type];
+  if (!is) {
+    is = t["is" + type] = function (node, opts) {
+      return t.is(type, node, opts);
+    };
+  }
+
+  t["assert" + type] = function (node, opts) {
+    opts = opts || {};
+    if (!is(node, opts)) {
+      throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts));
+    }
+  };
+}
+
+exports.VISITOR_KEYS = _definitions.VISITOR_KEYS;
+exports.ALIAS_KEYS = _definitions.ALIAS_KEYS;
+exports.NODE_FIELDS = _definitions.NODE_FIELDS;
+exports.BUILDER_KEYS = _definitions.BUILDER_KEYS;
+exports.DEPRECATED_KEYS = _definitions.DEPRECATED_KEYS;
+exports.react = _react;
+
+
+for (var type in t.VISITOR_KEYS) {
+  registerType(type);
+}
+
+t.FLIPPED_ALIAS_KEYS = {};
+
+(0, _keys2.default)(t.ALIAS_KEYS).forEach(function (type) {
+  t.ALIAS_KEYS[type].forEach(function (alias) {
+    var types = t.FLIPPED_ALIAS_KEYS[alias] = t.FLIPPED_ALIAS_KEYS[alias] || [];
+    types.push(type);
+  });
+});
+
+(0, _keys2.default)(t.FLIPPED_ALIAS_KEYS).forEach(function (type) {
+  t[type.toUpperCase() + "_TYPES"] = t.FLIPPED_ALIAS_KEYS[type];
+  registerType(type);
+});
+
+var TYPES = exports.TYPES = (0, _keys2.default)(t.VISITOR_KEYS).concat((0, _keys2.default)(t.FLIPPED_ALIAS_KEYS)).concat((0, _keys2.default)(t.DEPRECATED_KEYS));
+
+function is(type, node, opts) {
+  if (!node) return false;
+
+  var matches = isType(node.type, type);
+  if (!matches) return false;
+
+  if (typeof opts === "undefined") {
+    return true;
+  } else {
+    return t.shallowEqual(node, opts);
+  }
+}
+
+function isType(nodeType, targetType) {
+  if (nodeType === targetType) return true;
+
+  if (t.ALIAS_KEYS[targetType]) return false;
+
+  var aliases = t.FLIPPED_ALIAS_KEYS[targetType];
+  if (aliases) {
+    if (aliases[0] === nodeType) return true;
+
+    for (var _iterator = aliases, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
+      var _ref;
+
+      if (_isArray) {
+        if (_i >= _iterator.length) break;
+        _ref = _iterator[_i++];
+      } else {
+        _i = _iterator.next();
+        if (_i.done) break;
+        _ref = _i.value;
+      }
+
+      var alias = _ref;
+
+      if (nodeType === alias) return true;
+    }
+  }
+
+  return false;
+}
+
+(0, _keys2.default)(t.BUILDER_KEYS).forEach(function (type) {
+  var keys = t.BUILDER_KEYS[type];
+
+  function builder() {
+    if (arguments.length > keys.length) {
+      throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length));
+    }
+
+    var node = {};
+    node.type = type;
+
+    var i = 0;
+
+    for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
+      var _ref2;
+
+      if (_isArray2) {
+        if (_i2 >= _iterator2.length) break;
+        _ref2 = _iterator2[_i2++];
+      } else {
+        _i2 = _iterator2.next();
+        if (_i2.done) break;
+        _ref2 = _i2.value;
+      }
+
+      var _key = _ref2;
+
+      var field = t.NODE_FIELDS[type][_key];
+
+      var arg = arguments[i++];
+      if (arg === undefined) arg = (0, _clone2.default)(field.default);
+
+      node[_key] = arg;
+    }
+
+    for (var key in node) {
+      validate(node, key, node[key]);
+    }
+
+    return node;
+  }
+
+  t[type] = builder;
+  t[type[0].toLowerCase() + type.slice(1)] = builder;
+});
+
+var _loop = function _loop(_type) {
+  var newType = t.DEPRECATED_KEYS[_type];
+
+  function proxy(fn) {
+    return function () {
+      console.trace("The node type " + _type + " has been renamed to " + newType);
+      return fn.apply(this, arguments);
+    };
+  }
+
+  t[_type] = t[_type[0].toLowerCase() + _type.slice(1)] = proxy(t[newType]);
+  t["is" + _type] = proxy(t["is" + newType]);
+  t["assert" + _type] = proxy(t["assert" + newType]);
+};
+
+for (var _type in t.DEPRECATED_KEYS) {
+  _loop(_type);
+}
+
+function validate(node, key, val) {
+  if (!node) return;
+
+  var fields = t.NODE_FIELDS[node.type];
+  if (!fields) return;
+
+  var field = fields[key];
+  if (!field || !field.validate) return;
+  if (field.optional && val == null) return;
+
+  field.validate(node, key, val);
+}
+
+function shallowEqual(actual, expected) {
+  var keys = (0, _keys2.default)(expected);
+
+  for (var _iterator3 = keys, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
+    var _ref3;
+
+    if (_isArray3) {
+      if (_i3 >= _iterator3.length) break;
+      _ref3 = _iterator3[_i3++];
+    } else {
+      _i3 = _iterator3.next();
+      if (_i3.done) break;
+      _ref3 = _i3.value;
+    }
+
+    var key = _ref3;
+
+    if (actual[key] !== expected[key]) {
+      return false;
+    }
+  }
+
+  return true;
+}
+
+function appendToMemberExpression(member, append, computed) {
+  member.object = t.memberExpression(member.object, member.property, member.computed);
+  member.property = append;
+  member.computed = !!computed;
+  return member;
+}
+
+function prependToMemberExpression(member, prepend) {
+  member.object = t.memberExpression(prepend, member.object);
+  return member;
+}
+
+function ensureBlock(node) {
+  var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "body";
+
+  return node[key] = t.toBlock(node[key], node);
+}
+
+function clone(node) {
+  if (!node) return node;
+  var newNode = {};
+  for (var key in node) {
+    if (key[0] === "_") continue;
+    newNode[key] = node[key];
+  }
+  return newNode;
+}
+
+function cloneWithoutLoc(node) {
+  var newNode = clone(node);
+  delete newNode.loc;
+  return newNode;
+}
+
+function cloneDeep(node) {
+  if (!node) return node;
+  var newNode = {};
+
+  for (var key in node) {
+    if (key[0] === "_") continue;
+
+    var val = node[key];
+
+    if (val) {
+      if (val.type) {
+        val = t.cloneDeep(val);
+      } else if (Array.isArray(val)) {
+        val = val.map(t.cloneDeep);
+      }
+    }
+
+    newNode[key] = val;
+  }
+
+  return newNode;
+}
+
+function buildMatchMemberExpression(match, allowPartial) {
+  var parts = match.split(".");
+
+  return function (member) {
+    if (!t.isMemberExpression(member)) return false;
+
+    var search = [member];
+    var i = 0;
+
+    while (search.length) {
+      var node = search.shift();
+
+      if (allowPartial && i === parts.length) {
+        return true;
+      }
+
+      if (t.isIdentifier(node)) {
+        if (parts[i] !== node.name) return false;
+      } else if (t.isStringLiteral(node)) {
+        if (parts[i] !== node.value) return false;
+      } else if (t.isMemberExpression(node)) {
+        if (node.computed && !t.isStringLiteral(node.property)) {
+          return false;
+        } else {
+          search.push(node.object);
+          search.push(node.property);
+          continue;
+        }
+      } else {
+        return false;
+      }
+
+      if (++i > parts.length) {
+        return false;
+      }
+    }
+
+    return true;
+  };
+}
+
+function removeComments(node) {
+  for (var _iterator4 = t.COMMENT_KEYS, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) {
+    var _ref4;
+
+    if (_isArray4) {
+      if (_i4 >= _iterator4.length) break;
+      _ref4 = _iterator4[_i4++];
+    } else {
+      _i4 = _iterator4.next();
+      if (_i4.done) break;
+      _ref4 = _i4.value;
+    }
+
+    var key = _ref4;
+
+    delete node[key];
+  }
+  return node;
+}
+
+function inheritsComments(child, parent) {
+  inheritTrailingComments(child, parent);
+  inheritLeadingComments(child, parent);
+  inheritInnerComments(child, parent);
+  return child;
+}
+
+function inheritTrailingComments(child, parent) {
+  _inheritComments("trailingComments", child, parent);
+}
+
+function inheritLeadingComments(child, parent) {
+  _inheritComments("leadingComments", child, parent);
+}
+
+function inheritInnerComments(child, parent) {
+  _inheritComments("innerComments", child, parent);
+}
+
+function _inheritComments(key, child, parent) {
+  if (child && parent) {
+    child[key] = (0, _uniq2.default)([].concat(child[key], parent[key]).filter(Boolean));
+  }
+}
+
+function inherits(child, parent) {
+  if (!child || !parent) return child;
+
+  for (var _iterator5 = t.INHERIT_KEYS.optional, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) {
+    var _ref5;
+
+    if (_isArray5) {
+      if (_i5 >= _iterator5.length) break;
+      _ref5 = _iterator5[_i5++];
+    } else {
+      _i5 = _iterator5.next();
+      if (_i5.done) break;
+      _ref5 = _i5.value;
+    }
+
+    var _key2 = _ref5;
+
+    if (child[_key2] == null) {
+      child[_key2] = parent[_key2];
+    }
+  }
+
+  for (var key in parent) {
+    if (key[0] === "_") child[key] = parent[key];
+  }
+
+  for (var _iterator6 = t.INHERIT_KEYS.force, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, _getIterator3.default)(_iterator6);;) {
+    var _ref6;
+
+    if (_isArray6) {
+      if (_i6 >= _iterator6.length) break;
+      _ref6 = _iterator6[_i6++];
+    } else {
+      _i6 = _iterator6.next();
+      if (_i6.done) break;
+      _ref6 = _i6.value;
+    }
+
+    var _key3 = _ref6;
+
+    child[_key3] = parent[_key3];
+  }
+
+  t.inheritsComments(child, parent);
+
+  return child;
+}
+
+function assertNode(node) {
+  if (!isNode(node)) {
+    throw new TypeError("Not a valid node " + (node && node.type));
+  }
+}
+
+function isNode(node) {
+  return !!(node && _definitions.VISITOR_KEYS[node.type]);
+}
+
+(0, _toFastProperties2.default)(t);
+(0, _toFastProperties2.default)(t.VISITOR_KEYS);
+
+function traverseFast(node, enter, opts) {
+  if (!node) return;
+
+  var keys = t.VISITOR_KEYS[node.type];
+  if (!keys) return;
+
+  opts = opts || {};
+  enter(node, opts);
+
+  for (var _iterator7 = keys, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, _getIterator3.default)(_iterator7);;) {
+    var _ref7;
+
+    if (_isArray7) {
+      if (_i7 >= _iterator7.length) break;
+      _ref7 = _iterator7[_i7++];
+    } else {
+      _i7 = _iterator7.next();
+      if (_i7.done) break;
+      _ref7 = _i7.value;
+    }
+
+    var key = _ref7;
+
+    var subNode = node[key];
+
+    if (Array.isArray(subNode)) {
+      for (var _iterator8 = subNode, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, _getIterator3.default)(_iterator8);;) {
+        var _ref8;
+
+        if (_isArray8) {
+          if (_i8 >= _iterator8.length) break;
+          _ref8 = _iterator8[_i8++];
+        } else {
+          _i8 = _iterator8.next();
+          if (_i8.done) break;
+          _ref8 = _i8.value;
+        }
+
+        var _node = _ref8;
+
+        traverseFast(_node, enter, opts);
+      }
+    } else {
+      traverseFast(subNode, enter, opts);
+    }
+  }
+}
+
+var CLEAR_KEYS = ["tokens", "start", "end", "loc", "raw", "rawValue"];
+
+var CLEAR_KEYS_PLUS_COMMENTS = t.COMMENT_KEYS.concat(["comments"]).concat(CLEAR_KEYS);
+
+function removeProperties(node, opts) {
+  opts = opts || {};
+  var map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS;
+  for (var _iterator9 = map, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, _getIterator3.default)(_iterator9);;) {
+    var _ref9;
+
+    if (_isArray9) {
+      if (_i9 >= _iterator9.length) break;
+      _ref9 = _iterator9[_i9++];
+    } else {
+      _i9 = _iterator9.next();
+      if (_i9.done) break;
+      _ref9 = _i9.value;
+    }
+
+    var _key4 = _ref9;
+
+    if (node[_key4] != null) node[_key4] = undefined;
+  }
+
+  for (var key in node) {
+    if (key[0] === "_" && node[key] != null) node[key] = undefined;
+  }
+
+  var syms = (0, _getOwnPropertySymbols2.default)(node);
+  for (var _iterator10 = syms, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, _getIterator3.default)(_iterator10);;) {
+    var _ref10;
+
+    if (_isArray10) {
+      if (_i10 >= _iterator10.length) break;
+      _ref10 = _iterator10[_i10++];
+    } else {
+      _i10 = _iterator10.next();
+      if (_i10.done) break;
+      _ref10 = _i10.value;
+    }
+
+    var sym = _ref10;
+
+    node[sym] = null;
+  }
+}
+
+function removePropertiesDeep(tree, opts) {
+  traverseFast(tree, removeProperties, opts);
+  return tree;
+}
+
+/***/ }),
+/* 1 */
+/***/ (function(module, exports, __webpack_require__) {
+
+module.exports = { "default": __webpack_require__(184), __esModule: true };
+
+/***/ }),
+/* 2 */
+/***/ (function(module, exports) {
+
+var core = module.exports = {version: '2.4.0'};
+if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef
+
+/***/ }),
+/* 3 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var store      = __webpack_require__(70)('wks')
+  , uid        = __webpack_require__(43)
+  , Symbol     = __webpack_require__(4).Symbol
+  , USE_SYMBOL = typeof Symbol == 'function';
+
+var $exports = module.exports = function(name){
+  return store[name] || (store[name] =
+    USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
+};
+
+$exports.store = store;
+
+/***/ }),
+/* 4 */
+/***/ (function(module, exports) {
+
+// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
+var global = module.exports = typeof window != 'undefined' && window.Math == Math
+  ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
+if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef
+
+/***/ }),
+/* 5 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var freeGlobal = __webpack_require__(123);
+
+/** Detect free variable `self`. */
+var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
+
+/** Used as a reference to the global object. */
+var root = freeGlobal || freeSelf || Function('return this')();
+
+module.exports = root;
+
+
+/***/ }),
+/* 6 */
+/***/ (function(module, exports, __webpack_require__) {
+
+// Thank's IE8 for his funny defineProperty
+module.exports = !__webpack_require__(18)(function(){
+  return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;
+});
+
+/***/ }),
+/* 7 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var anObject       = __webpack_require__(9)
+  , IE8_DOM_DEFINE = __webpack_require__(102)
+  , toPrimitive    = __webpack_require__(73)
+  , dP             = Object.defineProperty;
+
+exports.f = __webpack_require__(6) ? Object.defineProperty : function defineProperty(O, P, Attributes){
+  anObject(O);
+  P = toPrimitive(P, true);
+  anObject(Attributes);
+  if(IE8_DOM_DEFINE)try {
+    return dP(O, P, Attributes);
+  } catch(e){ /* empty */ }
+  if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');
+  if('value' in Attributes)O[P] = Attributes.value;
+  return O;
+};
+
+/***/ }),
+/* 8 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.__esModule = true;
+exports.DEPRECATED_KEYS = exports.BUILDER_KEYS = exports.NODE_FIELDS = exports.ALIAS_KEYS = exports.VISITOR_KEYS = undefined;
+
+var _getIterator2 = __webpack_require__(1);
+
+var _getIterator3 = _interopRequireDefault(_getIterator2);
+
+var _stringify = __webpack_require__(32);
+
+var _stringify2 = _interopRequireDefault(_stringify);
+
+var _typeof2 = __webpack_require__(26);
+
+var _typeof3 = _interopRequireDefault(_typeof2);
+
+exports.assertEach = assertEach;
+exports.assertOneOf = assertOneOf;
+exports.assertNodeType = assertNodeType;
+exports.assertNodeOrValueType = assertNodeOrValueType;
+exports.assertValueType = assertValueType;
+exports.chain = chain;
+exports.default = defineType;
+
+var _index = __webpack_require__(0);
+
+var t = _interopRequireWildcard(_index);
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var VISITOR_KEYS = exports.VISITOR_KEYS = {};
+var ALIAS_KEYS = exports.ALIAS_KEYS = {};
+var NODE_FIELDS = exports.NODE_FIELDS = {};
+var BUILDER_KEYS = exports.BUILDER_KEYS = {};
+var DEPRECATED_KEYS = exports.DEPRECATED_KEYS = {};
+
+function getType(val) {
+  if (Array.isArray(val)) {
+    return "array";
+  } else if (val === null) {
+    return "null";
+  } else if (val === undefined) {
+    return "undefined";
+  } else {
+    return typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val);
+  }
+}
+
+function assertEach(callback) {
+  function validator(node, key, val) {
+    if (!Array.isArray(val)) return;
+
+    for (var i = 0; i < val.length; i++) {
+      callback(node, key + "[" + i + "]", val[i]);
+    }
+  }
+  validator.each = callback;
+  return validator;
+}
+
+function assertOneOf() {
+  for (var _len = arguments.length, vals = Array(_len), _key = 0; _key < _len; _key++) {
+    vals[_key] = arguments[_key];
+  }
+
+  function validate(node, key, val) {
+    if (vals.indexOf(val) < 0) {
+      throw new TypeError("Property " + key + " expected value to be one of " + (0, _stringify2.default)(vals) + " but got " + (0, _stringify2.default)(val));
+    }
+  }
+
+  validate.oneOf = vals;
+
+  return validate;
+}
+
+function assertNodeType() {
+  for (var _len2 = arguments.length, types = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
+    types[_key2] = arguments[_key2];
+  }
+
+  function validate(node, key, val) {
+    var valid = false;
+
+    for (var _iterator = types, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
+      var _ref;
+
+      if (_isArray) {
+        if (_i >= _iterator.length) break;
+        _ref = _iterator[_i++];
+      } else {
+        _i = _iterator.next();
+        if (_i.done) break;
+        _ref = _i.value;
+      }
+
+      var type = _ref;
+
+      if (t.is(type, val)) {
+        valid = true;
+        break;
+      }
+    }
+
+    if (!valid) {
+      throw new TypeError("Property " + key + " of " + node.type + " expected node to be of a type " + (0, _stringify2.default)(types) + " " + ("but instead got " + (0, _stringify2.default)(val && val.type)));
+    }
+  }
+
+  validate.oneOfNodeTypes = types;
+
+  return validate;
+}
+
+function assertNodeOrValueType() {
+  for (var _len3 = arguments.length, types = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
+    types[_key3] = arguments[_key3];
+  }
+
+  function validate(node, key, val) {
+    var valid = false;
+
+    for (var _iterator2 = types, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
+      var _ref2;
+
+      if (_isArray2) {
+        if (_i2 >= _iterator2.length) break;
+        _ref2 = _iterator2[_i2++];
+      } else {
+        _i2 = _iterator2.next();
+        if (_i2.done) break;
+        _ref2 = _i2.value;
+      }
+
+      var type = _ref2;
+
+      if (getType(val) === type || t.is(type, val)) {
+        valid = true;
+        break;
+      }
+    }
+
+    if (!valid) {
+      throw new TypeError("Property " + key + " of " + node.type + " expected node to be of a type " + (0, _stringify2.default)(types) + " " + ("but instead got " + (0, _stringify2.default)(val && val.type)));
+    }
+  }
+
+  validate.oneOfNodeOrValueTypes = types;
+
+  return validate;
+}
+
+function assertValueType(type) {
+  function validate(node, key, val) {
+    var valid = getType(val) === type;
+
+    if (!valid) {
+      throw new TypeError("Property " + key + " expected type of " + type + " but got " + getType(val));
+    }
+  }
+
+  validate.type = type;
+
+  return validate;
+}
+
+function chain() {
+  for (var _len4 = arguments.length, fns = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
+    fns[_key4] = arguments[_key4];
+  }
+
+  function validate() {
+    for (var _iterator3 = fns, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
+      var _ref3;
+
+      if (_isArray3) {
+        if (_i3 >= _iterator3.length) break;
+        _ref3 = _iterator3[_i3++];
+      } else {
+        _i3 = _iterator3.next();
+        if (_i3.done) break;
+        _ref3 = _i3.value;
+      }
+
+      var fn = _ref3;
+
+      fn.apply(undefined, arguments);
+    }
+  }
+  validate.chainOf = fns;
+  return validate;
+}
+
+function defineType(type) {
+  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+
+  var inherits = opts.inherits && store[opts.inherits] || {};
+
+  opts.fields = opts.fields || inherits.fields || {};
+  opts.visitor = opts.visitor || inherits.visitor || [];
+  opts.aliases = opts.aliases || inherits.aliases || [];
+  opts.builder = opts.builder || inherits.builder || opts.visitor || [];
+
+  if (opts.deprecatedAlias) {
+    DEPRECATED_KEYS[opts.deprecatedAlias] = type;
+  }
+
+  for (var _iterator4 = opts.visitor.concat(opts.builder), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) {
+    var _ref4;
+
+    if (_isArray4) {
+      if (_i4 >= _iterator4.length) break;
+      _ref4 = _iterator4[_i4++];
+    } else {
+      _i4 = _iterator4.next();
+      if (_i4.done) break;
+      _ref4 = _i4.value;
+    }
+
+    var _key5 = _ref4;
+
+    opts.fields[_key5] = opts.fields[_key5] || {};
+  }
+
+  for (var key in opts.fields) {
+    var field = opts.fields[key];
+
+    if (opts.builder.indexOf(key) === -1) {
+      field.optional = true;
+    }
+    if (field.default === undefined) {
+      field.default = null;
+    } else if (!field.validate) {
+      field.validate = assertValueType(getType(field.default));
+    }
+  }
+
+  VISITOR_KEYS[type] = opts.visitor;
+  BUILDER_KEYS[type] = opts.builder;
+  NODE_FIELDS[type] = opts.fields;
+  ALIAS_KEYS[type] = opts.aliases;
+
+  store[type] = opts;
+}
+
+var store = {};
+
+/***/ }),
+/* 9 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var isObject = __webpack_require__(12);
+module.exports = function(it){
+  if(!isObject(it))throw TypeError(it + ' is not an object!');
+  return it;
+};
+
+/***/ }),
+/* 10 */
+/***/ (function(module, exports) {
+
+var hasOwnProperty = {}.hasOwnProperty;
+module.exports = function(it, key){
+  return hasOwnProperty.call(it, key);
+};
+
+/***/ }),
+/* 11 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var dP         = __webpack_require__(7)
+  , createDesc = __webpack_require__(40);
+module.exports = __webpack_require__(6) ? function(object, key, value){
+  return dP.f(object, key, createDesc(1, value));
+} : function(object, key, value){
+  object[key] = value;
+  return object;
+};
+
+/***/ }),
+/* 12 */
+/***/ (function(module, exports) {
+
+module.exports = function(it){
+  return typeof it === 'object' ? it !== null : typeof it === 'function';
+};
+
+/***/ }),
+/* 13 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var Symbol = __webpack_require__(46),
+    getRawTag = __webpack_require__(289),
+    objectToString = __webpack_require__(318);
+
+/** `Object#toString` result references. */
+var nullTag = '[object Null]',
+    undefinedTag = '[object Undefined]';
+
+/** Built-in value references. */
+var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
+
+/**
+ * The base implementation of `getTag` without fallbacks for buggy environments.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the `toStringTag`.
+ */
+function baseGetTag(value) {
+  if (value == null) {
+    return value === undefined ? undefinedTag : nullTag;
+  }
+  return (symToStringTag && symToStringTag in Object(value))
+    ? getRawTag(value)
+    : objectToString(value);
+}
+
+module.exports = baseGetTag;
+
+
+/***/ }),
+/* 14 */
+/***/ (function(module, exports) {
+
+/**
+ * Checks if `value` is classified as an `Array` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
+ * @example
+ *
+ * _.isArray([1, 2, 3]);
+ * // => true
+ *
+ * _.isArray(document.body.children);
+ * // => false
+ *
+ * _.isArray('abc');
+ * // => false
+ *
+ * _.isArray(_.noop);
+ * // => false
+ */
+var isArray = Array.isArray;
+
+module.exports = isArray;
+
+
+/***/ }),
+/* 15 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.__esModule = true;
+
+exports.default = function (instance, Constructor) {
+  if (!(instance instanceof Constructor)) {
+    throw new TypeError("Cannot call a class as a function");
+  }
+};
+
+/***/ }),
+/* 16 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.__esModule = true;
+
+var _getIterator2 = __webpack_require__(1);
+
+var _getIterator3 = _interopRequireDefault(_getIterator2);
+
+var _classCallCheck2 = __webpack_require__(15);
+
+var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
+
+var _virtualTypes = __webpack_require__(95);
+
+var virtualTypes = _interopRequireWildcard(_virtualTypes);
+
+var _debug2 = __webpack_require__(229);
+
+var _debug3 = _interopRequireDefault(_debug2);
+
+var _invariant = __webpack_require__(238);
+
+var _invariant2 = _interopRequireDefault(_invariant);
+
+var _index = __webpack_require__(27);
+
+var _index2 = _interopRequireDefault(_index);
+
+var _assign = __webpack_require__(129);
+
+var _assign2 = _interopRequireDefault(_assign);
+
+var _scope = __webpack_require__(57);
+
+var _scope2 = _interopRequireDefault(_scope);
+
+var _babelTypes = __webpack_require__(0);
+
+var t = _interopRequireWildcard(_babelTypes);
+
+var _cache = __webpack_require__(34);
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var _debug = (0, _debug3.default)("babel");
+
+var NodePath = function () {
+  function NodePath(hub, parent) {
+    (0, _classCallCheck3.default)(this, NodePath);
+
+    this.parent = parent;
+    this.hub = hub;
+    this.contexts = [];
+    this.data = {};
+    this.shouldSkip = false;
+    this.shouldStop = false;
+    this.removed = false;
+    this.state = null;
+    this.opts = null;
+    this.skipKeys = null;
+    this.parentPath = null;
+    this.context = null;
+    this.container = null;
+    this.listKey = null;
+    this.inList = false;
+    this.parentKey = null;
+    this.key = null;
+    this.node = null;
+    this.scope = null;
+    this.type = null;
+    this.typeAnnotation = null;
+  }
+
+  NodePath.get = function get(_ref) {
+    var hub = _ref.hub,
+        parentPath = _ref.parentPath,
+        parent = _ref.parent,
+        container = _ref.container,
+        listKey = _ref.listKey,
+        key = _ref.key;
+
+    if (!hub && parentPath) {
+      hub = parentPath.hub;
+    }
+
+    (0, _invariant2.default)(parent, "To get a node path the parent needs to exist");
+
+    var targetNode = container[key];
+
+    var paths = _cache.path.get(parent) || [];
+    if (!_cache.path.has(parent)) {
+      _cache.path.set(parent, paths);
+    }
+
+    var path = void 0;
+
+    for (var i = 0; i < paths.length; i++) {
+      var pathCheck = paths[i];
+      if (pathCheck.node === targetNode) {
+        path = pathCheck;
+        break;
+      }
+    }
+
+    if (!path) {
+      path = new NodePath(hub, parent);
+      paths.push(path);
+    }
+
+    path.setup(parentPath, container, listKey, key);
+
+    return path;
+  };
+
+  NodePath.prototype.getScope = function getScope(scope) {
+    var ourScope = scope;
+
+    if (this.isScope()) {
+      ourScope = new _scope2.default(this, scope);
+    }
+
+    return ourScope;
+  };
+
+  NodePath.prototype.setData = function setData(key, val) {
+    return this.data[key] = val;
+  };
+
+  NodePath.prototype.getData = function getData(key, def) {
+    var val = this.data[key];
+    if (!val && def) val = this.data[key] = def;
+    return val;
+  };
+
+  NodePath.prototype.buildCodeFrameError = function buildCodeFrameError(msg) {
+    var Error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : SyntaxError;
+
+    return this.hub.file.buildCodeFrameError(this.node, msg, Error);
+  };
+
+  NodePath.prototype.traverse = function traverse(visitor, state) {
+    (0, _index2.default)(this.node, visitor, this.scope, state, this);
+  };
+
+  NodePath.prototype.mark = function mark(type, message) {
+    this.hub.file.metadata.marked.push({
+      type: type,
+      message: message,
+      loc: this.node.loc
+    });
+  };
+
+  NodePath.prototype.set = function set(key, node) {
+    t.validate(this.node, key, node);
+    this.node[key] = node;
+  };
+
+  NodePath.prototype.getPathLocation = function getPathLocation() {
+    var parts = [];
+    var path = this;
+    do {
+      var key = path.key;
+      if (path.inList) key = path.listKey + "[" + key + "]";
+      parts.unshift(key);
+    } while (path = path.parentPath);
+    return parts.join(".");
+  };
+
+  NodePath.prototype.debug = function debug(buildMessage) {
+    if (!_debug.enabled) return;
+    _debug(this.getPathLocation() + " " + this.type + ": " + buildMessage());
+  };
+
+  return NodePath;
+}();
+
+exports.default = NodePath;
+
+
+(0, _assign2.default)(NodePath.prototype, __webpack_require__(153));
+(0, _assign2.default)(NodePath.prototype, __webpack_require__(159));
+(0, _assign2.default)(NodePath.prototype, __webpack_require__(167));
+(0, _assign2.default)(NodePath.prototype, __webpack_require__(157));
+(0, _assign2.default)(NodePath.prototype, __webpack_require__(156));
+(0, _assign2.default)(NodePath.prototype, __webpack_require__(162));
+(0, _assign2.default)(NodePath.prototype, __webpack_require__(155));
+(0, _assign2.default)(NodePath.prototype, __webpack_require__(166));
+(0, _assign2.default)(NodePath.prototype, __webpack_require__(165));
+(0, _assign2.default)(NodePath.prototype, __webpack_require__(158));
+(0, _assign2.default)(NodePath.prototype, __webpack_require__(154));
+
+var _loop2 = function _loop2() {
+  if (_isArray) {
+    if (_i >= _iterator.length) return "break";
+    _ref2 = _iterator[_i++];
+  } else {
+    _i = _iterator.next();
+    if (_i.done) return "break";
+    _ref2 = _i.value;
+  }
+
+  var type = _ref2;
+
+  var typeKey = "is" + type;
+  NodePath.prototype[typeKey] = function (opts) {
+    return t[typeKey](this.node, opts);
+  };
+
+  NodePath.prototype["assert" + type] = function (opts) {
+    if (!this[typeKey](opts)) {
+      throw new TypeError("Expected node path of type " + type);
+    }
+  };
+};
+
+for (var _iterator = t.TYPES, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
+  var _ref2;
+
+  var _ret2 = _loop2();
+
+  if (_ret2 === "break") break;
+}
+
+var _loop = function _loop(type) {
+  if (type[0] === "_") return "continue";
+  if (t.TYPES.indexOf(type) < 0) t.TYPES.push(type);
+
+  var virtualType = virtualTypes[type];
+
+  NodePath.prototype["is" + type] = function (opts) {
+    return virtualType.checkPath(this, opts);
+  };
+};
+
+for (var type in virtualTypes) {
+  var _ret = _loop(type);
+
+  if (_ret === "continue") continue;
+}
+module.exports = exports["default"];
+
+/***/ }),
+/* 17 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var global    = __webpack_require__(4)
+  , core      = __webpack_require__(2)
+  , ctx       = __webpack_require__(35)
+  , hide      = __webpack_require__(11)
+  , PROTOTYPE = 'prototype';
+
+var $export = function(type, name, source){
+  var IS_FORCED = type & $export.F
+    , IS_GLOBAL = type & $export.G
+    , IS_STATIC = type & $export.S
+    , IS_PROTO  = type & $export.P
+    , IS_BIND   = type & $export.B
+    , IS_WRAP   = type & $export.W
+    , exports   = IS_GLOBAL ? core : core[name] || (core[name] = {})
+    , expProto  = exports[PROTOTYPE]
+    , target    = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]
+    , key, own, out;
+  if(IS_GLOBAL)source = name;
+  for(key in source){
+    // contains in native
+    own = !IS_FORCED && target && target[key] !== undefined;
+    if(own && key in exports)continue;
+    // export native or passed
+    out = own ? target[key] : source[key];
+    // prevent global pollution for namespaces
+    exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
+    // bind timers to global for call from export context
+    : IS_BIND && own ? ctx(out, global)
+    // wrap global constructors for prevent change them in library
+    : IS_WRAP && target[key] == out ? (function(C){
+      var F = function(a, b, c){
+        if(this instanceof C){
+          switch(arguments.length){
+            case 0: return new C;
+            case 1: return new C(a);
+            case 2: return new C(a, b);
+          } return new C(a, b, c);
+        } return C.apply(this, arguments);
+      };
+      F[PROTOTYPE] = C[PROTOTYPE];
+      return F;
+    // make static versions for prototype methods
+    })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
+    // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
+    if(IS_PROTO){
+      (exports.virtual || (exports.virtual = {}))[key] = out;
+      // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
+      if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out);
+    }
+  }
+};
+// type bitmap
+$export.F = 1;   // forced
+$export.G = 2;   // global
+$export.S = 4;   // static
+$export.P = 8;   // proto
+$export.B = 16;  // bind
+$export.W = 32;  // wrap
+$export.U = 64;  // safe
+$export.R = 128; // real proto method for `library` 
+module.exports = $export;
+
+/***/ }),
+/* 18 */
+/***/ (function(module, exports) {
+
+module.exports = function(exec){
+  try {
+    return !!exec();
+  } catch(e){
+    return true;
+  }
+};
+
+/***/ }),
+/* 19 */
+/***/ (function(module, exports, __webpack_require__) {
+
+// to indexed object, toObject with fallback for non-array-like ES3 strings
+var IObject = __webpack_require__(63)
+  , defined = __webpack_require__(36);
+module.exports = function(it){
+  return IObject(defined(it));
+};
+
+/***/ }),
+/* 20 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseIsNative = __webpack_require__(261),
+    getValue = __webpack_require__(291);
+
+/**
+ * Gets the native function at `key` of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {string} key The key of the method to get.
+ * @returns {*} Returns the function if it's native, else `undefined`.
+ */
+function getNative(object, key) {
+  var value = getValue(object, key);
+  return baseIsNative(value) ? value : undefined;
+}
+
+module.exports = getNative;
+
+
+/***/ }),
+/* 21 */
+/***/ (function(module, exports) {
+
+/**
+ * Checks if `value` is the
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(_.noop);
+ * // => true
+ *
+ * _.isObject(null);
+ * // => false
+ */
+function isObject(value) {
+  var type = typeof value;
+  return value != null && (type == 'object' || type == 'function');
+}
+
+module.exports = isObject;
+
+
+/***/ }),
+/* 22 */
+/***/ (function(module, exports) {
+
+/**
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
+ * and has a `typeof` result of "object".
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ * @example
+ *
+ * _.isObjectLike({});
+ * // => true
+ *
+ * _.isObjectLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isObjectLike(_.noop);
+ * // => false
+ *
+ * _.isObjectLike(null);
+ * // => false
+ */
+function isObjectLike(value) {
+  return value != null && typeof value == 'object';
+}
+
+module.exports = isObjectLike;
+
+
+/***/ }),
+/* 23 */
+/***/ (function(module, exports, __webpack_require__) {
+
+// 19.1.2.14 / 15.2.3.14 Object.keys(O)
+var $keys       = __webpack_require__(106)
+  , enumBugKeys = __webpack_require__(62);
+
+module.exports = Object.keys || function keys(O){
+  return $keys(O, enumBugKeys);
+};
+
+/***/ }),
+/* 24 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var assignValue = __webpack_require__(82),
+    baseAssignValue = __webpack_require__(115);
+
+/**
+ * Copies properties of `source` to `object`.
+ *
+ * @private
+ * @param {Object} source The object to copy properties from.
+ * @param {Array} props The property identifiers to copy.
+ * @param {Object} [object={}] The object to copy properties to.
+ * @param {Function} [customizer] The function to customize copied values.
+ * @returns {Object} Returns `object`.
+ */
+function copyObject(source, props, object, customizer) {
+  var isNew = !object;
+  object || (object = {});
+
+  var index = -1,
+      length = props.length;
+
+  while (++index < length) {
+    var key = props[index];
+
+    var newValue = customizer
+      ? customizer(object[key], source[key], key, object, source)
+      : undefined;
+
+    if (newValue === undefined) {
+      newValue = source[key];
+    }
+    if (isNew) {
+      baseAssignValue(object, key, newValue);
+    } else {
+      assignValue(object, key, newValue);
+    }
+  }
+  return object;
+}
+
+module.exports = copyObject;
+
+
+/***/ }),
+/* 25 */
+/***/ (function(module, exports) {
+
+// shim for using process in browser
+var process = module.exports = {};
+
+// cached from whatever global is present so that test runners that stub it
+// don't break things.  But we need to wrap it in a try catch in case it is
+// wrapped in strict mode code which doesn't define any globals.  It's inside a
+// function because try/catches deoptimize in certain engines.
+
+var cachedSetTimeout;
+var cachedClearTimeout;
+
+function defaultSetTimout() {
+    throw new Error('setTimeout has not been defined');
+}
+function defaultClearTimeout () {
+    throw new Error('clearTimeout has not been defined');
+}
+(function () {
+    try {
+        if (typeof setTimeout === 'function') {
+            cachedSetTimeout = setTimeout;
+        } else {
+            cachedSetTimeout = defaultSetTimout;
+        }
+    } catch (e) {
+        cachedSetTimeout = defaultSetTimout;
+    }
+    try {
+        if (typeof clearTimeout === 'function') {
+            cachedClearTimeout = clearTimeout;
+        } else {
+            cachedClearTimeout = defaultClearTimeout;
+        }
+    } catch (e) {
+        cachedClearTimeout = defaultClearTimeout;
+    }
+} ())
+function runTimeout(fun) {
+    if (cachedSetTimeout === setTimeout) {
+        //normal enviroments in sane situations
+        return setTimeout(fun, 0);
+    }
+    // if setTimeout wasn't available but was latter defined
+    if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
+        cachedSetTimeout = setTimeout;
+        return setTimeout(fun, 0);
+    }
+    try {
+        // when when somebody has screwed with setTimeout but no I.E. maddness
+        return cachedSetTimeout(fun, 0);
+    } catch(e){
+        try {
+            // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
+            return cachedSetTimeout.call(null, fun, 0);
+        } catch(e){
+            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
+            return cachedSetTimeout.call(this, fun, 0);
+        }
+    }
+
+
+}
+function runClearTimeout(marker) {
+    if (cachedClearTimeout === clearTimeout) {
+        //normal enviroments in sane situations
+        return clearTimeout(marker);
+    }
+    // if clearTimeout wasn't available but was latter defined
+    if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
+        cachedClearTimeout = clearTimeout;
+        return clearTimeout(marker);
+    }
+    try {
+        // when when somebody has screwed with setTimeout but no I.E. maddness
+        return cachedClearTimeout(marker);
+    } catch (e){
+        try {
+            // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally
+            return cachedClearTimeout.call(null, marker);
+        } catch (e){
+            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
+            // Some versions of I.E. have different rules for clearTimeout vs setTimeout
+            return cachedClearTimeout.call(this, marker);
+        }
+    }
+
+
+
+}
+var queue = [];
+var draining = false;
+var currentQueue;
+var queueIndex = -1;
+
+function cleanUpNextTick() {
+    if (!draining || !currentQueue) {
+        return;
+    }
+    draining = false;
+    if (currentQueue.length) {
+        queue = currentQueue.concat(queue);
+    } else {
+        queueIndex = -1;
+    }
+    if (queue.length) {
+        drainQueue();
+    }
+}
+
+function drainQueue() {
+    if (draining) {
+        return;
+    }
+    var timeout = runTimeout(cleanUpNextTick);
+    draining = true;
+
+    var len = queue.length;
+    while(len) {
+        currentQueue = queue;
+        queue = [];
+        while (++queueIndex < len) {
+            if (currentQueue) {
+                currentQueue[queueIndex].run();
+            }
+        }
+        queueIndex = -1;
+        len = queue.length;
+    }
+    currentQueue = null;
+    draining = false;
+    runClearTimeout(timeout);
+}
+
+process.nextTick = function (fun) {
+    var args = new Array(arguments.length - 1);
+    if (arguments.length > 1) {
+        for (var i = 1; i < arguments.length; i++) {
+            args[i - 1] = arguments[i];
+        }
+    }
+    queue.push(new Item(fun, args));
+    if (queue.length === 1 && !draining) {
+        runTimeout(drainQueue);
+    }
+};
+
+// v8 likes predictible objects
+function Item(fun, array) {
+    this.fun = fun;
+    this.array = array;
+}
+Item.prototype.run = function () {
+    this.fun.apply(null, this.array);
+};
+process.title = 'browser';
+process.browser = true;
+process.env = {};
+process.argv = [];
+process.version = ''; // empty string to avoid regexp issues
+process.versions = {};
+
+function noop() {}
+
+process.on = noop;
+process.addListener = noop;
+process.once = noop;
+process.off = noop;
+process.removeListener = noop;
+process.removeAllListeners = noop;
+process.emit = noop;
+
+process.binding = function (name) {
+    throw new Error('process.binding is not supported');
+};
+
+process.cwd = function () { return '/' };
+process.chdir = function (dir) {
+    throw new Error('process.chdir is not supported');
+};
+process.umask = function() { return 0; };
+
+
+/***/ }),
+/* 26 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.__esModule = true;
+
+var _iterator = __webpack_require__(150);
+
+var _iterator2 = _interopRequireDefault(_iterator);
+
+var _symbol = __webpack_require__(93);
+
+var _symbol2 = _interopRequireDefault(_symbol);
+
+var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {
+  return typeof obj === "undefined" ? "undefined" : _typeof(obj);
+} : function (obj) {
+  return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);
+};
+
+/***/ }),
+/* 27 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.__esModule = true;
+exports.visitors = exports.Hub = exports.Scope = exports.NodePath = undefined;
+
+var _getIterator2 = __webpack_require__(1);
+
+var _getIterator3 = _interopRequireDefault(_getIterator2);
+
+var _path = __webpack_require__(16);
+
+Object.defineProperty(exports, "NodePath", {
+  enumerable: true,
+  get: function get() {
+    return _interopRequireDefault(_path).default;
+  }
+});
+
+var _scope = __webpack_require__(57);
+
+Object.defineProperty(exports, "Scope", {
+  enumerable: true,
+  get: function get() {
+    return _interopRequireDefault(_scope).default;
+  }
+});
+
+var _hub = __webpack_require__(94);
+
+Object.defineProperty(exports, "Hub", {
+  enumerable: true,
+  get: function get() {
+    return _interopRequireDefault(_hub).default;
+  }
+});
+exports.default = traverse;
+
+var _context = __webpack_require__(152);
+
+var _context2 = _interopRequireDefault(_context);
+
+var _visitors = __webpack_require__(169);
+
+var visitors = _interopRequireWildcard(_visitors);
+
+var _babelMessages = __webpack_require__(55);
+
+var messages = _interopRequireWildcard(_babelMessages);
+
+var _includes = __webpack_require__(88);
+
+var _includes2 = _interopRequireDefault(_includes);
+
+var _babelTypes = __webpack_require__(0);
+
+var t = _interopRequireWildcard(_babelTypes);
+
+var _cache = __webpack_require__(34);
+
+var cache = _interopRequireWildcard(_cache);
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+exports.visitors = visitors;
+function traverse(parent, opts, scope, state, parentPath) {
+  if (!parent) return;
+  if (!opts) opts = {};
+
+  if (!opts.noScope && !scope) {
+    if (parent.type !== "Program" && parent.type !== "File") {
+      throw new Error(messages.get("traverseNeedsParent", parent.type));
+    }
+  }
+
+  visitors.explode(opts);
+
+  traverse.node(parent, opts, scope, state, parentPath);
+}
+
+traverse.visitors = visitors;
+traverse.verify = visitors.verify;
+traverse.explode = visitors.explode;
+
+traverse.NodePath = __webpack_require__(16);
+traverse.Scope = __webpack_require__(57);
+traverse.Hub = __webpack_require__(94);
+
+traverse.cheap = function (node, enter) {
+  return t.traverseFast(node, enter);
+};
+
+traverse.node = function (node, opts, scope, state, parentPath, skipKeys) {
+  var keys = t.VISITOR_KEYS[node.type];
+  if (!keys) return;
+
+  var context = new _context2.default(scope, opts, state, parentPath);
+  for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
+    var _ref;
+
+    if (_isArray) {
+      if (_i >= _iterator.length) break;
+      _ref = _iterator[_i++];
+    } else {
+      _i = _iterator.next();
+      if (_i.done) break;
+      _ref = _i.value;
+    }
+
+    var key = _ref;
+
+    if (skipKeys && skipKeys[key]) continue;
+    if (context.visit(node, key)) return;
+  }
+};
+
+traverse.clearNode = function (node, opts) {
+  t.removeProperties(node, opts);
+
+  cache.path.delete(node);
+};
+
+traverse.removeProperties = function (tree, opts) {
+  t.traverseFast(tree, traverse.clearNode, opts);
+  return tree;
+};
+
+function hasBlacklistedType(path, state) {
+  if (path.node.type === state.type) {
+    state.has = true;
+    path.stop();
+  }
+}
+
+traverse.hasType = function (tree, scope, type, blacklistTypes) {
+  if ((0, _includes2.default)(blacklistTypes, tree.type)) return false;
+
+  if (tree.type === type) return true;
+
+  var state = {
+    has: false,
+    type: type
+  };
+
+  traverse(tree, {
+    blacklist: blacklistTypes,
+    enter: hasBlacklistedType
+  }, scope, state);
+
+  return state.has;
+};
+
+traverse.clearCache = function () {
+  cache.clear();
+};
+
+traverse.clearCache.clearPath = cache.clearPath;
+traverse.clearCache.clearScope = cache.clearScope;
+
+traverse.copyCache = function (source, destination) {
+  if (cache.path.has(source)) {
+    cache.path.set(destination, cache.path.get(source));
+  }
+};
+
+/***/ }),
+/* 28 */
+/***/ (function(module, exports) {
+
+module.exports = {};
+
+/***/ }),
+/* 29 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var META     = __webpack_require__(43)('meta')
+  , isObject = __webpack_require__(12)
+  , has      = __webpack_require__(10)
+  , setDesc  = __webpack_require__(7).f
+  , id       = 0;
+var isExtensible = Object.isExtensible || function(){
+  return true;
+};
+var FREEZE = !__webpack_require__(18)(function(){
+  return isExtensible(Object.preventExtensions({}));
+});
+var setMeta = function(it){
+  setDesc(it, META, {value: {
+    i: 'O' + ++id, // object ID
+    w: {}          // weak collections IDs
+  }});
+};
+var fastKey = function(it, create){
+  // return primitive with prefix
+  if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
+  if(!has(it, META)){
+    // can't set metadata to uncaught frozen object
+    if(!isExtensible(it))return 'F';
+    // not necessary to add metadata
+    if(!create)return 'E';
+    // add missing metadata
+    setMeta(it);
+  // return object ID
+  } return it[META].i;
+};
+var getWeak = function(it, create){
+  if(!has(it, META)){
+    // can't set metadata to uncaught frozen object
+    if(!isExtensible(it))return true;
+    // not necessary to add metadata
+    if(!create)return false;
+    // add missing metadata
+    setMeta(it);
+  // return hash weak collections IDs
+  } return it[META].w;
+};
+// add metadata on freeze-family methods calling
+var onFreeze = function(it){
+  if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it);
+  return it;
+};
+var meta = module.exports = {
+  KEY:      META,
+  NEED:     false,
+  fastKey:  fastKey,
+  getWeak:  getWeak,
+  onFreeze: onFreeze
+};
+
+/***/ }),
+/* 30 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var isFunction = __webpack_require__(134),
+    isLength = __webpack_require__(89);
+
+/**
+ * Checks if `value` is array-like. A value is considered array-like if it's
+ * not a function and has a `value.length` that's an integer greater than or
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
+ * @example
+ *
+ * _.isArrayLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isArrayLike(document.body.children);
+ * // => true
+ *
+ * _.isArrayLike('abc');
+ * // => true
+ *
+ * _.isArrayLike(_.noop);
+ * // => false
+ */
+function isArrayLike(value) {
+  return value != null && isLength(value.length) && !isFunction(value);
+}
+
+module.exports = isArrayLike;
+
+
+/***/ }),
+/* 31 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var arrayLikeKeys = __webpack_require__(111),
+    baseKeys = __webpack_require__(264),
+    isArrayLike = __webpack_require__(30);
+
+/**
+ * Creates an array of the own enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects. See the
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
+ * for more details.
+ *
+ * @static
+ * @since 0.1.0
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ *   this.a = 1;
+ *   this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keys(new Foo);
+ * // => ['a', 'b'] (iteration order is not guaranteed)
+ *
+ * _.keys('hi');
+ * // => ['0', '1']
+ */
+function keys(object) {
+  return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
+}
+
+module.exports = keys;
+
+
+/***/ }),
+/* 32 */
+/***/ (function(module, exports, __webpack_require__) {
+
+module.exports = { "default": __webpack_require__(185), __esModule: true };
+
+/***/ }),
+/* 33 */
+/***/ (function(module, exports, __webpack_require__) {
+
+module.exports = { "default": __webpack_require__(190), __esModule: true };
+
+/***/ }),
+/* 34 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.__esModule = true;
+exports.scope = exports.path = undefined;
+
+var _weakMap = __webpack_require__(151);
+
+var _weakMap2 = _interopRequireDefault(_weakMap);
+
+exports.clear = clear;
+exports.clearPath = clearPath;
+exports.clearScope = clearScope;
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var path = exports.path = new _weakMap2.default();
+var scope = exports.scope = new _weakMap2.default();
+
+function clear() {
+  clearPath();
+  clearScope();
+}
+
+function clearPath() {
+  exports.path = path = new _weakMap2.default();
+}
+
+function clearScope() {
+  exports.scope = scope = new _weakMap2.default();
+}
+
+/***/ }),
+/* 35 */
+/***/ (function(module, exports, __webpack_require__) {
+
+// optional / simple context binding
+var aFunction = __webpack_require__(195);
+module.exports = function(fn, that, length){
+  aFunction(fn);
+  if(that === undefined)return fn;
+  switch(length){
+    case 1: return function(a){
+      return fn.call(that, a);
+    };
+    case 2: return function(a, b){
+      return fn.call(that, a, b);
+    };
+    case 3: return function(a, b, c){
+      return fn.call(that, a, b, c);
+    };
+  }
+  return function(/* ...args */){
+    return fn.apply(that, arguments);
+  };
+};
+
+/***/ }),
+/* 36 */
+/***/ (function(module, exports) {
+
+// 7.2.1 RequireObjectCoercible(argument)
+module.exports = function(it){
+  if(it == undefined)throw TypeError("Can't call method on  " + it);
+  return it;
+};
+
+/***/ }),
+/* 37 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var ctx         = __webpack_require__(35)
+  , call        = __webpack_require__(207)
+  , isArrayIter = __webpack_require__(206)
+  , anObject    = __webpack_require__(9)
+  , toLength    = __webpack_require__(72)
+  , getIterFn   = __webpack_require__(107)
+  , BREAK       = {}
+  , RETURN      = {};
+var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){
+  var iterFn = ITERATOR ? function(){ return iterable; } : getIterFn(iterable)
+    , f      = ctx(fn, that, entries ? 2 : 1)
+    , index  = 0
+    , length, step, iterator, result;
+  if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!');
+  // fast case for arrays with default iterator
+  if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){
+    result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
+    if(result === BREAK || result === RETURN)return result;
+  } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){
+    result = call(iterator, f, step.value, entries);
+    if(result === BREAK || result === RETURN)return result;
+  }
+};
+exports.BREAK  = BREAK;
+exports.RETURN = RETURN;
+
+/***/ }),
+/* 38 */
+/***/ (function(module, exports, __webpack_require__) {
+
+// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
+var anObject    = __webpack_require__(9)
+  , dPs         = __webpack_require__(211)
+  , enumBugKeys = __webpack_require__(62)
+  , IE_PROTO    = __webpack_require__(69)('IE_PROTO')
+  , Empty       = function(){ /* empty */ }
+  , PROTOTYPE   = 'prototype';
+
+// Create object with fake `null` prototype: use iframe Object with cleared prototype
+var createDict = function(){
+  // Thrash, waste and sodomy: IE GC bug
+  var iframe = __webpack_require__(101)('iframe')
+    , i      = enumBugKeys.length
+    , lt     = '<'
+    , gt     = '>'
+    , iframeDocument;
+  iframe.style.display = 'none';
+  __webpack_require__(205).appendChild(iframe);
+  iframe.src = 'javascript:'; // eslint-disable-line no-script-url
+  // createDict = iframe.contentWindow.Object;
+  // html.removeChild(iframe);
+  iframeDocument = iframe.contentWindow.document;
+  iframeDocument.open();
+  iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
+  iframeDocument.close();
+  createDict = iframeDocument.F;
+  while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]];
+  return createDict();
+};
+
+module.exports = Object.create || function create(O, Properties){
+  var result;
+  if(O !== null){
+    Empty[PROTOTYPE] = anObject(O);
+    result = new Empty;
+    Empty[PROTOTYPE] = null;
+    // add "__proto__" for Object.getPrototypeOf polyfill
+    result[IE_PROTO] = O;
+  } else result = createDict();
+  return Properties === undefined ? result : dPs(result, Properties);
+};
+
+
+/***/ }),
+/* 39 */
+/***/ (function(module, exports) {
+
+exports.f = {}.propertyIsEnumerable;
+
+/***/ }),
+/* 40 */
+/***/ (function(module, exports) {
+
+module.exports = function(bitmap, value){
+  return {
+    enumerable  : !(bitmap & 1),
+    configurable: !(bitmap & 2),
+    writable    : !(bitmap & 4),
+    value       : value
+  };
+};
+
+/***/ }),
+/* 41 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var def = __webpack_require__(7).f
+  , has = __webpack_require__(10)
+  , TAG = __webpack_require__(3)('toStringTag');
+
+module.exports = function(it, tag, stat){
+  if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag});
+};
+
+/***/ }),
+/* 42 */
+/***/ (function(module, exports, __webpack_require__) {
+
+// 7.1.13 ToObject(argument)
+var defined = __webpack_require__(36);
+module.exports = function(it){
+  return Object(defined(it));
+};
+
+/***/ }),
+/* 43 */
+/***/ (function(module, exports) {
+
+var id = 0
+  , px = Math.random();
+module.exports = function(key){
+  return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
+};
+
+/***/ }),
+/* 44 */
+/***/ (function(module, exports, __webpack_require__) {
+
+__webpack_require__(220);
+var global        = __webpack_require__(4)
+  , hide          = __webpack_require__(11)
+  , Iterators     = __webpack_require__(28)
+  , TO_STRING_TAG = __webpack_require__(3)('toStringTag');
+
+for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){
+  var NAME       = collections[i]
+    , Collection = global[NAME]
+    , proto      = Collection && Collection.prototype;
+  if(proto && !proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME);
+  Iterators[NAME] = Iterators.Array;
+}
+
+/***/ }),
+/* 45 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var listCacheClear = __webpack_require__(304),
+    listCacheDelete = __webpack_require__(305),
+    listCacheGet = __webpack_require__(306),
+    listCacheHas = __webpack_require__(307),
+    listCacheSet = __webpack_require__(308);
+
+/**
+ * Creates an list cache object.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [entries] The key-value pairs to cache.
+ */
+function ListCache(entries) {
+  var index = -1,
+      length = entries == null ? 0 : entries.length;
+
+  this.clear();
+  while (++index < length) {
+    var entry = entries[index];
+    this.set(entry[0], entry[1]);
+  }
+}
+
+// Add methods to `ListCache`.
+ListCache.prototype.clear = listCacheClear;
+ListCache.prototype['delete'] = listCacheDelete;
+ListCache.prototype.get = listCacheGet;
+ListCache.prototype.has = listCacheHas;
+ListCache.prototype.set = listCacheSet;
+
+module.exports = ListCache;
+
+
+/***/ }),
+/* 46 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var root = __webpack_require__(5);
+
+/** Built-in value references. */
+var Symbol = root.Symbol;
+
+module.exports = Symbol;
+
+
+/***/ }),
+/* 47 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var eq = __webpack_require__(51);
+
+/**
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {*} key The key to search for.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function assocIndexOf(array, key) {
+  var length = array.length;
+  while (length--) {
+    if (eq(array[length][0], key)) {
+      return length;
+    }
+  }
+  return -1;
+}
+
+module.exports = assocIndexOf;
+
+
+/***/ }),
+/* 48 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var isKeyable = __webpack_require__(302);
+
+/**
+ * Gets the data for `map`.
+ *
+ * @private
+ * @param {Object} map The map to query.
+ * @param {string} key The reference key.
+ * @returns {*} Returns the map data.
+ */
+function getMapData(map, key) {
+  var data = map.__data__;
+  return isKeyable(key)
+    ? data[typeof key == 'string' ? 'string' : 'hash']
+    : data.map;
+}
+
+module.exports = getMapData;
+
+
+/***/ }),
+/* 49 */
+/***/ (function(module, exports) {
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Checks if `value` is likely a prototype object.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
+ */
+function isPrototype(value) {
+  var Ctor = value && value.constructor,
+      proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
+
+  return value === proto;
+}
+
+module.exports = isPrototype;
+
+
+/***/ }),
+/* 50 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var getNative = __webpack_require__(20);
+
+/* Built-in method references that are verified to be native. */
+var nativeCreate = getNative(Object, 'create');
+
+module.exports = nativeCreate;
+
+
+/***/ }),
+/* 51 */
+/***/ (function(module, exports) {
+
+/**
+ * Performs a
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
+ * comparison between two values to determine if they are equivalent.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+ * @example
+ *
+ * var object = { 'a': 1 };
+ * var other = { 'a': 1 };
+ *
+ * _.eq(object, object);
+ * // => true
+ *
+ * _.eq(object, other);
+ * // => false
+ *
+ * _.eq('a', 'a');
+ * // => true
+ *
+ * _.eq('a', Object('a'));
+ * // => false
+ *
+ * _.eq(NaN, NaN);
+ * // => true
+ */
+function eq(value, other) {
+  return value === other || (value !== value && other !== other);
+}
+
+module.exports = eq;
+
+
+/***/ }),
+/* 52 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseGetTag = __webpack_require__(13),
+    isObjectLike = __webpack_require__(22);
+
+/** `Object#toString` result references. */
+var symbolTag = '[object Symbol]';
+
+/**
+ * Checks if `value` is classified as a `Symbol` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
+ * @example
+ *
+ * _.isSymbol(Symbol.iterator);
+ * // => true
+ *
+ * _.isSymbol('abc');
+ * // => false
+ */
+function isSymbol(value) {
+  return typeof value == 'symbol' ||
+    (isObjectLike(value) && baseGetTag(value) == symbolTag);
+}
+
+module.exports = isSymbol;
+
+
+/***/ }),
+/* 53 */
+/***/ (function(module, exports) {
+
+var g;
+
+// This works in non-strict mode
+g = (function() {
+	return this;
+})();
+
+try {
+	// This works if eval is allowed (see CSP)
+	g = g || Function("return this")() || (1,eval)("this");
+} catch(e) {
+	// This works if the window reference is available
+	if(typeof window === "object")
+		g = window;
+}
+
+// g can still be undefined, but nothing to do about it...
+// We return undefined, instead of nothing here, so it's
+// easier to handle this case. if(!global) { ...}
+
+module.exports = g;
+
+
+/***/ }),
+/* 54 */
+/***/ (function(module, exports) {
+
+module.exports = function(module) {
+	if(!module.webpackPolyfill) {
+		module.deprecate = function() {};
+		module.paths = [];
+		// module.parent = undefined by default
+		if(!module.children) module.children = [];
+		Object.defineProperty(module, "loaded", {
+			enumerable: true,
+			get: function() {
+				return module.l;
+			}
+		});
+		Object.defineProperty(module, "id", {
+			enumerable: true,
+			get: function() {
+				return module.i;
+			}
+		});
+		module.webpackPolyfill = 1;
+	}
+	return module;
+};
+
+
+/***/ }),
+/* 55 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.__esModule = true;
+exports.MESSAGES = undefined;
+
+var _stringify = __webpack_require__(32);
+
+var _stringify2 = _interopRequireDefault(_stringify);
+
+exports.get = get;
+exports.parseArgs = parseArgs;
+
+var _util = __webpack_require__(355);
+
+var util = _interopRequireWildcard(_util);
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var MESSAGES = exports.MESSAGES = {
+  tailCallReassignmentDeopt: "Function reference has been reassigned, so it will probably be dereferenced, therefore we can't optimise this with confidence",
+  classesIllegalBareSuper: "Illegal use of bare super",
+  classesIllegalSuperCall: "Direct super call is illegal in non-constructor, use super.$1() instead",
+  scopeDuplicateDeclaration: "Duplicate declaration $1",
+  settersNoRest: "Setters aren't allowed to have a rest",
+  noAssignmentsInForHead: "No assignments allowed in for-in/of head",
+  expectedMemberExpressionOrIdentifier: "Expected type MemberExpression or Identifier",
+  invalidParentForThisNode: "We don't know how to handle this node within the current parent - please open an issue",
+  readOnly: "$1 is read-only",
+  unknownForHead: "Unknown node type $1 in ForStatement",
+  didYouMean: "Did you mean $1?",
+  codeGeneratorDeopt: "Note: The code generator has deoptimised the styling of $1 as it exceeds the max of $2.",
+  missingTemplatesDirectory: "no templates directory - this is most likely the result of a broken `npm publish`. Please report to https://github.com/babel/babel/issues",
+  unsupportedOutputType: "Unsupported output type $1",
+  illegalMethodName: "Illegal method name $1",
+  lostTrackNodePath: "We lost track of this node's position, likely because the AST was directly manipulated",
+
+  modulesIllegalExportName: "Illegal export $1",
+  modulesDuplicateDeclarations: "Duplicate module declarations with the same source but in different scopes",
+
+  undeclaredVariable: "Reference to undeclared variable $1",
+  undeclaredVariableType: "Referencing a type alias outside of a type annotation",
+  undeclaredVariableSuggestion: "Reference to undeclared variable $1 - did you mean $2?",
+
+  traverseNeedsParent: "You must pass a scope and parentPath unless traversing a Program/File. Instead of that you tried to traverse a $1 node without passing scope and parentPath.",
+  traverseVerifyRootFunction: "You passed `traverse()` a function when it expected a visitor object, are you sure you didn't mean `{ enter: Function }`?",
+  traverseVerifyVisitorProperty: "You passed `traverse()` a visitor object with the property $1 that has the invalid property $2",
+  traverseVerifyNodeType: "You gave us a visitor for the node type $1 but it's not a valid type",
+
+  pluginNotObject: "Plugin $2 specified in $1 was expected to return an object when invoked but returned $3",
+  pluginNotFunction: "Plugin $2 specified in $1 was expected to return a function but returned $3",
+  pluginUnknown: "Unknown plugin $1 specified in $2 at $3, attempted to resolve relative to $4",
+  pluginInvalidProperty: "Plugin $2 specified in $1 provided an invalid property of $3"
+};
+
+function get(key) {
+  for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+    args[_key - 1] = arguments[_key];
+  }
+
+  var msg = MESSAGES[key];
+  if (!msg) throw new ReferenceError("Unknown message " + (0, _stringify2.default)(key));
+
+  args = parseArgs(args);
+
+  return msg.replace(/\$(\d+)/g, function (str, i) {
+    return args[i - 1];
+  });
+}
+
+function parseArgs(args) {
+  return args.map(function (val) {
+    if (val != null && val.inspect) {
+      return val.inspect();
+    } else {
+      try {
+        return (0, _stringify2.default)(val) || val + "";
+      } catch (e) {
+        return util.inspect(val);
+      }
+    }
+  });
+}
+
+/***/ }),
+/* 56 */
+/***/ (function(module, exports, __webpack_require__) {
+
+module.exports = { "default": __webpack_require__(188), __esModule: true };
+
+/***/ }),
+/* 57 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.__esModule = true;
+
+var _keys = __webpack_require__(33);
+
+var _keys2 = _interopRequireDefault(_keys);
+
+var _create = __webpack_require__(56);
+
+var _create2 = _interopRequireDefault(_create);
+
+var _map = __webpack_require__(92);
+
+var _map2 = _interopRequireDefault(_map);
+
+var _classCallCheck2 = __webpack_require__(15);
+
+var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
+
+var _getIterator2 = __webpack_require__(1);
+
+var _getIterator3 = _interopRequireDefault(_getIterator2);
+
+var _includes = __webpack_require__(88);
+
+var _includes2 = _interopRequireDefault(_includes);
+
+var _repeat = __webpack_require__(343);
+
+var _repeat2 = _interopRequireDefault(_repeat);
+
+var _renamer = __webpack_require__(168);
+
+var _renamer2 = _interopRequireDefault(_renamer);
+
+var _index = __webpack_require__(27);
+
+var _index2 = _interopRequireDefault(_index);
+
+var _defaults = __webpack_require__(335);
+
+var _defaults2 = _interopRequireDefault(_defaults);
+
+var _babelMessages = __webpack_require__(55);
+
+var messages = _interopRequireWildcard(_babelMessages);
+
+var _binding2 = __webpack_require__(96);
+
+var _binding3 = _interopRequireDefault(_binding2);
+
+var _globals = __webpack_require__(235);
+
+var _globals2 = _interopRequireDefault(_globals);
+
+var _babelTypes = __webpack_require__(0);
+
+var t = _interopRequireWildcard(_babelTypes);
+
+var _cache = __webpack_require__(34);
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var _crawlCallsCount = 0;
+
+function getCache(path, parentScope, self) {
+  var scopes = _cache.scope.get(path.node) || [];
+
+  for (var _iterator = scopes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
+    var _ref;
+
+    if (_isArray) {
+      if (_i >= _iterator.length) break;
+      _ref = _iterator[_i++];
+    } else {
+      _i = _iterator.next();
+      if (_i.done) break;
+      _ref = _i.value;
+    }
+
+    var scope = _ref;
+
+    if (scope.parent === parentScope && scope.path === path) return scope;
+  }
+
+  scopes.push(self);
+
+  if (!_cache.scope.has(path.node)) {
+    _cache.scope.set(path.node, scopes);
+  }
+}
+
+function gatherNodeParts(node, parts) {
+  if (t.isModuleDeclaration(node)) {
+    if (node.source) {
+      gatherNodeParts(node.source, parts);
+    } else if (node.specifiers && node.specifiers.length) {
+      for (var _iterator2 = node.specifiers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
+        var _ref2;
+
+        if (_isArray2) {
+          if (_i2 >= _iterator2.length) break;
+          _ref2 = _iterator2[_i2++];
+        } else {
+          _i2 = _iterator2.next();
+          if (_i2.done) break;
+          _ref2 = _i2.value;
+        }
+
+        var specifier = _ref2;
+
+        gatherNodeParts(specifier, parts);
+      }
+    } else if (node.declaration) {
+      gatherNodeParts(node.declaration, parts);
+    }
+  } else if (t.isModuleSpecifier(node)) {
+    gatherNodeParts(node.local, parts);
+  } else if (t.isMemberExpression(node)) {
+    gatherNodeParts(node.object, parts);
+    gatherNodeParts(node.property, parts);
+  } else if (t.isIdentifier(node)) {
+    parts.push(node.name);
+  } else if (t.isLiteral(node)) {
+    parts.push(node.value);
+  } else if (t.isCallExpression(node)) {
+    gatherNodeParts(node.callee, parts);
+  } else if (t.isObjectExpression(node) || t.isObjectPattern(node)) {
+    for (var _iterator3 = node.properties, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
+      var _ref3;
+
+      if (_isArray3) {
+        if (_i3 >= _iterator3.length) break;
+        _ref3 = _iterator3[_i3++];
+      } else {
+        _i3 = _iterator3.next();
+        if (_i3.done) break;
+        _ref3 = _i3.value;
+      }
+
+      var prop = _ref3;
+
+      gatherNodeParts(prop.key || prop.argument, parts);
+    }
+  }
+}
+
+var collectorVisitor = {
+  For: function For(path) {
+    for (var _iterator4 = t.FOR_INIT_KEYS, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) {
+      var _ref4;
+
+      if (_isArray4) {
+        if (_i4 >= _iterator4.length) break;
+        _ref4 = _iterator4[_i4++];
+      } else {
+        _i4 = _iterator4.next();
+        if (_i4.done) break;
+        _ref4 = _i4.value;
+      }
+
+      var key = _ref4;
+
+      var declar = path.get(key);
+      if (declar.isVar()) path.scope.getFunctionParent().registerBinding("var", declar);
+    }
+  },
+  Declaration: function Declaration(path) {
+    if (path.isBlockScoped()) return;
+
+    if (path.isExportDeclaration() && path.get("declaration").isDeclaration()) return;
+
+    path.scope.getFunctionParent().registerDeclaration(path);
+  },
+  ReferencedIdentifier: function ReferencedIdentifier(path, state) {
+    state.references.push(path);
+  },
+  ForXStatement: function ForXStatement(path, state) {
+    var left = path.get("left");
+    if (left.isPattern() || left.isIdentifier()) {
+      state.constantViolations.push(left);
+    }
+  },
+
+
+  ExportDeclaration: {
+    exit: function exit(path) {
+      var node = path.node,
+          scope = path.scope;
+
+      var declar = node.declaration;
+      if (t.isClassDeclaration(declar) || t.isFunctionDeclaration(declar)) {
+        var _id = declar.id;
+        if (!_id) return;
+
+        var binding = scope.getBinding(_id.name);
+        if (binding) binding.reference(path);
+      } else if (t.isVariableDeclaration(declar)) {
+        for (var _iterator5 = declar.declarations, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) {
+          var _ref5;
+
+          if (_isArray5) {
+            if (_i5 >= _iterator5.length) break;
+            _ref5 = _iterator5[_i5++];
+          } else {
+            _i5 = _iterator5.next();
+            if (_i5.done) break;
+            _ref5 = _i5.value;
+          }
+
+          var decl = _ref5;
+
+          var ids = t.getBindingIdentifiers(decl);
+          for (var name in ids) {
+            var _binding = scope.getBinding(name);
+            if (_binding) _binding.reference(path);
+          }
+        }
+      }
+    }
+  },
+
+  LabeledStatement: function LabeledStatement(path) {
+    path.scope.getProgramParent().addGlobal(path.node);
+    path.scope.getBlockParent().registerDeclaration(path);
+  },
+  AssignmentExpression: function AssignmentExpression(path, state) {
+    state.assignments.push(path);
+  },
+  UpdateExpression: function UpdateExpression(path, state) {
+    state.constantViolations.push(path.get("argument"));
+  },
+  UnaryExpression: function UnaryExpression(path, state) {
+    if (path.node.operator === "delete") {
+      state.constantViolations.push(path.get("argument"));
+    }
+  },
+  BlockScoped: function BlockScoped(path) {
+    var scope = path.scope;
+    if (scope.path === path) scope = scope.parent;
+    scope.getBlockParent().registerDeclaration(path);
+  },
+  ClassDeclaration: function ClassDeclaration(path) {
+    var id = path.node.id;
+    if (!id) return;
+
+    var name = id.name;
+    path.scope.bindings[name] = path.scope.getBinding(name);
+  },
+  Block: function Block(path) {
+    var paths = path.get("body");
+    for (var _iterator6 = paths, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, _getIterator3.default)(_iterator6);;) {
+      var _ref6;
+
+      if (_isArray6) {
+        if (_i6 >= _iterator6.length) break;
+        _ref6 = _iterator6[_i6++];
+      } else {
+        _i6 = _iterator6.next();
+        if (_i6.done) break;
+        _ref6 = _i6.value;
+      }
+
+      var bodyPath = _ref6;
+
+      if (bodyPath.isFunctionDeclaration()) {
+        path.scope.getBlockParent().registerDeclaration(bodyPath);
+      }
+    }
+  }
+};
+
+var uid = 0;
+
+var Scope = function () {
+  function Scope(path, parentScope) {
+    (0, _classCallCheck3.default)(this, Scope);
+
+    if (parentScope && parentScope.block === path.node) {
+      return parentScope;
+    }
+
+    var cached = getCache(path, parentScope, this);
+    if (cached) return cached;
+
+    this.uid = uid++;
+    this.parent = parentScope;
+    this.hub = path.hub;
+
+    this.parentBlock = path.parent;
+    this.block = path.node;
+    this.path = path;
+
+    this.labels = new _map2.default();
+  }
+
+  Scope.prototype.traverse = function traverse(node, opts, state) {
+    (0, _index2.default)(node, opts, this, state, this.path);
+  };
+
+  Scope.prototype.generateDeclaredUidIdentifier = function generateDeclaredUidIdentifier() {
+    var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp";
+
+    var id = this.generateUidIdentifier(name);
+    this.push({ id: id });
+    return id;
+  };
+
+  Scope.prototype.generateUidIdentifier = function generateUidIdentifier() {
+    var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp";
+
+    return t.identifier(this.generateUid(name));
+  };
+
+  Scope.prototype.generateUid = function generateUid() {
+    var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp";
+
+    name = t.toIdentifier(name).replace(/^_+/, "").replace(/[0-9]+$/g, "");
+
+    var uid = void 0;
+    var i = 0;
+    do {
+      uid = this._generateUid(name, i);
+      i++;
+    } while (this.hasLabel(uid) || this.hasBinding(uid) || this.hasGlobal(uid) || this.hasReference(uid));
+
+    var program = this.getProgramParent();
+    program.references[uid] = true;
+    program.uids[uid] = true;
+
+    return uid;
+  };
+
+  Scope.prototype._generateUid = function _generateUid(name, i) {
+    var id = name;
+    if (i > 1) id += i;
+    return "_" + id;
+  };
+
+  Scope.prototype.generateUidIdentifierBasedOnNode = function generateUidIdentifierBasedOnNode(parent, defaultName) {
+    var node = parent;
+
+    if (t.isAssignmentExpression(parent)) {
+      node = parent.left;
+    } else if (t.isVariableDeclarator(parent)) {
+      node = parent.id;
+    } else if (t.isObjectProperty(node) || t.isObjectMethod(node)) {
+      node = node.key;
+    }
+
+    var parts = [];
+    gatherNodeParts(node, parts);
+
+    var id = parts.join("$");
+    id = id.replace(/^_/, "") || defaultName || "ref";
+
+    return this.generateUidIdentifier(id.slice(0, 20));
+  };
+
+  Scope.prototype.isStatic = function isStatic(node) {
+    if (t.isThisExpression(node) || t.isSuper(node)) {
+      return true;
+    }
+
+    if (t.isIdentifier(node)) {
+      var binding = this.getBinding(node.name);
+      if (binding) {
+        return binding.constant;
+      } else {
+        return this.hasBinding(node.name);
+      }
+    }
+
+    return false;
+  };
+
+  Scope.prototype.maybeGenerateMemoised = function maybeGenerateMemoised(node, dontPush) {
+    if (this.isStatic(node)) {
+      return null;
+    } else {
+      var _id2 = this.generateUidIdentifierBasedOnNode(node);
+      if (!dontPush) this.push({ id: _id2 });
+      return _id2;
+    }
+  };
+
+  Scope.prototype.checkBlockScopedCollisions = function checkBlockScopedCollisions(local, kind, name, id) {
+    if (kind === "param") return;
+
+    if (kind === "hoisted" && local.kind === "let") return;
+
+    var duplicate = kind === "let" || local.kind === "let" || local.kind === "const" || local.kind === "module" || local.kind === "param" && (kind === "let" || kind === "const");
+
+    if (duplicate) {
+      throw this.hub.file.buildCodeFrameError(id, messages.get("scopeDuplicateDeclaration", name), TypeError);
+    }
+  };
+
+  Scope.prototype.rename = function rename(oldName, newName, block) {
+    var binding = this.getBinding(oldName);
+    if (binding) {
+      newName = newName || this.generateUidIdentifier(oldName).name;
+      return new _renamer2.default(binding, oldName, newName).rename(block);
+    }
+  };
+
+  Scope.prototype._renameFromMap = function _renameFromMap(map, oldName, newName, value) {
+    if (map[oldName]) {
+      map[newName] = value;
+      map[oldName] = null;
+    }
+  };
+
+  Scope.prototype.dump = function dump() {
+    var sep = (0, _repeat2.default)("-", 60);
+    console.log(sep);
+    var scope = this;
+    do {
+      console.log("#", scope.block.type);
+      for (var name in scope.bindings) {
+        var binding = scope.bindings[name];
+        console.log(" -", name, {
+          constant: binding.constant,
+          references: binding.references,
+          violations: binding.constantViolations.length,
+          kind: binding.kind
+        });
+      }
+    } while (scope = scope.parent);
+    console.log(sep);
+  };
+
+  Scope.prototype.toArray = function toArray(node, i) {
+    var file = this.hub.file;
+
+    if (t.isIdentifier(node)) {
+      var binding = this.getBinding(node.name);
+      if (binding && binding.constant && binding.path.isGenericType("Array")) return node;
+    }
+
+    if (t.isArrayExpression(node)) {
+      return node;
+    }
+
+    if (t.isIdentifier(node, { name: "arguments" })) {
+      return t.callExpression(t.memberExpression(t.memberExpression(t.memberExpression(t.identifier("Array"), t.identifier("prototype")), t.identifier("slice")), t.identifier("call")), [node]);
+    }
+
+    var helperName = "toArray";
+    var args = [node];
+    if (i === true) {
+      helperName = "toConsumableArray";
+    } else if (i) {
+      args.push(t.numericLiteral(i));
+      helperName = "slicedToArray";
+    }
+    return t.callExpression(file.addHelper(helperName), args);
+  };
+
+  Scope.prototype.hasLabel = function hasLabel(name) {
+    return !!this.getLabel(name);
+  };
+
+  Scope.prototype.getLabel = function getLabel(name) {
+    return this.labels.get(name);
+  };
+
+  Scope.prototype.registerLabel = function registerLabel(path) {
+    this.labels.set(path.node.label.name, path);
+  };
+
+  Scope.prototype.registerDeclaration = function registerDeclaration(path) {
+    if (path.isLabeledStatement()) {
+      this.registerLabel(path);
+    } else if (path.isFunctionDeclaration()) {
+      this.registerBinding("hoisted", path.get("id"), path);
+    } else if (path.isVariableDeclaration()) {
+      var declarations = path.get("declarations");
+      for (var _iterator7 = declarations, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, _getIterator3.default)(_iterator7);;) {
+        var _ref7;
+
+        if (_isArray7) {
+          if (_i7 >= _iterator7.length) break;
+          _ref7 = _iterator7[_i7++];
+        } else {
+          _i7 = _iterator7.next();
+          if (_i7.done) break;
+          _ref7 = _i7.value;
+        }
+
+        var declar = _ref7;
+
+        this.registerBinding(path.node.kind, declar);
+      }
+    } else if (path.isClassDeclaration()) {
+      this.registerBinding("let", path);
+    } else if (path.isImportDeclaration()) {
+      var specifiers = path.get("specifiers");
+      for (var _iterator8 = specifiers, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, _getIterator3.default)(_iterator8);;) {
+        var _ref8;
+
+        if (_isArray8) {
+          if (_i8 >= _iterator8.length) break;
+          _ref8 = _iterator8[_i8++];
+        } else {
+          _i8 = _iterator8.next();
+          if (_i8.done) break;
+          _ref8 = _i8.value;
+        }
+
+        var specifier = _ref8;
+
+        this.registerBinding("module", specifier);
+      }
+    } else if (path.isExportDeclaration()) {
+      var _declar = path.get("declaration");
+      if (_declar.isClassDeclaration() || _declar.isFunctionDeclaration() || _declar.isVariableDeclaration()) {
+        this.registerDeclaration(_declar);
+      }
+    } else {
+      this.registerBinding("unknown", path);
+    }
+  };
+
+  Scope.prototype.buildUndefinedNode = function buildUndefinedNode() {
+    if (this.hasBinding("undefined")) {
+      return t.unaryExpression("void", t.numericLiteral(0), true);
+    } else {
+      return t.identifier("undefined");
+    }
+  };
+
+  Scope.prototype.registerConstantViolation = function registerConstantViolation(path) {
+    var ids = path.getBindingIdentifiers();
+    for (var name in ids) {
+      var binding = this.getBinding(name);
+      if (binding) binding.reassign(path);
+    }
+  };
+
+  Scope.prototype.registerBinding = function registerBinding(kind, path) {
+    var bindingPath = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : path;
+
+    if (!kind) throw new ReferenceError("no `kind`");
+
+    if (path.isVariableDeclaration()) {
+      var declarators = path.get("declarations");
+      for (var _iterator9 = declarators, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, _getIterator3.default)(_iterator9);;) {
+        var _ref9;
+
+        if (_isArray9) {
+          if (_i9 >= _iterator9.length) break;
+          _ref9 = _iterator9[_i9++];
+        } else {
+          _i9 = _iterator9.next();
+          if (_i9.done) break;
+          _ref9 = _i9.value;
+        }
+
+        var declar = _ref9;
+
+        this.registerBinding(kind, declar);
+      }
+      return;
+    }
+
+    var parent = this.getProgramParent();
+    var ids = path.getBindingIdentifiers(true);
+
+    for (var name in ids) {
+      for (var _iterator10 = ids[name], _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, _getIterator3.default)(_iterator10);;) {
+        var _ref10;
+
+        if (_isArray10) {
+          if (_i10 >= _iterator10.length) break;
+          _ref10 = _iterator10[_i10++];
+        } else {
+          _i10 = _iterator10.next();
+          if (_i10.done) break;
+          _ref10 = _i10.value;
+        }
+
+        var _id3 = _ref10;
+
+        var local = this.getOwnBinding(name);
+        if (local) {
+          if (local.identifier === _id3) continue;
+
+          this.checkBlockScopedCollisions(local, kind, name, _id3);
+        }
+
+        if (local && local.path.isFlow()) local = null;
+
+        parent.references[name] = true;
+
+        this.bindings[name] = new _binding3.default({
+          identifier: _id3,
+          existing: local,
+          scope: this,
+          path: bindingPath,
+          kind: kind
+        });
+      }
+    }
+  };
+
+  Scope.prototype.addGlobal = function addGlobal(node) {
+    this.globals[node.name] = node;
+  };
+
+  Scope.prototype.hasUid = function hasUid(name) {
+    var scope = this;
+
+    do {
+      if (scope.uids[name]) return true;
+    } while (scope = scope.parent);
+
+    return false;
+  };
+
+  Scope.prototype.hasGlobal = function hasGlobal(name) {
+    var scope = this;
+
+    do {
+      if (scope.globals[name]) return true;
+    } while (scope = scope.parent);
+
+    return false;
+  };
+
+  Scope.prototype.hasReference = function hasReference(name) {
+    var scope = this;
+
+    do {
+      if (scope.references[name]) return true;
+    } while (scope = scope.parent);
+
+    return false;
+  };
+
+  Scope.prototype.isPure = function isPure(node, constantsOnly) {
+    if (t.isIdentifier(node)) {
+      var binding = this.getBinding(node.name);
+      if (!binding) return false;
+      if (constantsOnly) return binding.constant;
+      return true;
+    } else if (t.isClass(node)) {
+      if (node.superClass && !this.isPure(node.superClass, constantsOnly)) return false;
+      return this.isPure(node.body, constantsOnly);
+    } else if (t.isClassBody(node)) {
+      for (var _iterator11 = node.body, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, _getIterator3.default)(_iterator11);;) {
+        var _ref11;
+
+        if (_isArray11) {
+          if (_i11 >= _iterator11.length) break;
+          _ref11 = _iterator11[_i11++];
+        } else {
+          _i11 = _iterator11.next();
+          if (_i11.done) break;
+          _ref11 = _i11.value;
+        }
+
+        var method = _ref11;
+
+        if (!this.isPure(method, constantsOnly)) return false;
+      }
+      return true;
+    } else if (t.isBinary(node)) {
+      return this.isPure(node.left, constantsOnly) && this.isPure(node.right, constantsOnly);
+    } else if (t.isArrayExpression(node)) {
+      for (var _iterator12 = node.elements, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, _getIterator3.default)(_iterator12);;) {
+        var _ref12;
+
+        if (_isArray12) {
+          if (_i12 >= _iterator12.length) break;
+          _ref12 = _iterator12[_i12++];
+        } else {
+          _i12 = _iterator12.next();
+          if (_i12.done) break;
+          _ref12 = _i12.value;
+        }
+
+        var elem = _ref12;
+
+        if (!this.isPure(elem, constantsOnly)) return false;
+      }
+      return true;
+    } else if (t.isObjectExpression(node)) {
+      for (var _iterator13 = node.properties, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : (0, _getIterator3.default)(_iterator13);;) {
+        var _ref13;
+
+        if (_isArray13) {
+          if (_i13 >= _iterator13.length) break;
+          _ref13 = _iterator13[_i13++];
+        } else {
+          _i13 = _iterator13.next();
+          if (_i13.done) break;
+          _ref13 = _i13.value;
+        }
+
+        var prop = _ref13;
+
+        if (!this.isPure(prop, constantsOnly)) return false;
+      }
+      return true;
+    } else if (t.isClassMethod(node)) {
+      if (node.computed && !this.isPure(node.key, constantsOnly)) return false;
+      if (node.kind === "get" || node.kind === "set") return false;
+      return true;
+    } else if (t.isClassProperty(node) || t.isObjectProperty(node)) {
+      if (node.computed && !this.isPure(node.key, constantsOnly)) return false;
+      return this.isPure(node.value, constantsOnly);
+    } else if (t.isUnaryExpression(node)) {
+      return this.isPure(node.argument, constantsOnly);
+    } else {
+      return t.isPureish(node);
+    }
+  };
+
+  Scope.prototype.setData = function setData(key, val) {
+    return this.data[key] = val;
+  };
+
+  Scope.prototype.getData = function getData(key) {
+    var scope = this;
+    do {
+      var data = scope.data[key];
+      if (data != null) return data;
+    } while (scope = scope.parent);
+  };
+
+  Scope.prototype.removeData = function removeData(key) {
+    var scope = this;
+    do {
+      var data = scope.data[key];
+      if (data != null) scope.data[key] = null;
+    } while (scope = scope.parent);
+  };
+
+  Scope.prototype.init = function init() {
+    if (!this.references) this.crawl();
+  };
+
+  Scope.prototype.crawl = function crawl() {
+    _crawlCallsCount++;
+    this._crawl();
+    _crawlCallsCount--;
+  };
+
+  Scope.prototype._crawl = function _crawl() {
+    var path = this.path;
+
+    this.references = (0, _create2.default)(null);
+    this.bindings = (0, _create2.default)(null);
+    this.globals = (0, _create2.default)(null);
+    this.uids = (0, _create2.default)(null);
+    this.data = (0, _create2.default)(null);
+
+    if (path.isLoop()) {
+      for (var _iterator14 = t.FOR_INIT_KEYS, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : (0, _getIterator3.default)(_iterator14);;) {
+        var _ref14;
+
+        if (_isArray14) {
+          if (_i14 >= _iterator14.length) break;
+          _ref14 = _iterator14[_i14++];
+        } else {
+          _i14 = _iterator14.next();
+          if (_i14.done) break;
+          _ref14 = _i14.value;
+        }
+
+        var key = _ref14;
+
+        var node = path.get(key);
+        if (node.isBlockScoped()) this.registerBinding(node.node.kind, node);
+      }
+    }
+
+    if (path.isFunctionExpression() && path.has("id")) {
+      if (!path.get("id").node[t.NOT_LOCAL_BINDING]) {
+        this.registerBinding("local", path.get("id"), path);
+      }
+    }
+
+    if (path.isClassExpression() && path.has("id")) {
+      if (!path.get("id").node[t.NOT_LOCAL_BINDING]) {
+        this.registerBinding("local", path);
+      }
+    }
+
+    if (path.isFunction()) {
+      var params = path.get("params");
+      for (var _iterator15 = params, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : (0, _getIterator3.default)(_iterator15);;) {
+        var _ref15;
+
+        if (_isArray15) {
+          if (_i15 >= _iterator15.length) break;
+          _ref15 = _iterator15[_i15++];
+        } else {
+          _i15 = _iterator15.next();
+          if (_i15.done) break;
+          _ref15 = _i15.value;
+        }
+
+        var param = _ref15;
+
+        this.registerBinding("param", param);
+      }
+    }
+
+    if (path.isCatchClause()) {
+      this.registerBinding("let", path);
+    }
+
+    var parent = this.getProgramParent();
+    if (parent.crawling) return;
+
+    var state = {
+      references: [],
+      constantViolations: [],
+      assignments: []
+    };
+
+    this.crawling = true;
+    path.traverse(collectorVisitor, state);
+    this.crawling = false;
+
+    for (var _iterator16 = state.assignments, _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : (0, _getIterator3.default)(_iterator16);;) {
+      var _ref16;
+
+      if (_isArray16) {
+        if (_i16 >= _iterator16.length) break;
+        _ref16 = _iterator16[_i16++];
+      } else {
+        _i16 = _iterator16.next();
+        if (_i16.done) break;
+        _ref16 = _i16.value;
+      }
+
+      var _path = _ref16;
+
+      var ids = _path.getBindingIdentifiers();
+      var programParent = void 0;
+      for (var name in ids) {
+        if (_path.scope.getBinding(name)) continue;
+
+        programParent = programParent || _path.scope.getProgramParent();
+        programParent.addGlobal(ids[name]);
+      }
+
+      _path.scope.registerConstantViolation(_path);
+    }
+
+    for (var _iterator17 = state.references, _isArray17 = Array.isArray(_iterator17), _i17 = 0, _iterator17 = _isArray17 ? _iterator17 : (0, _getIterator3.default)(_iterator17);;) {
+      var _ref17;
+
+      if (_isArray17) {
+        if (_i17 >= _iterator17.length) break;
+        _ref17 = _iterator17[_i17++];
+      } else {
+        _i17 = _iterator17.next();
+        if (_i17.done) break;
+        _ref17 = _i17.value;
+      }
+
+      var ref = _ref17;
+
+      var binding = ref.scope.getBinding(ref.node.name);
+      if (binding) {
+        binding.reference(ref);
+      } else {
+        ref.scope.getProgramParent().addGlobal(ref.node);
+      }
+    }
+
+    for (var _iterator18 = state.constantViolations, _isArray18 = Array.isArray(_iterator18), _i18 = 0, _iterator18 = _isArray18 ? _iterator18 : (0, _getIterator3.default)(_iterator18);;) {
+      var _ref18;
+
+      if (_isArray18) {
+        if (_i18 >= _iterator18.length) break;
+        _ref18 = _iterator18[_i18++];
+      } else {
+        _i18 = _iterator18.next();
+        if (_i18.done) break;
+        _ref18 = _i18.value;
+      }
+
+      var _path2 = _ref18;
+
+      _path2.scope.registerConstantViolation(_path2);
+    }
+  };
+
+  Scope.prototype.push = function push(opts) {
+    var path = this.path;
+
+    if (!path.isBlockStatement() && !path.isProgram()) {
+      path = this.getBlockParent().path;
+    }
+
+    if (path.isSwitchStatement()) {
+      path = this.getFunctionParent().path;
+    }
+
+    if (path.isLoop() || path.isCatchClause() || path.isFunction()) {
+      t.ensureBlock(path.node);
+      path = path.get("body");
+    }
+
+    var unique = opts.unique;
+    var kind = opts.kind || "var";
+    var blockHoist = opts._blockHoist == null ? 2 : opts._blockHoist;
+
+    var dataKey = "declaration:" + kind + ":" + blockHoist;
+    var declarPath = !unique && path.getData(dataKey);
+
+    if (!declarPath) {
+      var declar = t.variableDeclaration(kind, []);
+      declar._generated = true;
+      declar._blockHoist = blockHoist;
+
+      var _path$unshiftContaine = path.unshiftContainer("body", [declar]);
+
+      declarPath = _path$unshiftContaine[0];
+
+      if (!unique) path.setData(dataKey, declarPath);
+    }
+
+    var declarator = t.variableDeclarator(opts.id, opts.init);
+    declarPath.node.declarations.push(declarator);
+    this.registerBinding(kind, declarPath.get("declarations").pop());
+  };
+
+  Scope.prototype.getProgramParent = function getProgramParent() {
+    var scope = this;
+    do {
+      if (scope.path.isProgram()) {
+        return scope;
+      }
+    } while (scope = scope.parent);
+    throw new Error("We couldn't find a Function or Program...");
+  };
+
+  Scope.prototype.getFunctionParent = function getFunctionParent() {
+    var scope = this;
+    do {
+      if (scope.path.isFunctionParent()) {
+        return scope;
+      }
+    } while (scope = scope.parent);
+    throw new Error("We couldn't find a Function or Program...");
+  };
+
+  Scope.prototype.getBlockParent = function getBlockParent() {
+    var scope = this;
+    do {
+      if (scope.path.isBlockParent()) {
+        return scope;
+      }
+    } while (scope = scope.parent);
+    throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...");
+  };
+
+  Scope.prototype.getAllBindings = function getAllBindings() {
+    var ids = (0, _create2.default)(null);
+
+    var scope = this;
+    do {
+      (0, _defaults2.default)(ids, scope.bindings);
+      scope = scope.parent;
+    } while (scope);
+
+    return ids;
+  };
+
+  Scope.prototype.getAllBindingsOfKind = function getAllBindingsOfKind() {
+    var ids = (0, _create2.default)(null);
+
+    for (var _iterator19 = arguments, _isArray19 = Array.isArray(_iterator19), _i19 = 0, _iterator19 = _isArray19 ? _iterator19 : (0, _getIterator3.default)(_iterator19);;) {
+      var _ref19;
+
+      if (_isArray19) {
+        if (_i19 >= _iterator19.length) break;
+        _ref19 = _iterator19[_i19++];
+      } else {
+        _i19 = _iterator19.next();
+        if (_i19.done) break;
+        _ref19 = _i19.value;
+      }
+
+      var kind = _ref19;
+
+      var scope = this;
+      do {
+        for (var name in scope.bindings) {
+          var binding = scope.bindings[name];
+          if (binding.kind === kind) ids[name] = binding;
+        }
+        scope = scope.parent;
+      } while (scope);
+    }
+
+    return ids;
+  };
+
+  Scope.prototype.bindingIdentifierEquals = function bindingIdentifierEquals(name, node) {
+    return this.getBindingIdentifier(name) === node;
+  };
+
+  Scope.prototype.warnOnFlowBinding = function warnOnFlowBinding(binding) {
+    if (_crawlCallsCount === 0 && binding && binding.path.isFlow()) {
+      console.warn("\n        You or one of the Babel plugins you are using are using Flow declarations as bindings.\n        Support for this will be removed in version 6.8. To find out the caller, grep for this\n        message and change it to a `console.trace()`.\n      ");
+    }
+    return binding;
+  };
+
+  Scope.prototype.getBinding = function getBinding(name) {
+    var scope = this;
+
+    do {
+      var binding = scope.getOwnBinding(name);
+      if (binding) return this.warnOnFlowBinding(binding);
+    } while (scope = scope.parent);
+  };
+
+  Scope.prototype.getOwnBinding = function getOwnBinding(name) {
+    return this.warnOnFlowBinding(this.bindings[name]);
+  };
+
+  Scope.prototype.getBindingIdentifier = function getBindingIdentifier(name) {
+    var info = this.getBinding(name);
+    return info && info.identifier;
+  };
+
+  Scope.prototype.getOwnBindingIdentifier = function getOwnBindingIdentifier(name) {
+    var binding = this.bindings[name];
+    return binding && binding.identifier;
+  };
+
+  Scope.prototype.hasOwnBinding = function hasOwnBinding(name) {
+    return !!this.getOwnBinding(name);
+  };
+
+  Scope.prototype.hasBinding = function hasBinding(name, noGlobals) {
+    if (!name) return false;
+    if (this.hasOwnBinding(name)) return true;
+    if (this.parentHasBinding(name, noGlobals)) return true;
+    if (this.hasUid(name)) return true;
+    if (!noGlobals && (0, _includes2.default)(Scope.globals, name)) return true;
+    if (!noGlobals && (0, _includes2.default)(Scope.contextVariables, name)) return true;
+    return false;
+  };
+
+  Scope.prototype.parentHasBinding = function parentHasBinding(name, noGlobals) {
+    return this.parent && this.parent.hasBinding(name, noGlobals);
+  };
+
+  Scope.prototype.moveBindingTo = function moveBindingTo(name, scope) {
+    var info = this.getBinding(name);
+    if (info) {
+      info.scope.removeOwnBinding(name);
+      info.scope = scope;
+      scope.bindings[name] = info;
+    }
+  };
+
+  Scope.prototype.removeOwnBinding = function removeOwnBinding(name) {
+    delete this.bindings[name];
+  };
+
+  Scope.prototype.removeBinding = function removeBinding(name) {
+    var info = this.getBinding(name);
+    if (info) {
+      info.scope.removeOwnBinding(name);
+    }
+
+    var scope = this;
+    do {
+      if (scope.uids[name]) {
+        scope.uids[name] = false;
+      }
+    } while (scope = scope.parent);
+  };
+
+  return Scope;
+}();
+
+Scope.globals = (0, _keys2.default)(_globals2.default.builtin);
+Scope.contextVariables = ["arguments", "undefined", "Infinity", "NaN"];
+exports.default = Scope;
+module.exports = exports["default"];
+
+/***/ }),
+/* 58 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.__esModule = true;
+exports.NOT_LOCAL_BINDING = exports.BLOCK_SCOPED_SYMBOL = exports.INHERIT_KEYS = exports.UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = exports.BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = exports.UPDATE_OPERATORS = exports.LOGICAL_OPERATORS = exports.COMMENT_KE [...]
+
+var _for = __webpack_require__(149);
+
+var _for2 = _interopRequireDefault(_for);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var STATEMENT_OR_BLOCK_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = ["consequent", "body", "alternate"];
+var FLATTENABLE_KEYS = exports.FLATTENABLE_KEYS = ["body", "expressions"];
+var FOR_INIT_KEYS = exports.FOR_INIT_KEYS = ["left", "init"];
+var COMMENT_KEYS = exports.COMMENT_KEYS = ["leadingComments", "trailingComments", "innerComments"];
+
+var LOGICAL_OPERATORS = exports.LOGICAL_OPERATORS = ["||", "&&"];
+var UPDATE_OPERATORS = exports.UPDATE_OPERATORS = ["++", "--"];
+
+var BOOLEAN_NUMBER_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = [">", "<", ">=", "<="];
+var EQUALITY_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = ["==", "===", "!=", "!=="];
+var COMPARISON_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = [].concat(EQUALITY_BINARY_OPERATORS, ["in", "instanceof"]);
+var BOOLEAN_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = [].concat(COMPARISON_BINARY_OPERATORS, BOOLEAN_NUMBER_BINARY_OPERATORS);
+var NUMBER_BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = ["-", "/", "%", "*", "**", "&", "|", ">>", ">>>", "<<", "^"];
+var BINARY_OPERATORS = exports.BINARY_OPERATORS = ["+"].concat(NUMBER_BINARY_OPERATORS, BOOLEAN_BINARY_OPERATORS);
+
+var BOOLEAN_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = ["delete", "!"];
+var NUMBER_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = ["+", "-", "++", "--", "~"];
+var STRING_UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = ["typeof"];
+var UNARY_OPERATORS = exports.UNARY_OPERATORS = ["void"].concat(BOOLEAN_UNARY_OPERATORS, NUMBER_UNARY_OPERATORS, STRING_UNARY_OPERATORS);
+
+var INHERIT_KEYS = exports.INHERIT_KEYS = {
+  optional: ["typeAnnotation", "typeParameters", "returnType"],
+  force: ["start", "loc", "end"]
+};
+
+var BLOCK_SCOPED_SYMBOL = exports.BLOCK_SCOPED_SYMBOL = (0, _for2.default)("var used to be block scoped");
+var NOT_LOCAL_BINDING = exports.NOT_LOCAL_BINDING = (0, _for2.default)("should not be considered a local binding");
+
+/***/ }),
+/* 59 */
+/***/ (function(module, exports) {
+
+module.exports = function(it, Constructor, name, forbiddenField){
+  if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){
+    throw TypeError(name + ': incorrect invocation!');
+  } return it;
+};
+
+/***/ }),
+/* 60 */
+/***/ (function(module, exports, __webpack_require__) {
+
+// 0 -> Array#forEach
+// 1 -> Array#map
+// 2 -> Array#filter
+// 3 -> Array#some
+// 4 -> Array#every
+// 5 -> Array#find
+// 6 -> Array#findIndex
+var ctx      = __webpack_require__(35)
+  , IObject  = __webpack_require__(63)
+  , toObject = __webpack_require__(42)
+  , toLength = __webpack_require__(72)
+  , asc      = __webpack_require__(200);
+module.exports = function(TYPE, $create){
+  var IS_MAP        = TYPE == 1
+    , IS_FILTER     = TYPE == 2
+    , IS_SOME       = TYPE == 3
+    , IS_EVERY      = TYPE == 4
+    , IS_FIND_INDEX = TYPE == 6
+    , NO_HOLES      = TYPE == 5 || IS_FIND_INDEX
+    , create        = $create || asc;
+  return function($this, callbackfn, that){
+    var O      = toObject($this)
+      , self   = IObject(O)
+      , f      = ctx(callbackfn, that, 3)
+      , length = toLength(self.length)
+      , index  = 0
+      , result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined
+      , val, res;
+    for(;length > index; index++)if(NO_HOLES || index in self){
+      val = self[index];
+      res = f(val, index, O);
+      if(TYPE){
+        if(IS_MAP)result[index] = res;            // map
+        else if(res)switch(TYPE){
+          case 3: return true;                    // some
+          case 5: return val;                     // find
+          case 6: return index;                   // findIndex
+          case 2: result.push(val);               // filter
+        } else if(IS_EVERY)return false;          // every
+      }
+    }
+    return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
+  };
+};
+
+/***/ }),
+/* 61 */
+/***/ (function(module, exports) {
+
+var toString = {}.toString;
+
+module.exports = function(it){
+  return toString.call(it).slice(8, -1);
+};
+
+/***/ }),
+/* 62 */
+/***/ (function(module, exports) {
+
+// IE 8- don't enum bug keys
+module.exports = (
+  'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
+).split(',');
+
+/***/ }),
+/* 63 */
+/***/ (function(module, exports, __webpack_require__) {
+
+// fallback for non-array-like ES3 and non-enumerable old V8 strings
+var cof = __webpack_require__(61);
+module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){
+  return cof(it) == 'String' ? it.split('') : Object(it);
+};
+
+/***/ }),
+/* 64 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+var LIBRARY        = __webpack_require__(65)
+  , $export        = __webpack_require__(17)
+  , redefine       = __webpack_require__(68)
+  , hide           = __webpack_require__(11)
+  , has            = __webpack_require__(10)
+  , Iterators      = __webpack_require__(28)
+  , $iterCreate    = __webpack_require__(208)
+  , setToStringTag = __webpack_require__(41)
+  , getPrototypeOf = __webpack_require__(214)
+  , ITERATOR       = __webpack_require__(3)('iterator')
+  , BUGGY          = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next`
+  , FF_ITERATOR    = '@@iterator'
+  , KEYS           = 'keys'
+  , VALUES         = 'values';
+
+var returnThis = function(){ return this; };
+
+module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){
+  $iterCreate(Constructor, NAME, next);
+  var getMethod = function(kind){
+    if(!BUGGY && kind in proto)return proto[kind];
+    switch(kind){
+      case KEYS: return function keys(){ return new Constructor(this, kind); };
+      case VALUES: return function values(){ return new Constructor(this, kind); };
+    } return function entries(){ return new Constructor(this, kind); };
+  };
+  var TAG        = NAME + ' Iterator'
+    , DEF_VALUES = DEFAULT == VALUES
+    , VALUES_BUG = false
+    , proto      = Base.prototype
+    , $native    = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]
+    , $default   = $native || getMethod(DEFAULT)
+    , $entries   = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined
+    , $anyNative = NAME == 'Array' ? proto.entries || $native : $native
+    , methods, key, IteratorPrototype;
+  // Fix native
+  if($anyNative){
+    IteratorPrototype = getPrototypeOf($anyNative.call(new Base));
+    if(IteratorPrototype !== Object.prototype){
+      // Set @@toStringTag to native iterators
+      setToStringTag(IteratorPrototype, TAG, true);
+      // fix for some old engines
+      if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis);
+    }
+  }
+  // fix Array#{values, @@iterator}.name in V8 / FF
+  if(DEF_VALUES && $native && $native.name !== VALUES){
+    VALUES_BUG = true;
+    $default = function values(){ return $native.call(this); };
+  }
+  // Define iterator
+  if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){
+    hide(proto, ITERATOR, $default);
+  }
+  // Plug for library
+  Iterators[NAME] = $default;
+  Iterators[TAG]  = returnThis;
+  if(DEFAULT){
+    methods = {
+      values:  DEF_VALUES ? $default : getMethod(VALUES),
+      keys:    IS_SET     ? $default : getMethod(KEYS),
+      entries: $entries
+    };
+    if(FORCED)for(key in methods){
+      if(!(key in proto))redefine(proto, key, methods[key]);
+    } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
+  }
+  return methods;
+};
+
+/***/ }),
+/* 65 */
+/***/ (function(module, exports) {
+
+module.exports = true;
+
+/***/ }),
+/* 66 */
+/***/ (function(module, exports) {
+
+exports.f = Object.getOwnPropertySymbols;
+
+/***/ }),
+/* 67 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var hide = __webpack_require__(11);
+module.exports = function(target, src, safe){
+  for(var key in src){
+    if(safe && target[key])target[key] = src[key];
+    else hide(target, key, src[key]);
+  } return target;
+};
+
+/***/ }),
+/* 68 */
+/***/ (function(module, exports, __webpack_require__) {
+
+module.exports = __webpack_require__(11);
+
+/***/ }),
+/* 69 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var shared = __webpack_require__(70)('keys')
+  , uid    = __webpack_require__(43);
+module.exports = function(key){
+  return shared[key] || (shared[key] = uid(key));
+};
+
+/***/ }),
+/* 70 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var global = __webpack_require__(4)
+  , SHARED = '__core-js_shared__'
+  , store  = global[SHARED] || (global[SHARED] = {});
+module.exports = function(key){
+  return store[key] || (store[key] = {});
+};
+
+/***/ }),
+/* 71 */
+/***/ (function(module, exports) {
+
+// 7.1.4 ToInteger
+var ceil  = Math.ceil
+  , floor = Math.floor;
+module.exports = function(it){
+  return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
+};
+
+/***/ }),
+/* 72 */
+/***/ (function(module, exports, __webpack_require__) {
+
+// 7.1.15 ToLength
+var toInteger = __webpack_require__(71)
+  , min       = Math.min;
+module.exports = function(it){
+  return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
+};
+
+/***/ }),
+/* 73 */
+/***/ (function(module, exports, __webpack_require__) {
+
+// 7.1.1 ToPrimitive(input [, PreferredType])
+var isObject = __webpack_require__(12);
+// instead of the ES6 spec version, we didn't implement @@toPrimitive case
+// and the second argument - flag - preferred type is a string
+module.exports = function(it, S){
+  if(!isObject(it))return it;
+  var fn, val;
+  if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
+  if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;
+  if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
+  throw TypeError("Can't convert object to primitive value");
+};
+
+/***/ }),
+/* 74 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var global         = __webpack_require__(4)
+  , core           = __webpack_require__(2)
+  , LIBRARY        = __webpack_require__(65)
+  , wksExt         = __webpack_require__(75)
+  , defineProperty = __webpack_require__(7).f;
+module.exports = function(name){
+  var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
+  if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)});
+};
+
+/***/ }),
+/* 75 */
+/***/ (function(module, exports, __webpack_require__) {
+
+exports.f = __webpack_require__(3);
+
+/***/ }),
+/* 76 */
+/***/ (function(module, exports) {
+
+
+
+/***/ }),
+/* 77 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+var $at  = __webpack_require__(217)(true);
+
+// 21.1.3.27 String.prototype[@@iterator]()
+__webpack_require__(64)(String, 'String', function(iterated){
+  this._t = String(iterated); // target
+  this._i = 0;                // next index
+// 21.1.5.2.1 %StringIteratorPrototype%.next()
+}, function(){
+  var O     = this._t
+    , index = this._i
+    , point;
+  if(index >= O.length)return {value: undefined, done: true};
+  point = $at(O, index);
+  this._i += point.length;
+  return {value: point, done: false};
+});
+
+/***/ }),
+/* 78 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+// ECMAScript 6 symbols shim
+var global         = __webpack_require__(4)
+  , has            = __webpack_require__(10)
+  , DESCRIPTORS    = __webpack_require__(6)
+  , $export        = __webpack_require__(17)
+  , redefine       = __webpack_require__(68)
+  , META           = __webpack_require__(29).KEY
+  , $fails         = __webpack_require__(18)
+  , shared         = __webpack_require__(70)
+  , setToStringTag = __webpack_require__(41)
+  , uid            = __webpack_require__(43)
+  , wks            = __webpack_require__(3)
+  , wksExt         = __webpack_require__(75)
+  , wksDefine      = __webpack_require__(74)
+  , keyOf          = __webpack_require__(209)
+  , enumKeys       = __webpack_require__(204)
+  , isArray        = __webpack_require__(103)
+  , anObject       = __webpack_require__(9)
+  , toIObject      = __webpack_require__(19)
+  , toPrimitive    = __webpack_require__(73)
+  , createDesc     = __webpack_require__(40)
+  , _create        = __webpack_require__(38)
+  , gOPNExt        = __webpack_require__(213)
+  , $GOPD          = __webpack_require__(212)
+  , $DP            = __webpack_require__(7)
+  , $keys          = __webpack_require__(23)
+  , gOPD           = $GOPD.f
+  , dP             = $DP.f
+  , gOPN           = gOPNExt.f
+  , $Symbol        = global.Symbol
+  , $JSON          = global.JSON
+  , _stringify     = $JSON && $JSON.stringify
+  , PROTOTYPE      = 'prototype'
+  , HIDDEN         = wks('_hidden')
+  , TO_PRIMITIVE   = wks('toPrimitive')
+  , isEnum         = {}.propertyIsEnumerable
+  , SymbolRegistry = shared('symbol-registry')
+  , AllSymbols     = shared('symbols')
+  , OPSymbols      = shared('op-symbols')
+  , ObjectProto    = Object[PROTOTYPE]
+  , USE_NATIVE     = typeof $Symbol == 'function'
+  , QObject        = global.QObject;
+// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
+var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
+
+// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
+var setSymbolDesc = DESCRIPTORS && $fails(function(){
+  return _create(dP({}, 'a', {
+    get: function(){ return dP(this, 'a', {value: 7}).a; }
+  })).a != 7;
+}) ? function(it, key, D){
+  var protoDesc = gOPD(ObjectProto, key);
+  if(protoDesc)delete ObjectProto[key];
+  dP(it, key, D);
+  if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc);
+} : dP;
+
+var wrap = function(tag){
+  var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
+  sym._k = tag;
+  return sym;
+};
+
+var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){
+  return typeof it == 'symbol';
+} : function(it){
+  return it instanceof $Symbol;
+};
+
+var $defineProperty = function defineProperty(it, key, D){
+  if(it === ObjectProto)$defineProperty(OPSymbols, key, D);
+  anObject(it);
+  key = toPrimitive(key, true);
+  anObject(D);
+  if(has(AllSymbols, key)){
+    if(!D.enumerable){
+      if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {}));
+      it[HIDDEN][key] = true;
+    } else {
+      if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false;
+      D = _create(D, {enumerable: createDesc(0, false)});
+    } return setSymbolDesc(it, key, D);
+  } return dP(it, key, D);
+};
+var $defineProperties = function defineProperties(it, P){
+  anObject(it);
+  var keys = enumKeys(P = toIObject(P))
+    , i    = 0
+    , l = keys.length
+    , key;
+  while(l > i)$defineProperty(it, key = keys[i++], P[key]);
+  return it;
+};
+var $create = function create(it, P){
+  return P === undefined ? _create(it) : $defineProperties(_create(it), P);
+};
+var $propertyIsEnumerable = function propertyIsEnumerable(key){
+  var E = isEnum.call(this, key = toPrimitive(key, true));
+  if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false;
+  return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
+};
+var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){
+  it  = toIObject(it);
+  key = toPrimitive(key, true);
+  if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return;
+  var D = gOPD(it, key);
+  if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true;
+  return D;
+};
+var $getOwnPropertyNames = function getOwnPropertyNames(it){
+  var names  = gOPN(toIObject(it))
+    , result = []
+    , i      = 0
+    , key;
+  while(names.length > i){
+    if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key);
+  } return result;
+};
+var $getOwnPropertySymbols = function getOwnPropertySymbols(it){
+  var IS_OP  = it === ObjectProto
+    , names  = gOPN(IS_OP ? OPSymbols : toIObject(it))
+    , result = []
+    , i      = 0
+    , key;
+  while(names.length > i){
+    if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]);
+  } return result;
+};
+
+// 19.4.1.1 Symbol([description])
+if(!USE_NATIVE){
+  $Symbol = function Symbol(){
+    if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!');
+    var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
+    var $set = function(value){
+      if(this === ObjectProto)$set.call(OPSymbols, value);
+      if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false;
+      setSymbolDesc(this, tag, createDesc(1, value));
+    };
+    if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set});
+    return wrap(tag);
+  };
+  redefine($Symbol[PROTOTYPE], 'toString', function toString(){
+    return this._k;
+  });
+
+  $GOPD.f = $getOwnPropertyDescriptor;
+  $DP.f   = $defineProperty;
+  __webpack_require__(105).f = gOPNExt.f = $getOwnPropertyNames;
+  __webpack_require__(39).f  = $propertyIsEnumerable;
+  __webpack_require__(66).f = $getOwnPropertySymbols;
+
+  if(DESCRIPTORS && !__webpack_require__(65)){
+    redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
+  }
+
+  wksExt.f = function(name){
+    return wrap(wks(name));
+  }
+}
+
+$export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol});
+
+for(var symbols = (
+  // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
+  'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
+).split(','), i = 0; symbols.length > i; )wks(symbols[i++]);
+
+for(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]);
+
+$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
+  // 19.4.2.1 Symbol.for(key)
+  'for': function(key){
+    return has(SymbolRegistry, key += '')
+      ? SymbolRegistry[key]
+      : SymbolRegistry[key] = $Symbol(key);
+  },
+  // 19.4.2.5 Symbol.keyFor(sym)
+  keyFor: function keyFor(key){
+    if(isSymbol(key))return keyOf(SymbolRegistry, key);
+    throw TypeError(key + ' is not a symbol!');
+  },
+  useSetter: function(){ setter = true; },
+  useSimple: function(){ setter = false; }
+});
+
+$export($export.S + $export.F * !USE_NATIVE, 'Object', {
+  // 19.1.2.2 Object.create(O [, Properties])
+  create: $create,
+  // 19.1.2.4 Object.defineProperty(O, P, Attributes)
+  defineProperty: $defineProperty,
+  // 19.1.2.3 Object.defineProperties(O, Properties)
+  defineProperties: $defineProperties,
+  // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
+  getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
+  // 19.1.2.7 Object.getOwnPropertyNames(O)
+  getOwnPropertyNames: $getOwnPropertyNames,
+  // 19.1.2.8 Object.getOwnPropertySymbols(O)
+  getOwnPropertySymbols: $getOwnPropertySymbols
+});
+
+// 24.3.2 JSON.stringify(value [, replacer [, space]])
+$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){
+  var S = $Symbol();
+  // MS Edge converts symbol values to JSON as {}
+  // WebKit converts symbol values to JSON as null
+  // V8 throws on boxed symbols
+  return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}';
+})), 'JSON', {
+  stringify: function stringify(it){
+    if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined
+    var args = [it]
+      , i    = 1
+      , replacer, $replacer;
+    while(arguments.length > i)args.push(arguments[i++]);
+    replacer = args[1];
+    if(typeof replacer == 'function')$replacer = replacer;
+    if($replacer || !isArray(replacer))replacer = function(key, value){
+      if($replacer)value = $replacer.call(this, key, value);
+      if(!isSymbol(value))return value;
+    };
+    args[1] = replacer;
+    return _stringify.apply($JSON, args);
+  }
+});
+
+// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
+$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(11)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
+// 19.4.3.5 Symbol.prototype[@@toStringTag]
+setToStringTag($Symbol, 'Symbol');
+// 20.2.1.9 Math[@@toStringTag]
+setToStringTag(Math, 'Math', true);
+// 24.3.3 JSON[@@toStringTag]
+setToStringTag(global.JSON, 'JSON', true);
+
+/***/ }),
+/* 79 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/*
+  Copyright (C) 2013 Yusuke Suzuki <ut...@gmail.com>
+
+  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 <COPYRIGHT HOLDER> 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.
+*/
+
+
+(function () {
+    'use strict';
+
+    exports.ast = __webpack_require__(232);
+    exports.code = __webpack_require__(108);
+    exports.keyword = __webpack_require__(233);
+}());
+/* vim: set sw=4 ts=4 et tw=80 : */
+
+
+/***/ }),
+/* 80 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var getNative = __webpack_require__(20),
+    root = __webpack_require__(5);
+
+/* Built-in method references that are verified to be native. */
+var Map = getNative(root, 'Map');
+
+module.exports = Map;
+
+
+/***/ }),
+/* 81 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var mapCacheClear = __webpack_require__(309),
+    mapCacheDelete = __webpack_require__(310),
+    mapCacheGet = __webpack_require__(311),
+    mapCacheHas = __webpack_require__(312),
+    mapCacheSet = __webpack_require__(313);
+
+/**
+ * Creates a map cache object to store key-value pairs.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [entries] The key-value pairs to cache.
+ */
+function MapCache(entries) {
+  var index = -1,
+      length = entries == null ? 0 : entries.length;
+
+  this.clear();
+  while (++index < length) {
+    var entry = entries[index];
+    this.set(entry[0], entry[1]);
+  }
+}
+
+// Add methods to `MapCache`.
+MapCache.prototype.clear = mapCacheClear;
+MapCache.prototype['delete'] = mapCacheDelete;
+MapCache.prototype.get = mapCacheGet;
+MapCache.prototype.has = mapCacheHas;
+MapCache.prototype.set = mapCacheSet;
+
+module.exports = MapCache;
+
+
+/***/ }),
+/* 82 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseAssignValue = __webpack_require__(115),
+    eq = __webpack_require__(51);
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Assigns `value` to `key` of `object` if the existing value is not equivalent
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
+ * for equality comparisons.
+ *
+ * @private
+ * @param {Object} object The object to modify.
+ * @param {string} key The key of the property to assign.
+ * @param {*} value The value to assign.
+ */
+function assignValue(object, key, value) {
+  var objValue = object[key];
+  if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
+      (value === undefined && !(key in object))) {
+    baseAssignValue(object, key, value);
+  }
+}
+
+module.exports = assignValue;
+
+
+/***/ }),
+/* 83 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var Uint8Array = __webpack_require__(246);
+
+/**
+ * Creates a clone of `arrayBuffer`.
+ *
+ * @private
+ * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
+ * @returns {ArrayBuffer} Returns the cloned array buffer.
+ */
+function cloneArrayBuffer(arrayBuffer) {
+  var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
+  new Uint8Array(result).set(new Uint8Array(arrayBuffer));
+  return result;
+}
+
+module.exports = cloneArrayBuffer;
+
+
+/***/ }),
+/* 84 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var overArg = __webpack_require__(127);
+
+/** Built-in value references. */
+var getPrototype = overArg(Object.getPrototypeOf, Object);
+
+module.exports = getPrototype;
+
+
+/***/ }),
+/* 85 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var arrayFilter = __webpack_require__(251),
+    stubArray = __webpack_require__(135);
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/** Built-in value references. */
+var propertyIsEnumerable = objectProto.propertyIsEnumerable;
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeGetSymbols = Object.getOwnPropertySymbols;
+
+/**
+ * Creates an array of the own enumerable symbols of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of symbols.
+ */
+var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
+  if (object == null) {
+    return [];
+  }
+  object = Object(object);
+  return arrayFilter(nativeGetSymbols(object), function(symbol) {
+    return propertyIsEnumerable.call(object, symbol);
+  });
+};
+
+module.exports = getSymbols;
+
+
+/***/ }),
+/* 86 */
+/***/ (function(module, exports) {
+
+/** Used as references for various `Number` constants. */
+var MAX_SAFE_INTEGER = 9007199254740991;
+
+/** Used to detect unsigned integer values. */
+var reIsUint = /^(?:0|[1-9]\d*)$/;
+
+/**
+ * Checks if `value` is a valid array-like index.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
+ */
+function isIndex(value, length) {
+  length = length == null ? MAX_SAFE_INTEGER : length;
+  return !!length &&
+    (typeof value == 'number' || reIsUint.test(value)) &&
+    (value > -1 && value % 1 == 0 && value < length);
+}
+
+module.exports = isIndex;
+
+
+/***/ }),
+/* 87 */
+/***/ (function(module, exports) {
+
+/**
+ * Converts `set` to an array of its values.
+ *
+ * @private
+ * @param {Object} set The set to convert.
+ * @returns {Array} Returns the values.
+ */
+function setToArray(set) {
+  var index = -1,
+      result = Array(set.size);
+
+  set.forEach(function(value) {
+    result[++index] = value;
+  });
+  return result;
+}
+
+module.exports = setToArray;
+
+
+/***/ }),
+/* 88 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseIndexOf = __webpack_require__(118),
+    isArrayLike = __webpack_require__(30),
+    isString = __webpack_require__(339),
+    toInteger = __webpack_require__(136),
+    values = __webpack_require__(348);
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Checks if `value` is in `collection`. If `collection` is a string, it's
+ * checked for a substring of `value`, otherwise
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
+ * is used for equality comparisons. If `fromIndex` is negative, it's used as
+ * the offset from the end of `collection`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to inspect.
+ * @param {*} value The value to search for.
+ * @param {number} [fromIndex=0] The index to search from.
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
+ * @returns {boolean} Returns `true` if `value` is found, else `false`.
+ * @example
+ *
+ * _.includes([1, 2, 3], 1);
+ * // => true
+ *
+ * _.includes([1, 2, 3], 1, 2);
+ * // => false
+ *
+ * _.includes({ 'a': 1, 'b': 2 }, 1);
+ * // => true
+ *
+ * _.includes('abcd', 'bc');
+ * // => true
+ */
+function includes(collection, value, fromIndex, guard) {
+  collection = isArrayLike(collection) ? collection : values(collection);
+  fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
+
+  var length = collection.length;
+  if (fromIndex < 0) {
+    fromIndex = nativeMax(length + fromIndex, 0);
+  }
+  return isString(collection)
+    ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
+    : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
+}
+
+module.exports = includes;
+
+
+/***/ }),
+/* 89 */
+/***/ (function(module, exports) {
+
+/** Used as references for various `Number` constants. */
+var MAX_SAFE_INTEGER = 9007199254740991;
+
+/**
+ * Checks if `value` is a valid array-like length.
+ *
+ * **Note:** This method is loosely based on
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
+ * @example
+ *
+ * _.isLength(3);
+ * // => true
+ *
+ * _.isLength(Number.MIN_VALUE);
+ * // => false
+ *
+ * _.isLength(Infinity);
+ * // => false
+ *
+ * _.isLength('3');
+ * // => false
+ */
+function isLength(value) {
+  return typeof value == 'number' &&
+    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
+}
+
+module.exports = isLength;
+
+
+/***/ }),
+/* 90 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var arrayLikeKeys = __webpack_require__(111),
+    baseKeysIn = __webpack_require__(265),
+    isArrayLike = __webpack_require__(30);
+
+/**
+ * Creates an array of the own and inherited enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ *   this.a = 1;
+ *   this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keysIn(new Foo);
+ * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
+ */
+function keysIn(object) {
+  return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
+}
+
+module.exports = keysIn;
+
+
+/***/ }),
+/* 91 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+module.exports = function () {
+	return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g;
+};
+
+
+/***/ }),
+/* 92 */
+/***/ (function(module, exports, __webpack_require__) {
+
+module.exports = { "default": __webpack_require__(186), __esModule: true };
+
+/***/ }),
+/* 93 */
+/***/ (function(module, exports, __webpack_require__) {
+
+module.exports = { "default": __webpack_require__(192), __esModule: true };
+
+/***/ }),
+/* 94 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.__esModule = true;
+
+var _classCallCheck2 = __webpack_require__(15);
+
+var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var Hub = function Hub(file, options) {
+  (0, _classCallCheck3.default)(this, Hub);
+
+  this.file = file;
+  this.options = options;
+};
+
+exports.default = Hub;
+module.exports = exports["default"];
+
+/***/ }),
+/* 95 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.__esModule = true;
+exports.Flow = exports.Pure = exports.Generated = exports.User = exports.Var = exports.BlockScoped = exports.Referenced = exports.Scope = exports.Expression = exports.Statement = exports.BindingIdentifier = exports.ReferencedMemberExpression = exports.ReferencedIdentifier = undefined;
+
+var _babelTypes = __webpack_require__(0);
+
+var t = _interopRequireWildcard(_babelTypes);
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
+
+var ReferencedIdentifier = exports.ReferencedIdentifier = {
+  types: ["Identifier", "JSXIdentifier"],
+  checkPath: function checkPath(_ref, opts) {
+    var node = _ref.node,
+        parent = _ref.parent;
+
+    if (!t.isIdentifier(node, opts) && !t.isJSXMemberExpression(parent, opts)) {
+      if (t.isJSXIdentifier(node, opts)) {
+        if (_babelTypes.react.isCompatTag(node.name)) return false;
+      } else {
+        return false;
+      }
+    }
+
+    return t.isReferenced(node, parent);
+  }
+};
+
+var ReferencedMemberExpression = exports.ReferencedMemberExpression = {
+  types: ["MemberExpression"],
+  checkPath: function checkPath(_ref2) {
+    var node = _ref2.node,
+        parent = _ref2.parent;
+
+    return t.isMemberExpression(node) && t.isReferenced(node, parent);
+  }
+};
+
+var BindingIdentifier = exports.BindingIdentifier = {
+  types: ["Identifier"],
+  checkPath: function checkPath(_ref3) {
+    var node = _ref3.node,
+        parent = _ref3.parent;
+
+    return t.isIdentifier(node) && t.isBinding(node, parent);
+  }
+};
+
+var Statement = exports.Statement = {
+  types: ["Statement"],
+  checkPath: function checkPath(_ref4) {
+    var node = _ref4.node,
+        parent = _ref4.parent;
+
+    if (t.isStatement(node)) {
+      if (t.isVariableDeclaration(node)) {
+        if (t.isForXStatement(parent, { left: node })) return false;
+        if (t.isForStatement(parent, { init: node })) return false;
+      }
+
+      return true;
+    } else {
+      return false;
+    }
+  }
+};
+
+var Expression = exports.Expression = {
+  types: ["Expression"],
+  checkPath: function checkPath(path) {
+    if (path.isIdentifier()) {
+      return path.isReferencedIdentifier();
+    } else {
+      return t.isExpression(path.node);
+    }
+  }
+};
+
+var Scope = exports.Scope = {
+  types: ["Scopable"],
+  checkPath: function checkPath(path) {
+    return t.isScope(path.node, path.parent);
+  }
+};
+
+var Referenced = exports.Referenced = {
+  checkPath: function checkPath(path) {
+    return t.isReferenced(path.node, path.parent);
+  }
+};
+
+var BlockScoped = exports.BlockScoped = {
+  checkPath: function checkPath(path) {
+    return t.isBlockScoped(path.node);
+  }
+};
+
+var Var = exports.Var = {
+  types: ["VariableDeclaration"],
+  checkPath: function checkPath(path) {
+    return t.isVar(path.node);
+  }
+};
+
+var User = exports.User = {
+  checkPath: function checkPath(path) {
+    return path.node && !!path.node.loc;
+  }
+};
+
+var Generated = exports.Generated = {
+  checkPath: function checkPath(path) {
+    return !path.isUser();
+  }
+};
+
+var Pure = exports.Pure = {
+  checkPath: function checkPath(path, opts) {
+    return path.scope.isPure(path.node, opts);
+  }
+};
+
+var Flow = exports.Flow = {
+  types: ["Flow", "ImportDeclaration", "ExportDeclaration", "ImportSpecifier"],
+  checkPath: function checkPath(_ref5) {
+    var node = _ref5.node;
+
+    if (t.isFlow(node)) {
+      return true;
+    } else if (t.isImportDeclaration(node)) {
+      return node.importKind === "type" || node.importKind === "typeof";
+    } else if (t.isExportDeclaration(node)) {
+      return node.exportKind === "type";
+    } else if (t.isImportSpecifier(node)) {
+      return node.importKind === "type" || node.importKind === "typeof";
+    } else {
+      return false;
+    }
+  }
+};
+
+/***/ }),
+/* 96 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.__esModule = true;
+
+var _classCallCheck2 = __webpack_require__(15);
+
+var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var Binding = function () {
+  function Binding(_ref) {
+    var existing = _ref.existing,
+        identifier = _ref.identifier,
+        scope = _ref.scope,
+        path = _ref.path,
+        kind = _ref.kind;
+    (0, _classCallCheck3.default)(this, Binding);
+
+    this.identifier = identifier;
+    this.scope = scope;
+    this.path = path;
+    this.kind = kind;
+
+    this.constantViolations = [];
+    this.constant = true;
+
+    this.referencePaths = [];
+    this.referenced = false;
+    this.references = 0;
+
+    this.clearValue();
+
+    if (existing) {
+      this.constantViolations = [].concat(existing.path, existing.constantViolations, this.constantViolations);
+    }
+  }
+
+  Binding.prototype.deoptValue = function deoptValue() {
+    this.clearValue();
+    this.hasDeoptedValue = true;
+  };
+
+  Binding.prototype.setValue = function setValue(value) {
+    if (this.hasDeoptedValue) return;
+    this.hasValue = true;
+    this.value = value;
+  };
+
+  Binding.prototype.clearValue = function clearValue() {
+    this.hasDeoptedValue = false;
+    this.hasValue = false;
+    this.value = null;
+  };
+
+  Binding.prototype.reassign = function reassign(path) {
+    this.constant = false;
+    if (this.constantViolations.indexOf(path) !== -1) {
+      return;
+    }
+    this.constantViolations.push(path);
+  };
+
+  Binding.prototype.reference = function reference(path) {
+    if (this.referencePaths.indexOf(path) !== -1) {
+      return;
+    }
+    this.referenced = true;
+    this.references++;
+    this.referencePaths.push(path);
+  };
+
+  Binding.prototype.dereference = function dereference() {
+    this.references--;
+    this.referenced = !!this.references;
+  };
+
+  return Binding;
+}();
+
+exports.default = Binding;
+module.exports = exports["default"];
+
+/***/ }),
+/* 97 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.__esModule = true;
+
+var _create = __webpack_require__(56);
+
+var _create2 = _interopRequireDefault(_create);
+
+exports.getBindingIdentifiers = getBindingIdentifiers;
+exports.getOuterBindingIdentifiers = getOuterBindingIdentifiers;
+
+var _index = __webpack_require__(0);
+
+var t = _interopRequireWildcard(_index);
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function getBindingIdentifiers(node, duplicates, outerOnly) {
+  var search = [].concat(node);
+  var ids = (0, _create2.default)(null);
+
+  while (search.length) {
+    var id = search.shift();
+    if (!id) continue;
+
+    var keys = t.getBindingIdentifiers.keys[id.type];
+
+    if (t.isIdentifier(id)) {
+      if (duplicates) {
+        var _ids = ids[id.name] = ids[id.name] || [];
+        _ids.push(id);
+      } else {
+        ids[id.name] = id;
+      }
+      continue;
+    }
+
+    if (t.isExportDeclaration(id)) {
+      if (t.isDeclaration(id.declaration)) {
+        search.push(id.declaration);
+      }
+      continue;
+    }
+
+    if (outerOnly) {
+      if (t.isFunctionDeclaration(id)) {
+        search.push(id.id);
+        continue;
+      }
+
+      if (t.isFunctionExpression(id)) {
+        continue;
+      }
+    }
+
+    if (keys) {
+      for (var i = 0; i < keys.length; i++) {
+        var key = keys[i];
+        if (id[key]) {
+          search = search.concat(id[key]);
+        }
+      }
+    }
+  }
+
+  return ids;
+}
+
+getBindingIdentifiers.keys = {
+  DeclareClass: ["id"],
+  DeclareFunction: ["id"],
+  DeclareModule: ["id"],
+  DeclareVariable: ["id"],
+  InterfaceDeclaration: ["id"],
+  TypeAlias: ["id"],
+
+  CatchClause: ["param"],
+  LabeledStatement: ["label"],
+  UnaryExpression: ["argument"],
+  AssignmentExpression: ["left"],
+
+  ImportSpecifier: ["local"],
+  ImportNamespaceSpecifier: ["local"],
+  ImportDefaultSpecifier: ["local"],
+  ImportDeclaration: ["specifiers"],
+
+  ExportSpecifier: ["exported"],
+  ExportNamespaceSpecifier: ["exported"],
+  ExportDefaultSpecifier: ["exported"],
+
+  FunctionDeclaration: ["id", "params"],
+  FunctionExpression: ["id", "params"],
+
+  ClassDeclaration: ["id"],
+  ClassExpression: ["id"],
+
+  RestElement: ["argument"],
+  UpdateExpression: ["argument"],
+
+  RestProperty: ["argument"],
+  ObjectProperty: ["value"],
+
+  AssignmentPattern: ["left"],
+  ArrayPattern: ["elements"],
+  ObjectPattern: ["properties"],
+
+  VariableDeclaration: ["declarations"],
+  VariableDeclarator: ["id"]
+};
+
+function getOuterBindingIdentifiers(node, duplicates) {
+  return getBindingIdentifiers(node, duplicates, true);
+}
+
+/***/ }),
+/* 98 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+/* eslint max-len: 0 */
+
+// This is a trick taken from Esprima. It turns out that, on
+// non-Chrome browsers, to check whether a string is in a set, a
+// predicate containing a big ugly `switch` statement is faster than
+// a regular expression, and on Chrome the two are about on par.
+// This function uses `eval` (non-lexical) to produce such a
+// predicate from a space-separated string of words.
+//
+// It starts by sorting the words by length.
+
+function makePredicate(words) {
+  words = words.split(" ");
+  return function (str) {
+    return words.indexOf(str) >= 0;
+  };
+}
+
+// Reserved word lists for various dialects of the language
+
+var reservedWords = {
+  6: makePredicate("enum await"),
+  strict: makePredicate("implements interface let package private protected public static yield"),
+  strictBind: makePredicate("eval arguments")
+};
+
+// And the keywords
+
+var isKeyword = makePredicate("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this let const class extends export import yield super");
+
+// ## Character categories
+
+// Big ugly regular expressions that match characters in the
+// whitespace, identifier, and identifier-start categories. These
+// are only applied when a character is found to actually have a
+// code point above 128.
+// Generated by `bin/generate-identifier-regex.js`.
+
+var nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\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-\u08 [...]
+var nonASCIIidentifierChars = "\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09 [...]
+
+var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
+var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
+
+nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
+
+// These are a run-length and offset encoded representation of the
+// >0xffff code points that are a valid part of identifiers. The
+// offset starts at 0x10000, and each pair of numbers represents an
+// offset to the next range, and then a size of the range. They were
+// generated by `bin/generate-identifier-regex.js`.
+// eslint-disable-next-line comma-spacing
+var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 17, 26, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 26, 45, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 785, 52, 76, 44, 33, 24, 27, 35, 42, 34, 4, 0, 13, 47, 15, [...]
+// eslint-disable-next-line comma-spacing
+var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 1306, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 52, 0, 13, 2, 49, 13, 10, 2, 4, 9, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 57, 0, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 87, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 423, 9, 838, 7, 2, 7, 17, 9, 57, 21, 2, 13, 19882, 9, 135, 4, 60, 6, 26, 9, 1016, 45, 17, 3, 19723, 1, 5319 [...]
+
+// This has a complexity linear to the value of the code. The
+// assumption is that looking up astral identifier characters is
+// rare.
+function isInAstralSet(code, set) {
+  var pos = 0x10000;
+  for (var i = 0; i < set.length; i += 2) {
+    pos += set[i];
+    if (pos > code) return false;
+
+    pos += set[i + 1];
+    if (pos >= code) return true;
+  }
+}
+
+// Test whether a given character code starts an identifier.
+
+function isIdentifierStart(code) {
+  if (code < 65) return code === 36;
+  if (code < 91) return true;
+  if (code < 97) return code === 95;
+  if (code < 123) return true;
+  if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));
+  return isInAstralSet(code, astralIdentifierStartCodes);
+}
+
+// Test whether a given character is part of an identifier.
+
+function isIdentifierChar(code) {
+  if (code < 48) return code === 36;
+  if (code < 58) return true;
+  if (code < 65) return false;
+  if (code < 91) return true;
+  if (code < 97) return code === 95;
+  if (code < 123) return true;
+  if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));
+  return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
+}
+
+// A second optional argument can be given to further configure
+var defaultOptions = {
+  // Source type ("script" or "module") for different semantics
+  sourceType: "script",
+  // Source filename.
+  sourceFilename: undefined,
+  // Line from which to start counting source. Useful for
+  // integration with other tools.
+  startLine: 1,
+  // When enabled, a return at the top level is not considered an
+  // error.
+  allowReturnOutsideFunction: false,
+  // When enabled, import/export statements are not constrained to
+  // appearing at the top of the program.
+  allowImportExportEverywhere: false,
+  // TODO
+  allowSuperOutsideMethod: false,
+  // An array of plugins to enable
+  plugins: [],
+  // TODO
+  strictMode: null
+};
+
+// Interpret and default an options object
+
+function getOptions(opts) {
+  var options = {};
+  for (var key in defaultOptions) {
+    options[key] = opts && key in opts ? opts[key] : defaultOptions[key];
+  }
+  return options;
+}
+
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
+  return typeof obj;
+} : function (obj) {
+  return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+};
+
+
+
+
+
+
+
+
+
+
+
+var classCallCheck = function (instance, Constructor) {
+  if (!(instance instanceof Constructor)) {
+    throw new TypeError("Cannot call a class as a function");
+  }
+};
+
+
+
+
+
+
+
+
+
+
+
+var inherits = function (subClass, superClass) {
+  if (typeof superClass !== "function" && superClass !== null) {
+    throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
+  }
+
+  subClass.prototype = Object.create(superClass && superClass.prototype, {
+    constructor: {
+      value: subClass,
+      enumerable: false,
+      writable: true,
+      configurable: true
+    }
+  });
+  if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
+};
+
+
+
+
+
+
+
+
+
+
+
+var possibleConstructorReturn = function (self, call) {
+  if (!self) {
+    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
+  }
+
+  return call && (typeof call === "object" || typeof call === "function") ? call : self;
+};
+
+// ## Token types
+
+// The assignment of fine-grained, information-carrying type objects
+// allows the tokenizer to store the information it has about a
+// token in a way that is very cheap for the parser to look up.
+
+// All token type variables start with an underscore, to make them
+// easy to recognize.
+
+// The `beforeExpr` property is used to disambiguate between regular
+// expressions and divisions. It is set on all token types that can
+// be followed by an expression (thus, a slash after them would be a
+// regular expression).
+//
+// `isLoop` marks a keyword as starting a loop, which is important
+// to know when parsing a label, in order to allow or disallow
+// continue jumps to that label.
+
+var beforeExpr = true;
+var startsExpr = true;
+var isLoop = true;
+var isAssign = true;
+var prefix = true;
+var postfix = true;
+
+var TokenType = function TokenType(label) {
+  var conf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+  classCallCheck(this, TokenType);
+
+  this.label = label;
+  this.keyword = conf.keyword;
+  this.beforeExpr = !!conf.beforeExpr;
+  this.startsExpr = !!conf.startsExpr;
+  this.rightAssociative = !!conf.rightAssociative;
+  this.isLoop = !!conf.isLoop;
+  this.isAssign = !!conf.isAssign;
+  this.prefix = !!conf.prefix;
+  this.postfix = !!conf.postfix;
+  this.binop = conf.binop || null;
+  this.updateContext = null;
+};
+
+var KeywordTokenType = function (_TokenType) {
+  inherits(KeywordTokenType, _TokenType);
+
+  function KeywordTokenType(name) {
+    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+    classCallCheck(this, KeywordTokenType);
+
+    options.keyword = name;
+
+    return possibleConstructorReturn(this, _TokenType.call(this, name, options));
+  }
+
+  return KeywordTokenType;
+}(TokenType);
+
+var BinopTokenType = function (_TokenType2) {
+  inherits(BinopTokenType, _TokenType2);
+
+  function BinopTokenType(name, prec) {
+    classCallCheck(this, BinopTokenType);
+    return possibleConstructorReturn(this, _TokenType2.call(this, name, { beforeExpr: beforeExpr, binop: prec }));
+  }
+
+  return BinopTokenType;
+}(TokenType);
+
+var types = {
+  num: new TokenType("num", { startsExpr: startsExpr }),
+  regexp: new TokenType("regexp", { startsExpr: startsExpr }),
+  string: new TokenType("string", { startsExpr: startsExpr }),
+  name: new TokenType("name", { startsExpr: startsExpr }),
+  eof: new TokenType("eof"),
+
+  // Punctuation token types.
+  bracketL: new TokenType("[", { beforeExpr: beforeExpr, startsExpr: startsExpr }),
+  bracketR: new TokenType("]"),
+  braceL: new TokenType("{", { beforeExpr: beforeExpr, startsExpr: startsExpr }),
+  braceBarL: new TokenType("{|", { beforeExpr: beforeExpr, startsExpr: startsExpr }),
+  braceR: new TokenType("}"),
+  braceBarR: new TokenType("|}"),
+  parenL: new TokenType("(", { beforeExpr: beforeExpr, startsExpr: startsExpr }),
+  parenR: new TokenType(")"),
+  comma: new TokenType(",", { beforeExpr: beforeExpr }),
+  semi: new TokenType(";", { beforeExpr: beforeExpr }),
+  colon: new TokenType(":", { beforeExpr: beforeExpr }),
+  doubleColon: new TokenType("::", { beforeExpr: beforeExpr }),
+  dot: new TokenType("."),
+  question: new TokenType("?", { beforeExpr: beforeExpr }),
+  arrow: new TokenType("=>", { beforeExpr: beforeExpr }),
+  template: new TokenType("template"),
+  ellipsis: new TokenType("...", { beforeExpr: beforeExpr }),
+  backQuote: new TokenType("`", { startsExpr: startsExpr }),
+  dollarBraceL: new TokenType("${", { beforeExpr: beforeExpr, startsExpr: startsExpr }),
+  at: new TokenType("@"),
+
+  // Operators. These carry several kinds of properties to help the
+  // parser use them properly (the presence of these properties is
+  // what categorizes them as operators).
+  //
+  // `binop`, when present, specifies that this operator is a binary
+  // operator, and will refer to its precedence.
+  //
+  // `prefix` and `postfix` mark the operator as a prefix or postfix
+  // unary operator.
+  //
+  // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as
+  // binary operators with a very low precedence, that should result
+  // in AssignmentExpression nodes.
+
+  eq: new TokenType("=", { beforeExpr: beforeExpr, isAssign: isAssign }),
+  assign: new TokenType("_=", { beforeExpr: beforeExpr, isAssign: isAssign }),
+  incDec: new TokenType("++/--", { prefix: prefix, postfix: postfix, startsExpr: startsExpr }),
+  prefix: new TokenType("prefix", { beforeExpr: beforeExpr, prefix: prefix, startsExpr: startsExpr }),
+  logicalOR: new BinopTokenType("||", 1),
+  logicalAND: new BinopTokenType("&&", 2),
+  bitwiseOR: new BinopTokenType("|", 3),
+  bitwiseXOR: new BinopTokenType("^", 4),
+  bitwiseAND: new BinopTokenType("&", 5),
+  equality: new BinopTokenType("==/!=", 6),
+  relational: new BinopTokenType("</>", 7),
+  bitShift: new BinopTokenType("<</>>", 8),
+  plusMin: new TokenType("+/-", { beforeExpr: beforeExpr, binop: 9, prefix: prefix, startsExpr: startsExpr }),
+  modulo: new BinopTokenType("%", 10),
+  star: new BinopTokenType("*", 10),
+  slash: new BinopTokenType("/", 10),
+  exponent: new TokenType("**", { beforeExpr: beforeExpr, binop: 11, rightAssociative: true })
+};
+
+var keywords = {
+  "break": new KeywordTokenType("break"),
+  "case": new KeywordTokenType("case", { beforeExpr: beforeExpr }),
+  "catch": new KeywordTokenType("catch"),
+  "continue": new KeywordTokenType("continue"),
+  "debugger": new KeywordTokenType("debugger"),
+  "default": new KeywordTokenType("default", { beforeExpr: beforeExpr }),
+  "do": new KeywordTokenType("do", { isLoop: isLoop, beforeExpr: beforeExpr }),
+  "else": new KeywordTokenType("else", { beforeExpr: beforeExpr }),
+  "finally": new KeywordTokenType("finally"),
+  "for": new KeywordTokenType("for", { isLoop: isLoop }),
+  "function": new KeywordTokenType("function", { startsExpr: startsExpr }),
+  "if": new KeywordTokenType("if"),
+  "return": new KeywordTokenType("return", { beforeExpr: beforeExpr }),
+  "switch": new KeywordTokenType("switch"),
+  "throw": new KeywordTokenType("throw", { beforeExpr: beforeExpr }),
+  "try": new KeywordTokenType("try"),
+  "var": new KeywordTokenType("var"),
+  "let": new KeywordTokenType("let"),
+  "const": new KeywordTokenType("const"),
+  "while": new KeywordTokenType("while", { isLoop: isLoop }),
+  "with": new KeywordTokenType("with"),
+  "new": new KeywordTokenType("new", { beforeExpr: beforeExpr, startsExpr: startsExpr }),
+  "this": new KeywordTokenType("this", { startsExpr: startsExpr }),
+  "super": new KeywordTokenType("super", { startsExpr: startsExpr }),
+  "class": new KeywordTokenType("class"),
+  "extends": new KeywordTokenType("extends", { beforeExpr: beforeExpr }),
+  "export": new KeywordTokenType("export"),
+  "import": new KeywordTokenType("import"),
+  "yield": new KeywordTokenType("yield", { beforeExpr: beforeExpr, startsExpr: startsExpr }),
+  "null": new KeywordTokenType("null", { startsExpr: startsExpr }),
+  "true": new KeywordTokenType("true", { startsExpr: startsExpr }),
+  "false": new KeywordTokenType("false", { startsExpr: startsExpr }),
+  "in": new KeywordTokenType("in", { beforeExpr: beforeExpr, binop: 7 }),
+  "instanceof": new KeywordTokenType("instanceof", { beforeExpr: beforeExpr, binop: 7 }),
+  "typeof": new KeywordTokenType("typeof", { beforeExpr: beforeExpr, prefix: prefix, startsExpr: startsExpr }),
+  "void": new KeywordTokenType("void", { beforeExpr: beforeExpr, prefix: prefix, startsExpr: startsExpr }),
+  "delete": new KeywordTokenType("delete", { beforeExpr: beforeExpr, prefix: prefix, startsExpr: startsExpr })
+};
+
+// Map keyword names to token types.
+Object.keys(keywords).forEach(function (name) {
+  types["_" + name] = keywords[name];
+});
+
+// Matches a whole line break (where CRLF is considered a single
+// line break). Used to count lines.
+
+var lineBreak = /\r\n?|\n|\u2028|\u2029/;
+var lineBreakG = new RegExp(lineBreak.source, "g");
+
+function isNewLine(code) {
+  return code === 10 || code === 13 || code === 0x2028 || code === 0x2029;
+}
+
+var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;
+
+// The algorithm used to determine whether a regexp can appear at a
+// given point in the program is loosely based on sweet.js' approach.
+// See https://github.com/mozilla/sweet.js/wiki/design
+
+var TokContext = function TokContext(token, isExpr, preserveSpace, override) {
+  classCallCheck(this, TokContext);
+
+  this.token = token;
+  this.isExpr = !!isExpr;
+  this.preserveSpace = !!preserveSpace;
+  this.override = override;
+};
+
+var types$1 = {
+  braceStatement: new TokContext("{", false),
+  braceExpression: new TokContext("{", true),
+  templateQuasi: new TokContext("${", true),
+  parenStatement: new TokContext("(", false),
+  parenExpression: new TokContext("(", true),
+  template: new TokContext("`", true, true, function (p) {
+    return p.readTmplToken();
+  }),
+  functionExpression: new TokContext("function", true)
+};
+
+// Token-specific context update code
+
+types.parenR.updateContext = types.braceR.updateContext = function () {
+  if (this.state.context.length === 1) {
+    this.state.exprAllowed = true;
+    return;
+  }
+
+  var out = this.state.context.pop();
+  if (out === types$1.braceStatement && this.curContext() === types$1.functionExpression) {
+    this.state.context.pop();
+    this.state.exprAllowed = false;
+  } else if (out === types$1.templateQuasi) {
+    this.state.exprAllowed = true;
+  } else {
+    this.state.exprAllowed = !out.isExpr;
+  }
+};
+
+types.name.updateContext = function (prevType) {
+  this.state.exprAllowed = false;
+
+  if (prevType === types._let || prevType === types._const || prevType === types._var) {
+    if (lineBreak.test(this.input.slice(this.state.end))) {
+      this.state.exprAllowed = true;
+    }
+  }
+};
+
+types.braceL.updateContext = function (prevType) {
+  this.state.context.push(this.braceIsBlock(prevType) ? types$1.braceStatement : types$1.braceExpression);
+  this.state.exprAllowed = true;
+};
+
+types.dollarBraceL.updateContext = function () {
+  this.state.context.push(types$1.templateQuasi);
+  this.state.exprAllowed = true;
+};
+
+types.parenL.updateContext = function (prevType) {
+  var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while;
+  this.state.context.push(statementParens ? types$1.parenStatement : types$1.parenExpression);
+  this.state.exprAllowed = true;
+};
+
+types.incDec.updateContext = function () {
+  // tokExprAllowed stays unchanged
+};
+
+types._function.updateContext = function () {
+  if (this.curContext() !== types$1.braceStatement) {
+    this.state.context.push(types$1.functionExpression);
+  }
+
+  this.state.exprAllowed = false;
+};
+
+types.backQuote.updateContext = function () {
+  if (this.curContext() === types$1.template) {
+    this.state.context.pop();
+  } else {
+    this.state.context.push(types$1.template);
+  }
+  this.state.exprAllowed = false;
+};
+
+// These are used when `options.locations` is on, for the
+// `startLoc` and `endLoc` properties.
+
+var Position = function Position(line, col) {
+  classCallCheck(this, Position);
+
+  this.line = line;
+  this.column = col;
+};
+
+var SourceLocation = function SourceLocation(start, end) {
+  classCallCheck(this, SourceLocation);
+
+  this.start = start;
+  this.end = end;
+};
+
+// The `getLineInfo` function is mostly useful when the
+// `locations` option is off (for performance reasons) and you
+// want to find the line/column position for a given character
+// offset. `input` should be the code string that the offset refers
+// into.
+
+function getLineInfo(input, offset) {
+  for (var line = 1, cur = 0;;) {
+    lineBreakG.lastIndex = cur;
+    var match = lineBreakG.exec(input);
+    if (match && match.index < offset) {
+      ++line;
+      cur = match.index + match[0].length;
+    } else {
+      return new Position(line, offset - cur);
+    }
+  }
+}
+
+var State = function () {
+  function State() {
+    classCallCheck(this, State);
+  }
+
+  State.prototype.init = function init(options, input) {
+    this.strict = options.strictMode === false ? false : options.sourceType === "module";
+
+    this.input = input;
+
+    this.potentialArrowAt = -1;
+
+    this.inMethod = this.inFunction = this.inGenerator = this.inAsync = this.inPropertyName = this.inType = this.noAnonFunctionType = false;
+
+    this.labels = [];
+
+    this.decorators = [];
+
+    this.tokens = [];
+
+    this.comments = [];
+
+    this.trailingComments = [];
+    this.leadingComments = [];
+    this.commentStack = [];
+
+    this.pos = this.lineStart = 0;
+    this.curLine = options.startLine;
+
+    this.type = types.eof;
+    this.value = null;
+    this.start = this.end = this.pos;
+    this.startLoc = this.endLoc = this.curPosition();
+
+    this.lastTokEndLoc = this.lastTokStartLoc = null;
+    this.lastTokStart = this.lastTokEnd = this.pos;
+
+    this.context = [types$1.braceStatement];
+    this.exprAllowed = true;
+
+    this.containsEsc = this.containsOctal = false;
+    this.octalPosition = null;
+
+    this.exportedIdentifiers = [];
+
+    return this;
+  };
+
+  // TODO
+
+
+  // TODO
+
+
+  // Used to signify the start of a potential arrow function
+
+
+  // Flags to track whether we are in a function, a generator.
+
+
+  // Labels in scope.
+
+
+  // Leading decorators.
+
+
+  // Token store.
+
+
+  // Comment store.
+
+
+  // Comment attachment store
+
+
+  // The current position of the tokenizer in the input.
+
+
+  // Properties of the current token:
+  // Its type
+
+
+  // For tokens that include more information than their type, the value
+
+
+  // Its start and end offset
+
+
+  // And, if locations are used, the {line, column} object
+  // corresponding to those offsets
+
+
+  // Position information for the previous token
+
+
+  // The context stack is used to superficially track syntactic
+  // context to predict whether a regular expression is allowed in a
+  // given position.
+
+
+  // Used to signal to callers of `readWord1` whether the word
+  // contained any escape sequences. This is needed because words with
+  // escape sequences must not be interpreted as keywords.
+
+
+  // TODO
+
+
+  // Names of exports store. `default` is stored as a name for both
+  // `export default foo;` and `export { foo as default };`.
+
+
+  State.prototype.curPosition = function curPosition() {
+    return new Position(this.curLine, this.pos - this.lineStart);
+  };
+
+  State.prototype.clone = function clone(skipArrays) {
+    var state = new State();
+    for (var key in this) {
+      var val = this[key];
+
+      if ((!skipArrays || key === "context") && Array.isArray(val)) {
+        val = val.slice();
+      }
+
+      state[key] = val;
+    }
+    return state;
+  };
+
+  return State;
+}();
+
+// Object type used to represent tokens. Note that normally, tokens
+// simply exist as properties on the parser object. This is only
+// used for the onToken callback and the external tokenizer.
+
+var Token = function Token(state) {
+  classCallCheck(this, Token);
+
+  this.type = state.type;
+  this.value = state.value;
+  this.start = state.start;
+  this.end = state.end;
+  this.loc = new SourceLocation(state.startLoc, state.endLoc);
+};
+
+// ## Tokenizer
+
+function codePointToString(code) {
+  // UTF-16 Decoding
+  if (code <= 0xFFFF) {
+    return String.fromCharCode(code);
+  } else {
+    return String.fromCharCode((code - 0x10000 >> 10) + 0xD800, (code - 0x10000 & 1023) + 0xDC00);
+  }
+}
+
+var Tokenizer = function () {
+  function Tokenizer(options, input) {
+    classCallCheck(this, Tokenizer);
+
+    this.state = new State();
+    this.state.init(options, input);
+  }
+
+  // Move to the next token
+
+  Tokenizer.prototype.next = function next() {
+    if (!this.isLookahead) {
+      this.state.tokens.push(new Token(this.state));
+    }
+
+    this.state.lastTokEnd = this.state.end;
+    this.state.lastTokStart = this.state.start;
+    this.state.lastTokEndLoc = this.state.endLoc;
+    this.state.lastTokStartLoc = this.state.startLoc;
+    this.nextToken();
+  };
+
+  // TODO
+
+  Tokenizer.prototype.eat = function eat(type) {
+    if (this.match(type)) {
+      this.next();
+      return true;
+    } else {
+      return false;
+    }
+  };
+
+  // TODO
+
+  Tokenizer.prototype.match = function match(type) {
+    return this.state.type === type;
+  };
+
+  // TODO
+
+  Tokenizer.prototype.isKeyword = function isKeyword$$1(word) {
+    return isKeyword(word);
+  };
+
+  // TODO
+
+  Tokenizer.prototype.lookahead = function lookahead() {
+    var old = this.state;
+    this.state = old.clone(true);
+
+    this.isLookahead = true;
+    this.next();
+    this.isLookahead = false;
+
+    var curr = this.state.clone(true);
+    this.state = old;
+    return curr;
+  };
+
+  // Toggle strict mode. Re-reads the next number or string to please
+  // pedantic tests (`"use strict"; 010;` should fail).
+
+  Tokenizer.prototype.setStrict = function setStrict(strict) {
+    this.state.strict = strict;
+    if (!this.match(types.num) && !this.match(types.string)) return;
+    this.state.pos = this.state.start;
+    while (this.state.pos < this.state.lineStart) {
+      this.state.lineStart = this.input.lastIndexOf("\n", this.state.lineStart - 2) + 1;
+      --this.state.curLine;
+    }
+    this.nextToken();
+  };
+
+  Tokenizer.prototype.curContext = function curContext() {
+    return this.state.context[this.state.context.length - 1];
+  };
+
+  // Read a single token, updating the parser object's token-related
+  // properties.
+
+  Tokenizer.prototype.nextToken = function nextToken() {
+    var curContext = this.curContext();
+    if (!curContext || !curContext.preserveSpace) this.skipSpace();
+
+    this.state.containsOctal = false;
+    this.state.octalPosition = null;
+    this.state.start = this.state.pos;
+    this.state.startLoc = this.state.curPosition();
+    if (this.state.pos >= this.input.length) return this.finishToken(types.eof);
+
+    if (curContext.override) {
+      return curContext.override(this);
+    } else {
+      return this.readToken(this.fullCharCodeAtPos());
+    }
+  };
+
+  Tokenizer.prototype.readToken = function readToken(code) {
+    // Identifier or keyword. '\uXXXX' sequences are allowed in
+    // identifiers, so '\' also dispatches to that.
+    if (isIdentifierStart(code) || code === 92 /* '\' */) {
+        return this.readWord();
+      } else {
+      return this.getTokenFromCode(code);
+    }
+  };
+
+  Tokenizer.prototype.fullCharCodeAtPos = function fullCharCodeAtPos() {
+    var code = this.input.charCodeAt(this.state.pos);
+    if (code <= 0xd7ff || code >= 0xe000) return code;
+
+    var next = this.input.charCodeAt(this.state.pos + 1);
+    return (code << 10) + next - 0x35fdc00;
+  };
+
+  Tokenizer.prototype.pushComment = function pushComment(block, text, start, end, startLoc, endLoc) {
+    var comment = {
+      type: block ? "CommentBlock" : "CommentLine",
+      value: text,
+      start: start,
+      end: end,
+      loc: new SourceLocation(startLoc, endLoc)
+    };
+
+    if (!this.isLookahead) {
+      this.state.tokens.push(comment);
+      this.state.comments.push(comment);
+      this.addComment(comment);
+    }
+  };
+
+  Tokenizer.prototype.skipBlockComment = function skipBlockComment() {
+    var startLoc = this.state.curPosition();
+    var start = this.state.pos;
+    var end = this.input.indexOf("*/", this.state.pos += 2);
+    if (end === -1) this.raise(this.state.pos - 2, "Unterminated comment");
+
+    this.state.pos = end + 2;
+    lineBreakG.lastIndex = start;
+    var match = void 0;
+    while ((match = lineBreakG.exec(this.input)) && match.index < this.state.pos) {
+      ++this.state.curLine;
+      this.state.lineStart = match.index + match[0].length;
+    }
+
+    this.pushComment(true, this.input.slice(start + 2, end), start, this.state.pos, startLoc, this.state.curPosition());
+  };
+
+  Tokenizer.prototype.skipLineComment = function skipLineComment(startSkip) {
+    var start = this.state.pos;
+    var startLoc = this.state.curPosition();
+    var ch = this.input.charCodeAt(this.state.pos += startSkip);
+    while (this.state.pos < this.input.length && ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233) {
+      ++this.state.pos;
+      ch = this.input.charCodeAt(this.state.pos);
+    }
+
+    this.pushComment(false, this.input.slice(start + startSkip, this.state.pos), start, this.state.pos, startLoc, this.state.curPosition());
+  };
+
+  // Called at the start of the parse and after every token. Skips
+  // whitespace and comments, and.
+
+  Tokenizer.prototype.skipSpace = function skipSpace() {
+    loop: while (this.state.pos < this.input.length) {
+      var ch = this.input.charCodeAt(this.state.pos);
+      switch (ch) {
+        case 32:case 160:
+          // ' '
+          ++this.state.pos;
+          break;
+
+        case 13:
+          if (this.input.charCodeAt(this.state.pos + 1) === 10) {
+            ++this.state.pos;
+          }
+
+        case 10:case 8232:case 8233:
+          ++this.state.pos;
+          ++this.state.curLine;
+          this.state.lineStart = this.state.pos;
+          break;
+
+        case 47:
+          // '/'
+          switch (this.input.charCodeAt(this.state.pos + 1)) {
+            case 42:
+              // '*'
+              this.skipBlockComment();
+              break;
+
+            case 47:
+              this.skipLineComment(2);
+              break;
+
+            default:
+              break loop;
+          }
+          break;
+
+        default:
+          if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) {
+            ++this.state.pos;
+          } else {
+            break loop;
+          }
+      }
+    }
+  };
+
+  // Called at the end of every token. Sets `end`, `val`, and
+  // maintains `context` and `exprAllowed`, and skips the space after
+  // the token, so that the next one's `start` will point at the
+  // right position.
+
+  Tokenizer.prototype.finishToken = function finishToken(type, val) {
+    this.state.end = this.state.pos;
+    this.state.endLoc = this.state.curPosition();
+    var prevType = this.state.type;
+    this.state.type = type;
+    this.state.value = val;
+
+    this.updateContext(prevType);
+  };
+
+  // ### Token reading
+
+  // This is the function that is called to fetch the next token. It
+  // is somewhat obscure, because it works in character codes rather
+  // than characters, and because operator parsing has been inlined
+  // into it.
+  //
+  // All in the name of speed.
+  //
+
+
+  Tokenizer.prototype.readToken_dot = function readToken_dot() {
+    var next = this.input.charCodeAt(this.state.pos + 1);
+    if (next >= 48 && next <= 57) {
+      return this.readNumber(true);
+    }
+
+    var next2 = this.input.charCodeAt(this.state.pos + 2);
+    if (next === 46 && next2 === 46) {
+      // 46 = dot '.'
+      this.state.pos += 3;
+      return this.finishToken(types.ellipsis);
+    } else {
+      ++this.state.pos;
+      return this.finishToken(types.dot);
+    }
+  };
+
+  Tokenizer.prototype.readToken_slash = function readToken_slash() {
+    // '/'
+    if (this.state.exprAllowed) {
+      ++this.state.pos;
+      return this.readRegexp();
+    }
+
+    var next = this.input.charCodeAt(this.state.pos + 1);
+    if (next === 61) {
+      return this.finishOp(types.assign, 2);
+    } else {
+      return this.finishOp(types.slash, 1);
+    }
+  };
+
+  Tokenizer.prototype.readToken_mult_modulo = function readToken_mult_modulo(code) {
+    // '%*'
+    var type = code === 42 ? types.star : types.modulo;
+    var width = 1;
+    var next = this.input.charCodeAt(this.state.pos + 1);
+
+    if (next === 42) {
+      // '*'
+      width++;
+      next = this.input.charCodeAt(this.state.pos + 2);
+      type = types.exponent;
+    }
+
+    if (next === 61) {
+      width++;
+      type = types.assign;
+    }
+
+    return this.finishOp(type, width);
+  };
+
+  Tokenizer.prototype.readToken_pipe_amp = function readToken_pipe_amp(code) {
+    // '|&'
+    var next = this.input.charCodeAt(this.state.pos + 1);
+    if (next === code) return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2);
+    if (next === 61) return this.finishOp(types.assign, 2);
+    if (code === 124 && next === 125 && this.hasPlugin("flow")) return this.finishOp(types.braceBarR, 2);
+    return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1);
+  };
+
+  Tokenizer.prototype.readToken_caret = function readToken_caret() {
+    // '^'
+    var next = this.input.charCodeAt(this.state.pos + 1);
+    if (next === 61) {
+      return this.finishOp(types.assign, 2);
+    } else {
+      return this.finishOp(types.bitwiseXOR, 1);
+    }
+  };
+
+  Tokenizer.prototype.readToken_plus_min = function readToken_plus_min(code) {
+    // '+-'
+    var next = this.input.charCodeAt(this.state.pos + 1);
+
+    if (next === code) {
+      if (next === 45 && this.input.charCodeAt(this.state.pos + 2) === 62 && lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.pos))) {
+        // A `-->` line comment
+        this.skipLineComment(3);
+        this.skipSpace();
+        return this.nextToken();
+      }
+      return this.finishOp(types.incDec, 2);
+    }
+
+    if (next === 61) {
+      return this.finishOp(types.assign, 2);
+    } else {
+      return this.finishOp(types.plusMin, 1);
+    }
+  };
+
+  Tokenizer.prototype.readToken_lt_gt = function readToken_lt_gt(code) {
+    // '<>'
+    var next = this.input.charCodeAt(this.state.pos + 1);
+    var size = 1;
+
+    if (next === code) {
+      size = code === 62 && this.input.charCodeAt(this.state.pos + 2) === 62 ? 3 : 2;
+      if (this.input.charCodeAt(this.state.pos + size) === 61) return this.finishOp(types.assign, size + 1);
+      return this.finishOp(types.bitShift, size);
+    }
+
+    if (next === 33 && code === 60 && this.input.charCodeAt(this.state.pos + 2) === 45 && this.input.charCodeAt(this.state.pos + 3) === 45) {
+      if (this.inModule) this.unexpected();
+      // `<!--`, an XML-style comment that should be interpreted as a line comment
+      this.skipLineComment(4);
+      this.skipSpace();
+      return this.nextToken();
+    }
+
+    if (next === 61) {
+      // <= | >=
+      size = 2;
+    }
+
+    return this.finishOp(types.relational, size);
+  };
+
+  Tokenizer.prototype.readToken_eq_excl = function readToken_eq_excl(code) {
+    // '=!'
+    var next = this.input.charCodeAt(this.state.pos + 1);
+    if (next === 61) return this.finishOp(types.equality, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2);
+    if (code === 61 && next === 62) {
+      // '=>'
+      this.state.pos += 2;
+      return this.finishToken(types.arrow);
+    }
+    return this.finishOp(code === 61 ? types.eq : types.prefix, 1);
+  };
+
+  Tokenizer.prototype.getTokenFromCode = function getTokenFromCode(code) {
+    switch (code) {
+      // The interpretation of a dot depends on whether it is followed
+      // by a digit or another two dots.
+      case 46:
+        // '.'
+        return this.readToken_dot();
+
+      // Punctuation tokens.
+      case 40:
+        ++this.state.pos;return this.finishToken(types.parenL);
+      case 41:
+        ++this.state.pos;return this.finishToken(types.parenR);
+      case 59:
+        ++this.state.pos;return this.finishToken(types.semi);
+      case 44:
+        ++this.state.pos;return this.finishToken(types.comma);
+      case 91:
+        ++this.state.pos;return this.finishToken(types.bracketL);
+      case 93:
+        ++this.state.pos;return this.finishToken(types.bracketR);
+
+      case 123:
+        if (this.hasPlugin("flow") && this.input.charCodeAt(this.state.pos + 1) === 124) {
+          return this.finishOp(types.braceBarL, 2);
+        } else {
+          ++this.state.pos;
+          return this.finishToken(types.braceL);
+        }
+
+      case 125:
+        ++this.state.pos;return this.finishToken(types.braceR);
+
+      case 58:
+        if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) {
+          return this.finishOp(types.doubleColon, 2);
+        } else {
+          ++this.state.pos;
+          return this.finishToken(types.colon);
+        }
+
+      case 63:
+        ++this.state.pos;return this.finishToken(types.question);
+      case 64:
+        ++this.state.pos;return this.finishToken(types.at);
+
+      case 96:
+        // '`'
+        ++this.state.pos;
+        return this.finishToken(types.backQuote);
+
+      case 48:
+        // '0'
+        var next = this.input.charCodeAt(this.state.pos + 1);
+        if (next === 120 || next === 88) return this.readRadixNumber(16); // '0x', '0X' - hex number
+        if (next === 111 || next === 79) return this.readRadixNumber(8); // '0o', '0O' - octal number
+        if (next === 98 || next === 66) return this.readRadixNumber(2); // '0b', '0B' - binary number
+      // Anything else beginning with a digit is an integer, octal
+      // number, or float.
+      case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:
+        // 1-9
+        return this.readNumber(false);
+
+      // Quotes produce strings.
+      case 34:case 39:
+        // '"', "'"
+        return this.readString(code);
+
+      // Operators are parsed inline in tiny state machines. '=' (61) is
+      // often referred to. `finishOp` simply skips the amount of
+      // characters it is given as second argument, and returns a token
+      // of the type given by its first argument.
+
+      case 47:
+        // '/'
+        return this.readToken_slash();
+
+      case 37:case 42:
+        // '%*'
+        return this.readToken_mult_modulo(code);
+
+      case 124:case 38:
+        // '|&'
+        return this.readToken_pipe_amp(code);
+
+      case 94:
+        // '^'
+        return this.readToken_caret();
+
+      case 43:case 45:
+        // '+-'
+        return this.readToken_plus_min(code);
+
+      case 60:case 62:
+        // '<>'
+        return this.readToken_lt_gt(code);
+
+      case 61:case 33:
+        // '=!'
+        return this.readToken_eq_excl(code);
+
+      case 126:
+        // '~'
+        return this.finishOp(types.prefix, 1);
+    }
+
+    this.raise(this.state.pos, "Unexpected character '" + codePointToString(code) + "'");
+  };
+
+  Tokenizer.prototype.finishOp = function finishOp(type, size) {
+    var str = this.input.slice(this.state.pos, this.state.pos + size);
+    this.state.pos += size;
+    return this.finishToken(type, str);
+  };
+
+  Tokenizer.prototype.readRegexp = function readRegexp() {
+    var start = this.state.pos;
+    var escaped = void 0,
+        inClass = void 0;
+    for (;;) {
+      if (this.state.pos >= this.input.length) this.raise(start, "Unterminated regular expression");
+      var ch = this.input.charAt(this.state.pos);
+      if (lineBreak.test(ch)) {
+        this.raise(start, "Unterminated regular expression");
+      }
+      if (escaped) {
+        escaped = false;
+      } else {
+        if (ch === "[") {
+          inClass = true;
+        } else if (ch === "]" && inClass) {
+          inClass = false;
+        } else if (ch === "/" && !inClass) {
+          break;
+        }
+        escaped = ch === "\\";
+      }
+      ++this.state.pos;
+    }
+    var content = this.input.slice(start, this.state.pos);
+    ++this.state.pos;
+    // Need to use `readWord1` because '\uXXXX' sequences are allowed
+    // here (don't ask).
+    var mods = this.readWord1();
+    if (mods) {
+      var validFlags = /^[gmsiyu]*$/;
+      if (!validFlags.test(mods)) this.raise(start, "Invalid regular expression flag");
+    }
+    return this.finishToken(types.regexp, {
+      pattern: content,
+      flags: mods
+    });
+  };
+
+  // Read an integer in the given radix. Return null if zero digits
+  // were read, the integer value otherwise. When `len` is given, this
+  // will return `null` unless the integer has exactly `len` digits.
+
+  Tokenizer.prototype.readInt = function readInt(radix, len) {
+    var start = this.state.pos;
+    var total = 0;
+
+    for (var i = 0, e = len == null ? Infinity : len; i < e; ++i) {
+      var code = this.input.charCodeAt(this.state.pos);
+      var val = void 0;
+      if (code >= 97) {
+        val = code - 97 + 10; // a
+      } else if (code >= 65) {
+        val = code - 65 + 10; // A
+      } else if (code >= 48 && code <= 57) {
+        val = code - 48; // 0-9
+      } else {
+        val = Infinity;
+      }
+      if (val >= radix) break;
+      ++this.state.pos;
+      total = total * radix + val;
+    }
+    if (this.state.pos === start || len != null && this.state.pos - start !== len) return null;
+
+    return total;
+  };
+
+  Tokenizer.prototype.readRadixNumber = function readRadixNumber(radix) {
+    this.state.pos += 2; // 0x
+    var val = this.readInt(radix);
+    if (val == null) this.raise(this.state.start + 2, "Expected number in radix " + radix);
+    if (isIdentifierStart(this.fullCharCodeAtPos())) this.raise(this.state.pos, "Identifier directly after number");
+    return this.finishToken(types.num, val);
+  };
+
+  // Read an integer, octal integer, or floating-point number.
+
+  Tokenizer.prototype.readNumber = function readNumber(startsWithDot) {
+    var start = this.state.pos;
+    var octal = this.input.charCodeAt(this.state.pos) === 48;
+    var isFloat = false;
+
+    if (!startsWithDot && this.readInt(10) === null) this.raise(start, "Invalid number");
+    var next = this.input.charCodeAt(this.state.pos);
+    if (next === 46) {
+      // '.'
+      ++this.state.pos;
+      this.readInt(10);
+      isFloat = true;
+      next = this.input.charCodeAt(this.state.pos);
+    }
+    if (next === 69 || next === 101) {
+      // 'eE'
+      next = this.input.charCodeAt(++this.state.pos);
+      if (next === 43 || next === 45) ++this.state.pos; // '+-'
+      if (this.readInt(10) === null) this.raise(start, "Invalid number");
+      isFloat = true;
+    }
+    if (isIdentifierStart(this.fullCharCodeAtPos())) this.raise(this.state.pos, "Identifier directly after number");
+
+    var str = this.input.slice(start, this.state.pos);
+    var val = void 0;
+    if (isFloat) {
+      val = parseFloat(str);
+    } else if (!octal || str.length === 1) {
+      val = parseInt(str, 10);
+    } else if (/[89]/.test(str) || this.state.strict) {
+      this.raise(start, "Invalid number");
+    } else {
+      val = parseInt(str, 8);
+    }
+    return this.finishToken(types.num, val);
+  };
+
+  // Read a string value, interpreting backslash-escapes.
+
+  Tokenizer.prototype.readCodePoint = function readCodePoint() {
+    var ch = this.input.charCodeAt(this.state.pos);
+    var code = void 0;
+
+    if (ch === 123) {
+      var codePos = ++this.state.pos;
+      code = this.readHexChar(this.input.indexOf("}", this.state.pos) - this.state.pos);
+      ++this.state.pos;
+      if (code > 0x10FFFF) this.raise(codePos, "Code point out of bounds");
+    } else {
+      code = this.readHexChar(4);
+    }
+    return code;
+  };
+
+  Tokenizer.prototype.readString = function readString(quote) {
+    var out = "",
+        chunkStart = ++this.state.pos;
+    for (;;) {
+      if (this.state.pos >= this.input.length) this.raise(this.state.start, "Unterminated string constant");
+      var ch = this.input.charCodeAt(this.state.pos);
+      if (ch === quote) break;
+      if (ch === 92) {
+        // '\'
+        out += this.input.slice(chunkStart, this.state.pos);
+        out += this.readEscapedChar(false);
+        chunkStart = this.state.pos;
+      } else {
+        if (isNewLine(ch)) this.raise(this.state.start, "Unterminated string constant");
+        ++this.state.pos;
+      }
+    }
+    out += this.input.slice(chunkStart, this.state.pos++);
+    return this.finishToken(types.string, out);
+  };
+
+  // Reads template string tokens.
+
+  Tokenizer.prototype.readTmplToken = function readTmplToken() {
+    var out = "",
+        chunkStart = this.state.pos;
+    for (;;) {
+      if (this.state.pos >= this.input.length) this.raise(this.state.start, "Unterminated template");
+      var ch = this.input.charCodeAt(this.state.pos);
+      if (ch === 96 || ch === 36 && this.input.charCodeAt(this.state.pos + 1) === 123) {
+        // '`', '${'
+        if (this.state.pos === this.state.start && this.match(types.template)) {
+          if (ch === 36) {
+            this.state.pos += 2;
+            return this.finishToken(types.dollarBraceL);
+          } else {
+            ++this.state.pos;
+            return this.finishToken(types.backQuote);
+          }
+        }
+        out += this.input.slice(chunkStart, this.state.pos);
+        return this.finishToken(types.template, out);
+      }
+      if (ch === 92) {
+        // '\'
+        out += this.input.slice(chunkStart, this.state.pos);
+        out += this.readEscapedChar(true);
+        chunkStart = this.state.pos;
+      } else if (isNewLine(ch)) {
+        out += this.input.slice(chunkStart, this.state.pos);
+        ++this.state.pos;
+        switch (ch) {
+          case 13:
+            if (this.input.charCodeAt(this.state.pos) === 10) ++this.state.pos;
+          case 10:
+            out += "\n";
+            break;
+          default:
+            out += String.fromCharCode(ch);
+            break;
+        }
+        ++this.state.curLine;
+        this.state.lineStart = this.state.pos;
+        chunkStart = this.state.pos;
+      } else {
+        ++this.state.pos;
+      }
+    }
+  };
+
+  // Used to read escaped characters
+
+  Tokenizer.prototype.readEscapedChar = function readEscapedChar(inTemplate) {
+    var ch = this.input.charCodeAt(++this.state.pos);
+    ++this.state.pos;
+    switch (ch) {
+      case 110:
+        return "\n"; // 'n' -> '\n'
+      case 114:
+        return "\r"; // 'r' -> '\r'
+      case 120:
+        return String.fromCharCode(this.readHexChar(2)); // 'x'
+      case 117:
+        return codePointToString(this.readCodePoint()); // 'u'
+      case 116:
+        return "\t"; // 't' -> '\t'
+      case 98:
+        return "\b"; // 'b' -> '\b'
+      case 118:
+        return "\x0B"; // 'v' -> '\u000b'
+      case 102:
+        return "\f"; // 'f' -> '\f'
+      case 13:
+        if (this.input.charCodeAt(this.state.pos) === 10) ++this.state.pos; // '\r\n'
+      case 10:
+        // ' \n'
+        this.state.lineStart = this.state.pos;
+        ++this.state.curLine;
+        return "";
+      default:
+        if (ch >= 48 && ch <= 55) {
+          var octalStr = this.input.substr(this.state.pos - 1, 3).match(/^[0-7]+/)[0];
+          var octal = parseInt(octalStr, 8);
+          if (octal > 255) {
+            octalStr = octalStr.slice(0, -1);
+            octal = parseInt(octalStr, 8);
+          }
+          if (octal > 0) {
+            if (!this.state.containsOctal) {
+              this.state.containsOctal = true;
+              this.state.octalPosition = this.state.pos - 2;
+            }
+            if (this.state.strict || inTemplate) {
+              this.raise(this.state.pos - 2, "Octal literal in strict mode");
+            }
+          }
+          this.state.pos += octalStr.length - 1;
+          return String.fromCharCode(octal);
+        }
+        return String.fromCharCode(ch);
+    }
+  };
+
+  // Used to read character escape sequences ('\x', '\u', '\U').
+
+  Tokenizer.prototype.readHexChar = function readHexChar(len) {
+    var codePos = this.state.pos;
+    var n = this.readInt(16, len);
+    if (n === null) this.raise(codePos, "Bad character escape sequence");
+    return n;
+  };
+
+  // Read an identifier, and return it as a string. Sets `this.state.containsEsc`
+  // to whether the word contained a '\u' escape.
+  //
+  // Incrementally adds only escaped chars, adding other chunks as-is
+  // as a micro-optimization.
+
+  Tokenizer.prototype.readWord1 = function readWord1() {
+    this.state.containsEsc = false;
+    var word = "",
+        first = true,
+        chunkStart = this.state.pos;
+    while (this.state.pos < this.input.length) {
+      var ch = this.fullCharCodeAtPos();
+      if (isIdentifierChar(ch)) {
+        this.state.pos += ch <= 0xffff ? 1 : 2;
+      } else if (ch === 92) {
+        // "\"
+        this.state.containsEsc = true;
+
+        word += this.input.slice(chunkStart, this.state.pos);
+        var escStart = this.state.pos;
+
+        if (this.input.charCodeAt(++this.state.pos) !== 117) {
+          // "u"
+          this.raise(this.state.pos, "Expecting Unicode escape sequence \\uXXXX");
+        }
+
+        ++this.state.pos;
+        var esc = this.readCodePoint();
+        if (!(first ? isIdentifierStart : isIdentifierChar)(esc, true)) {
+          this.raise(escStart, "Invalid Unicode escape");
+        }
+
+        word += codePointToString(esc);
+        chunkStart = this.state.pos;
+      } else {
+        break;
+      }
+      first = false;
+    }
+    return word + this.input.slice(chunkStart, this.state.pos);
+  };
+
+  // Read an identifier or keyword token. Will check for reserved
+  // words when necessary.
+
+  Tokenizer.prototype.readWord = function readWord() {
+    var word = this.readWord1();
+    var type = types.name;
+    if (!this.state.containsEsc && this.isKeyword(word)) {
+      type = keywords[word];
+    }
+    return this.finishToken(type, word);
+  };
+
+  Tokenizer.prototype.braceIsBlock = function braceIsBlock(prevType) {
+    if (prevType === types.colon) {
+      var parent = this.curContext();
+      if (parent === types$1.braceStatement || parent === types$1.braceExpression) {
+        return !parent.isExpr;
+      }
+    }
+
+    if (prevType === types._return) {
+      return lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start));
+    }
+
+    if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR) {
+      return true;
+    }
+
+    if (prevType === types.braceL) {
+      return this.curContext() === types$1.braceStatement;
+    }
+
+    return !this.state.exprAllowed;
+  };
+
+  Tokenizer.prototype.updateContext = function updateContext(prevType) {
+    var type = this.state.type;
+    var update = void 0;
+
+    if (type.keyword && prevType === types.dot) {
+      this.state.exprAllowed = false;
+    } else if (update = type.updateContext) {
+      update.call(this, prevType);
+    } else {
+      this.state.exprAllowed = type.beforeExpr;
+    }
+  };
+
+  return Tokenizer;
+}();
+
+var plugins = {};
+var frozenDeprecatedWildcardPluginList = ["jsx", "doExpressions", "objectRestSpread", "decorators", "classProperties", "exportExtensions", "asyncGenerators", "functionBind", "functionSent", "dynamicImport", "flow"];
+
+var Parser = function (_Tokenizer) {
+  inherits(Parser, _Tokenizer);
+
+  function Parser(options, input) {
+    classCallCheck(this, Parser);
+
+    options = getOptions(options);
+
+    var _this = possibleConstructorReturn(this, _Tokenizer.call(this, options, input));
+
+    _this.options = options;
+    _this.inModule = _this.options.sourceType === "module";
+    _this.input = input;
+    _this.plugins = _this.loadPlugins(_this.options.plugins);
+    _this.filename = options.sourceFilename;
+
+    // If enabled, skip leading hashbang line.
+    if (_this.state.pos === 0 && _this.input[0] === "#" && _this.input[1] === "!") {
+      _this.skipLineComment(2);
+    }
+    return _this;
+  }
+
+  Parser.prototype.isReservedWord = function isReservedWord(word) {
+    if (word === "await") {
+      return this.inModule;
+    } else {
+      return reservedWords[6](word);
+    }
+  };
+
+  Parser.prototype.hasPlugin = function hasPlugin(name) {
+    if (this.plugins["*"] && frozenDeprecatedWildcardPluginList.indexOf(name) > -1) {
+      return true;
+    }
+
+    return !!this.plugins[name];
+  };
+
+  Parser.prototype.extend = function extend(name, f) {
+    this[name] = f(this[name]);
+  };
+
+  Parser.prototype.loadAllPlugins = function loadAllPlugins() {
+    var _this2 = this;
+
+    // ensure flow plugin loads last, also ensure estree is not loaded with *
+    var pluginNames = Object.keys(plugins).filter(function (name) {
+      return name !== "flow" && name !== "estree";
+    });
+    pluginNames.push("flow");
+
+    pluginNames.forEach(function (name) {
+      var plugin = plugins[name];
+      if (plugin) plugin(_this2);
+    });
+  };
+
+  Parser.prototype.loadPlugins = function loadPlugins(pluginList) {
+    // TODO: Deprecate "*" option in next major version of Babylon
+    if (pluginList.indexOf("*") >= 0) {
+      this.loadAllPlugins();
+
+      return { "*": true };
+    }
+
+    var pluginMap = {};
+
+    if (pluginList.indexOf("flow") >= 0) {
+      // ensure flow plugin loads last
+      pluginList = pluginList.filter(function (plugin) {
+        return plugin !== "flow";
+      });
+      pluginList.push("flow");
+    }
+
+    if (pluginList.indexOf("estree") >= 0) {
+      // ensure estree plugin loads first
+      pluginList = pluginList.filter(function (plugin) {
+        return plugin !== "estree";
+      });
+      pluginList.unshift("estree");
+    }
+
+    for (var _iterator = pluginList, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
+      var _ref;
+
+      if (_isArray) {
+        if (_i >= _iterator.length) break;
+        _ref = _iterator[_i++];
+      } else {
+        _i = _iterator.next();
+        if (_i.done) break;
+        _ref = _i.value;
+      }
+
+      var name = _ref;
+
+      if (!pluginMap[name]) {
+        pluginMap[name] = true;
+
+        var plugin = plugins[name];
+        if (plugin) plugin(this);
+      }
+    }
+
+    return pluginMap;
+  };
+
+  Parser.prototype.parse = function parse() {
+    var file = this.startNode();
+    var program = this.startNode();
+    this.nextToken();
+    return this.parseTopLevel(file, program);
+  };
+
+  return Parser;
+}(Tokenizer);
+
+var pp = Parser.prototype;
+
+// ## Parser utilities
+
+// TODO
+
+pp.addExtra = function (node, key, val) {
+  if (!node) return;
+
+  var extra = node.extra = node.extra || {};
+  extra[key] = val;
+};
+
+// TODO
+
+pp.isRelational = function (op) {
+  return this.match(types.relational) && this.state.value === op;
+};
+
+// TODO
+
+pp.expectRelational = function (op) {
+  if (this.isRelational(op)) {
+    this.next();
+  } else {
+    this.unexpected(null, types.relational);
+  }
+};
+
+// Tests whether parsed token is a contextual keyword.
+
+pp.isContextual = function (name) {
+  return this.match(types.name) && this.state.value === name;
+};
+
+// Consumes contextual keyword if possible.
+
+pp.eatContextual = function (name) {
+  return this.state.value === name && this.eat(types.name);
+};
+
+// Asserts that following token is given contextual keyword.
+
+pp.expectContextual = function (name, message) {
+  if (!this.eatContextual(name)) this.unexpected(null, message);
+};
+
+// Test whether a semicolon can be inserted at the current position.
+
+pp.canInsertSemicolon = function () {
+  return this.match(types.eof) || this.match(types.braceR) || lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start));
+};
+
+// TODO
+
+pp.isLineTerminator = function () {
+  return this.eat(types.semi) || this.canInsertSemicolon();
+};
+
+// Consume a semicolon, or, failing that, see if we are allowed to
+// pretend that there is a semicolon at this position.
+
+pp.semicolon = function () {
+  if (!this.isLineTerminator()) this.unexpected(null, types.semi);
+};
+
+// Expect a token of a given type. If found, consume it, otherwise,
+// raise an unexpected token error at given pos.
+
+pp.expect = function (type, pos) {
+  return this.eat(type) || this.unexpected(pos, type);
+};
+
+// Raise an unexpected token error. Can take the expected token type
+// instead of a message string.
+
+pp.unexpected = function (pos) {
+  var messageOrType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "Unexpected token";
+
+  if (messageOrType && (typeof messageOrType === "undefined" ? "undefined" : _typeof(messageOrType)) === "object" && messageOrType.label) {
+    messageOrType = "Unexpected token, expected " + messageOrType.label;
+  }
+  this.raise(pos != null ? pos : this.state.start, messageOrType);
+};
+
+/* eslint max-len: 0 */
+
+var pp$1 = Parser.prototype;
+
+// ### Statement parsing
+
+// Parse a program. Initializes the parser, reads any number of
+// statements, and wraps them in a Program node.  Optionally takes a
+// `program` argument.  If present, the statements will be appended
+// to its body instead of creating a new node.
+
+pp$1.parseTopLevel = function (file, program) {
+  program.sourceType = this.options.sourceType;
+
+  this.parseBlockBody(program, true, true, types.eof);
+
+  file.program = this.finishNode(program, "Program");
+  file.comments = this.state.comments;
+  file.tokens = this.state.tokens;
+
+  return this.finishNode(file, "File");
+};
+
+var loopLabel = { kind: "loop" };
+var switchLabel = { kind: "switch" };
+
+// TODO
+
+pp$1.stmtToDirective = function (stmt) {
+  var expr = stmt.expression;
+
+  var directiveLiteral = this.startNodeAt(expr.start, expr.loc.start);
+  var directive = this.startNodeAt(stmt.start, stmt.loc.start);
+
+  var raw = this.input.slice(expr.start, expr.end);
+  var val = directiveLiteral.value = raw.slice(1, -1); // remove quotes
+
+  this.addExtra(directiveLiteral, "raw", raw);
+  this.addExtra(directiveLiteral, "rawValue", val);
+
+  directive.value = this.finishNodeAt(directiveLiteral, "DirectiveLiteral", expr.end, expr.loc.end);
+
+  return this.finishNodeAt(directive, "Directive", stmt.end, stmt.loc.end);
+};
+
+// Parse a single statement.
+//
+// If expecting a statement and finding a slash operator, parse a
+// regular expression literal. This is to handle cases like
+// `if (foo) /blah/.exec(foo)`, where looking at the previous token
+// does not help.
+
+pp$1.parseStatement = function (declaration, topLevel) {
+  if (this.match(types.at)) {
+    this.parseDecorators(true);
+  }
+
+  var starttype = this.state.type;
+  var node = this.startNode();
+
+  // Most types of statements are recognized by the keyword they
+  // start with. Many are trivial to parse, some require a bit of
+  // complexity.
+
+  switch (starttype) {
+    case types._break:case types._continue:
+      return this.parseBreakContinueStatement(node, starttype.keyword);
+    case types._debugger:
+      return this.parseDebuggerStatement(node);
+    case types._do:
+      return this.parseDoStatement(node);
+    case types._for:
+      return this.parseForStatement(node);
+    case types._function:
+      if (!declaration) this.unexpected();
+      return this.parseFunctionStatement(node);
+
+    case types._class:
+      if (!declaration) this.unexpected();
+      return this.parseClass(node, true);
+
+    case types._if:
+      return this.parseIfStatement(node);
+    case types._return:
+      return this.parseReturnStatement(node);
+    case types._switch:
+      return this.parseSwitchStatement(node);
+    case types._throw:
+      return this.parseThrowStatement(node);
+    case types._try:
+      return this.parseTryStatement(node);
+
+    case types._let:
+    case types._const:
+      if (!declaration) this.unexpected(); // NOTE: falls through to _var
+
+    case types._var:
+      return this.parseVarStatement(node, starttype);
+
+    case types._while:
+      return this.parseWhileStatement(node);
+    case types._with:
+      return this.parseWithStatement(node);
+    case types.braceL:
+      return this.parseBlock();
+    case types.semi:
+      return this.parseEmptyStatement(node);
+    case types._export:
+    case types._import:
+      if (this.hasPlugin("dynamicImport") && this.lookahead().type === types.parenL) break;
+
+      if (!this.options.allowImportExportEverywhere) {
+        if (!topLevel) {
+          this.raise(this.state.start, "'import' and 'export' may only appear at the top level");
+        }
+
+        if (!this.inModule) {
+          this.raise(this.state.start, "'import' and 'export' may appear only with 'sourceType: module'");
+        }
+      }
+      return starttype === types._import ? this.parseImport(node) : this.parseExport(node);
+
+    case types.name:
+      if (this.state.value === "async") {
+        // peek ahead and see if next token is a function
+        var state = this.state.clone();
+        this.next();
+        if (this.match(types._function) && !this.canInsertSemicolon()) {
+          this.expect(types._function);
+          return this.parseFunction(node, true, false, true);
+        } else {
+          this.state = state;
+        }
+      }
+  }
+
+  // If the statement does not start with a statement keyword or a
+  // brace, it's an ExpressionStatement or LabeledStatement. We
+  // simply start parsing an expression, and afterwards, if the
+  // next token is a colon and the expression was a simple
+  // Identifier node, we switch to interpreting it as a label.
+  var maybeName = this.state.value;
+  var expr = this.parseExpression();
+
+  if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon)) {
+    return this.parseLabeledStatement(node, maybeName, expr);
+  } else {
+    return this.parseExpressionStatement(node, expr);
+  }
+};
+
+pp$1.takeDecorators = function (node) {
+  if (this.state.decorators.length) {
+    node.decorators = this.state.decorators;
+    this.state.decorators = [];
+  }
+};
+
+pp$1.parseDecorators = function (allowExport) {
+  while (this.match(types.at)) {
+    var decorator = this.parseDecorator();
+    this.state.decorators.push(decorator);
+  }
+
+  if (allowExport && this.match(types._export)) {
+    return;
+  }
+
+  if (!this.match(types._class)) {
+    this.raise(this.state.start, "Leading decorators must be attached to a class declaration");
+  }
+};
+
+pp$1.parseDecorator = function () {
+  if (!this.hasPlugin("decorators")) {
+    this.unexpected();
+  }
+  var node = this.startNode();
+  this.next();
+  node.expression = this.parseMaybeAssign();
+  return this.finishNode(node, "Decorator");
+};
+
+pp$1.parseBreakContinueStatement = function (node, keyword) {
+  var isBreak = keyword === "break";
+  this.next();
+
+  if (this.isLineTerminator()) {
+    node.label = null;
+  } else if (!this.match(types.name)) {
+    this.unexpected();
+  } else {
+    node.label = this.parseIdentifier();
+    this.semicolon();
+  }
+
+  // Verify that there is an actual destination to break or
+  // continue to.
+  var i = void 0;
+  for (i = 0; i < this.state.labels.length; ++i) {
+    var lab = this.state.labels[i];
+    if (node.label == null || lab.name === node.label.name) {
+      if (lab.kind != null && (isBreak || lab.kind === "loop")) break;
+      if (node.label && isBreak) break;
+    }
+  }
+  if (i === this.state.labels.length) this.raise(node.start, "Unsyntactic " + keyword);
+  return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement");
+};
+
+pp$1.parseDebuggerStatement = function (node) {
+  this.next();
+  this.semicolon();
+  return this.finishNode(node, "DebuggerStatement");
+};
+
+pp$1.parseDoStatement = function (node) {
+  this.next();
+  this.state.labels.push(loopLabel);
+  node.body = this.parseStatement(false);
+  this.state.labels.pop();
+  this.expect(types._while);
+  node.test = this.parseParenExpression();
+  this.eat(types.semi);
+  return this.finishNode(node, "DoWhileStatement");
+};
+
+// Disambiguating between a `for` and a `for`/`in` or `for`/`of`
+// loop is non-trivial. Basically, we have to parse the init `var`
+// statement or expression, disallowing the `in` operator (see
+// the second parameter to `parseExpression`), and then check
+// whether the next token is `in` or `of`. When there is no init
+// part (semicolon immediately after the opening parenthesis), it
+// is a regular `for` loop.
+
+pp$1.parseForStatement = function (node) {
+  this.next();
+  this.state.labels.push(loopLabel);
+
+  var forAwait = false;
+  if (this.hasPlugin("asyncGenerators") && this.state.inAsync && this.isContextual("await")) {
+    forAwait = true;
+    this.next();
+  }
+  this.expect(types.parenL);
+
+  if (this.match(types.semi)) {
+    if (forAwait) {
+      this.unexpected();
+    }
+    return this.parseFor(node, null);
+  }
+
+  if (this.match(types._var) || this.match(types._let) || this.match(types._const)) {
+    var _init = this.startNode();
+    var varKind = this.state.type;
+    this.next();
+    this.parseVar(_init, true, varKind);
+    this.finishNode(_init, "VariableDeclaration");
+
+    if (this.match(types._in) || this.isContextual("of")) {
+      if (_init.declarations.length === 1 && !_init.declarations[0].init) {
+        return this.parseForIn(node, _init, forAwait);
+      }
+    }
+    if (forAwait) {
+      this.unexpected();
+    }
+    return this.parseFor(node, _init);
+  }
+
+  var refShorthandDefaultPos = { start: 0 };
+  var init = this.parseExpression(true, refShorthandDefaultPos);
+  if (this.match(types._in) || this.isContextual("of")) {
+    var description = this.isContextual("of") ? "for-of statement" : "for-in statement";
+    this.toAssignable(init, undefined, description);
+    this.checkLVal(init, undefined, undefined, description);
+    return this.parseForIn(node, init, forAwait);
+  } else if (refShorthandDefaultPos.start) {
+    this.unexpected(refShorthandDefaultPos.start);
+  }
+  if (forAwait) {
+    this.unexpected();
+  }
+  return this.parseFor(node, init);
+};
+
+pp$1.parseFunctionStatement = function (node) {
+  this.next();
+  return this.parseFunction(node, true);
+};
+
+pp$1.parseIfStatement = function (node) {
+  this.next();
+  node.test = this.parseParenExpression();
+  node.consequent = this.parseStatement(false);
+  node.alternate = this.eat(types._else) ? this.parseStatement(false) : null;
+  return this.finishNode(node, "IfStatement");
+};
+
+pp$1.parseReturnStatement = function (node) {
+  if (!this.state.inFunction && !this.options.allowReturnOutsideFunction) {
+    this.raise(this.state.start, "'return' outside of function");
+  }
+
+  this.next();
+
+  // In `return` (and `break`/`continue`), the keywords with
+  // optional arguments, we eagerly look for a semicolon or the
+  // possibility to insert one.
+
+  if (this.isLineTerminator()) {
+    node.argument = null;
+  } else {
+    node.argument = this.parseExpression();
+    this.semicolon();
+  }
+
+  return this.finishNode(node, "ReturnStatement");
+};
+
+pp$1.parseSwitchStatement = function (node) {
+  this.next();
+  node.discriminant = this.parseParenExpression();
+  node.cases = [];
+  this.expect(types.braceL);
+  this.state.labels.push(switchLabel);
+
+  // Statements under must be grouped (by label) in SwitchCase
+  // nodes. `cur` is used to keep the node that we are currently
+  // adding statements to.
+
+  var cur = void 0;
+  for (var sawDefault; !this.match(types.braceR);) {
+    if (this.match(types._case) || this.match(types._default)) {
+      var isCase = this.match(types._case);
+      if (cur) this.finishNode(cur, "SwitchCase");
+      node.cases.push(cur = this.startNode());
+      cur.consequent = [];
+      this.next();
+      if (isCase) {
+        cur.test = this.parseExpression();
+      } else {
+        if (sawDefault) this.raise(this.state.lastTokStart, "Multiple default clauses");
+        sawDefault = true;
+        cur.test = null;
+      }
+      this.expect(types.colon);
+    } else {
+      if (cur) {
+        cur.consequent.push(this.parseStatement(true));
+      } else {
+        this.unexpected();
+      }
+    }
+  }
+  if (cur) this.finishNode(cur, "SwitchCase");
+  this.next(); // Closing brace
+  this.state.labels.pop();
+  return this.finishNode(node, "SwitchStatement");
+};
+
+pp$1.parseThrowStatement = function (node) {
+  this.next();
+  if (lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start))) this.raise(this.state.lastTokEnd, "Illegal newline after throw");
+  node.argument = this.parseExpression();
+  this.semicolon();
+  return this.finishNode(node, "ThrowStatement");
+};
+
+// Reused empty array added for node fields that are always empty.
+
+var empty = [];
+
+pp$1.parseTryStatement = function (node) {
+  this.next();
+
+  node.block = this.parseBlock();
+  node.handler = null;
+
+  if (this.match(types._catch)) {
+    var clause = this.startNode();
+    this.next();
+
+    this.expect(types.parenL);
+    clause.param = this.parseBindingAtom();
+    this.checkLVal(clause.param, true, Object.create(null), "catch clause");
+    this.expect(types.parenR);
+
+    clause.body = this.parseBlock();
+    node.handler = this.finishNode(clause, "CatchClause");
+  }
+
+  node.guardedHandlers = empty;
+  node.finalizer = this.eat(types._finally) ? this.parseBlock() : null;
+
+  if (!node.handler && !node.finalizer) {
+    this.raise(node.start, "Missing catch or finally clause");
+  }
+
+  return this.finishNode(node, "TryStatement");
+};
+
+pp$1.parseVarStatement = function (node, kind) {
+  this.next();
+  this.parseVar(node, false, kind);
+  this.semicolon();
+  return this.finishNode(node, "VariableDeclaration");
+};
+
+pp$1.parseWhileStatement = function (node) {
+  this.next();
+  node.test = this.parseParenExpression();
+  this.state.labels.push(loopLabel);
+  node.body = this.parseStatement(false);
+  this.state.labels.pop();
+  return this.finishNode(node, "WhileStatement");
+};
+
+pp$1.parseWithStatement = function (node) {
+  if (this.state.strict) this.raise(this.state.start, "'with' in strict mode");
+  this.next();
+  node.object = this.parseParenExpression();
+  node.body = this.parseStatement(false);
+  return this.finishNode(node, "WithStatement");
+};
+
+pp$1.parseEmptyStatement = function (node) {
+  this.next();
+  return this.finishNode(node, "EmptyStatement");
+};
+
+pp$1.parseLabeledStatement = function (node, maybeName, expr) {
+  for (var _iterator = this.state.labels, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
+    var _ref;
+
+    if (_isArray) {
+      if (_i >= _iterator.length) break;
+      _ref = _iterator[_i++];
+    } else {
+      _i = _iterator.next();
+      if (_i.done) break;
+      _ref = _i.value;
+    }
+
+    var _label = _ref;
+
+    if (_label.name === maybeName) {
+      this.raise(expr.start, "Label '" + maybeName + "' is already declared");
+    }
+  }
+
+  var kind = this.state.type.isLoop ? "loop" : this.match(types._switch) ? "switch" : null;
+  for (var i = this.state.labels.length - 1; i >= 0; i--) {
+    var label = this.state.labels[i];
+    if (label.statementStart === node.start) {
+      label.statementStart = this.state.start;
+      label.kind = kind;
+    } else {
+      break;
+    }
+  }
+
+  this.state.labels.push({ name: maybeName, kind: kind, statementStart: this.state.start });
+  node.body = this.parseStatement(true);
+  this.state.labels.pop();
+  node.label = expr;
+  return this.finishNode(node, "LabeledStatement");
+};
+
+pp$1.parseExpressionStatement = function (node, expr) {
+  node.expression = expr;
+  this.semicolon();
+  return this.finishNode(node, "ExpressionStatement");
+};
+
+// Parse a semicolon-enclosed block of statements, handling `"use
+// strict"` declarations when `allowStrict` is true (used for
+// function bodies).
+
+pp$1.parseBlock = function (allowDirectives) {
+  var node = this.startNode();
+  this.expect(types.braceL);
+  this.parseBlockBody(node, allowDirectives, false, types.braceR);
+  return this.finishNode(node, "BlockStatement");
+};
+
+pp$1.isValidDirective = function (stmt) {
+  return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized;
+};
+
+pp$1.parseBlockBody = function (node, allowDirectives, topLevel, end) {
+  node.body = [];
+  node.directives = [];
+
+  var parsedNonDirective = false;
+  var oldStrict = void 0;
+  var octalPosition = void 0;
+
+  while (!this.eat(end)) {
+    if (!parsedNonDirective && this.state.containsOctal && !octalPosition) {
+      octalPosition = this.state.octalPosition;
+    }
+
+    var stmt = this.parseStatement(true, topLevel);
+
+    if (allowDirectives && !parsedNonDirective && this.isValidDirective(stmt)) {
+      var directive = this.stmtToDirective(stmt);
+      node.directives.push(directive);
+
+      if (oldStrict === undefined && directive.value.value === "use strict") {
+        oldStrict = this.state.strict;
+        this.setStrict(true);
+
+        if (octalPosition) {
+          this.raise(octalPosition, "Octal literal in strict mode");
+        }
+      }
+
+      continue;
+    }
+
+    parsedNonDirective = true;
+    node.body.push(stmt);
+  }
+
+  if (oldStrict === false) {
+    this.setStrict(false);
+  }
+};
+
+// Parse a regular `for` loop. The disambiguation code in
+// `parseStatement` will already have parsed the init statement or
+// expression.
+
+pp$1.parseFor = function (node, init) {
+  node.init = init;
+  this.expect(types.semi);
+  node.test = this.match(types.semi) ? null : this.parseExpression();
+  this.expect(types.semi);
+  node.update = this.match(types.parenR) ? null : this.parseExpression();
+  this.expect(types.parenR);
+  node.body = this.parseStatement(false);
+  this.state.labels.pop();
+  return this.finishNode(node, "ForStatement");
+};
+
+// Parse a `for`/`in` and `for`/`of` loop, which are almost
+// same from parser's perspective.
+
+pp$1.parseForIn = function (node, init, forAwait) {
+  var type = void 0;
+  if (forAwait) {
+    this.eatContextual("of");
+    type = "ForAwaitStatement";
+  } else {
+    type = this.match(types._in) ? "ForInStatement" : "ForOfStatement";
+    this.next();
+  }
+  node.left = init;
+  node.right = this.parseExpression();
+  this.expect(types.parenR);
+  node.body = this.parseStatement(false);
+  this.state.labels.pop();
+  return this.finishNode(node, type);
+};
+
+// Parse a list of variable declarations.
+
+pp$1.parseVar = function (node, isFor, kind) {
+  node.declarations = [];
+  node.kind = kind.keyword;
+  for (;;) {
+    var decl = this.startNode();
+    this.parseVarHead(decl);
+    if (this.eat(types.eq)) {
+      decl.init = this.parseMaybeAssign(isFor);
+    } else if (kind === types._const && !(this.match(types._in) || this.isContextual("of"))) {
+      this.unexpected();
+    } else if (decl.id.type !== "Identifier" && !(isFor && (this.match(types._in) || this.isContextual("of")))) {
+      this.raise(this.state.lastTokEnd, "Complex binding patterns require an initialization value");
+    } else {
+      decl.init = null;
+    }
+    node.declarations.push(this.finishNode(decl, "VariableDeclarator"));
+    if (!this.eat(types.comma)) break;
+  }
+  return node;
+};
+
+pp$1.parseVarHead = function (decl) {
+  decl.id = this.parseBindingAtom();
+  this.checkLVal(decl.id, true, undefined, "variable declaration");
+};
+
+// Parse a function declaration or literal (depending on the
+// `isStatement` parameter).
+
+pp$1.parseFunction = function (node, isStatement, allowExpressionBody, isAsync, optionalId) {
+  var oldInMethod = this.state.inMethod;
+  this.state.inMethod = false;
+
+  this.initFunction(node, isAsync);
+
+  if (this.match(types.star)) {
+    if (node.async && !this.hasPlugin("asyncGenerators")) {
+      this.unexpected();
+    } else {
+      node.generator = true;
+      this.next();
+    }
+  }
+
+  if (isStatement && !optionalId && !this.match(types.name) && !this.match(types._yield)) {
+    this.unexpected();
+  }
+
+  if (this.match(types.name) || this.match(types._yield)) {
+    node.id = this.parseBindingIdentifier();
+  }
+
+  this.parseFunctionParams(node);
+  this.parseFunctionBody(node, allowExpressionBody);
+
+  this.state.inMethod = oldInMethod;
+
+  return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression");
+};
+
+pp$1.parseFunctionParams = function (node) {
+  this.expect(types.parenL);
+  node.params = this.parseBindingList(types.parenR);
+};
+
+// Parse a class declaration or literal (depending on the
+// `isStatement` parameter).
+
+pp$1.parseClass = function (node, isStatement, optionalId) {
+  this.next();
+  this.takeDecorators(node);
+  this.parseClassId(node, isStatement, optionalId);
+  this.parseClassSuper(node);
+  this.parseClassBody(node);
+  return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression");
+};
+
+pp$1.isClassProperty = function () {
+  return this.match(types.eq) || this.isLineTerminator();
+};
+
+pp$1.isClassMutatorStarter = function () {
+  return false;
+};
+
+pp$1.parseClassBody = function (node) {
+  // class bodies are implicitly strict
+  var oldStrict = this.state.strict;
+  this.state.strict = true;
+
+  var hadConstructorCall = false;
+  var hadConstructor = false;
+  var decorators = [];
+  var classBody = this.startNode();
+
+  classBody.body = [];
+
+  this.expect(types.braceL);
+
+  while (!this.eat(types.braceR)) {
+    if (this.eat(types.semi)) {
+      if (decorators.length > 0) {
+        this.raise(this.state.lastTokEnd, "Decorators must not be followed by a semicolon");
+      }
+      continue;
+    }
+
+    if (this.match(types.at)) {
+      decorators.push(this.parseDecorator());
+      continue;
+    }
+
+    var method = this.startNode();
+
+    // steal the decorators if there are any
+    if (decorators.length) {
+      method.decorators = decorators;
+      decorators = [];
+    }
+
+    var isConstructorCall = false;
+    var isMaybeStatic = this.match(types.name) && this.state.value === "static";
+    var isGenerator = this.eat(types.star);
+    var isGetSet = false;
+    var isAsync = false;
+
+    this.parsePropertyName(method);
+
+    method.static = isMaybeStatic && !this.match(types.parenL);
+    if (method.static) {
+      isGenerator = this.eat(types.star);
+      this.parsePropertyName(method);
+    }
+
+    if (!isGenerator) {
+      if (this.isClassProperty()) {
+        classBody.body.push(this.parseClassProperty(method));
+        continue;
+      }
+
+      if (method.key.type === "Identifier" && !method.computed && this.hasPlugin("classConstructorCall") && method.key.name === "call" && this.match(types.name) && this.state.value === "constructor") {
+        isConstructorCall = true;
+        this.parsePropertyName(method);
+      }
+    }
+
+    var isAsyncMethod = !this.match(types.parenL) && !method.computed && method.key.type === "Identifier" && method.key.name === "async";
+    if (isAsyncMethod) {
+      if (this.hasPlugin("asyncGenerators") && this.eat(types.star)) isGenerator = true;
+      isAsync = true;
+      this.parsePropertyName(method);
+    }
+
+    method.kind = "method";
+
+    if (!method.computed) {
+      var key = method.key;
+
+      // handle get/set methods
+      // eg. class Foo { get bar() {} set bar() {} }
+
+      if (!isAsync && !isGenerator && !this.isClassMutatorStarter() && key.type === "Identifier" && !this.match(types.parenL) && (key.name === "get" || key.name === "set")) {
+        isGetSet = true;
+        method.kind = key.name;
+        key = this.parsePropertyName(method);
+      }
+
+      // disallow invalid constructors
+      var isConstructor = !isConstructorCall && !method.static && (key.name === "constructor" || // Identifier
+      key.value === "constructor" // Literal
+      );
+      if (isConstructor) {
+        if (hadConstructor) this.raise(key.start, "Duplicate constructor in the same class");
+        if (isGetSet) this.raise(key.start, "Constructor can't have get/set modifier");
+        if (isGenerator) this.raise(key.start, "Constructor can't be a generator");
+        if (isAsync) this.raise(key.start, "Constructor can't be an async function");
+        method.kind = "constructor";
+        hadConstructor = true;
+      }
+
+      // disallow static prototype method
+      var isStaticPrototype = method.static && (key.name === "prototype" || // Identifier
+      key.value === "prototype" // Literal
+      );
+      if (isStaticPrototype) {
+        this.raise(key.start, "Classes may not have static property named prototype");
+      }
+    }
+
+    // convert constructor to a constructor call
+    if (isConstructorCall) {
+      if (hadConstructorCall) this.raise(method.start, "Duplicate constructor call in the same class");
+      method.kind = "constructorCall";
+      hadConstructorCall = true;
+    }
+
+    // disallow decorators on class constructors
+    if ((method.kind === "constructor" || method.kind === "constructorCall") && method.decorators) {
+      this.raise(method.start, "You can't attach decorators to a class constructor");
+    }
+
+    this.parseClassMethod(classBody, method, isGenerator, isAsync);
+
+    if (isGetSet) {
+      this.checkGetterSetterParamCount(method);
+    }
+  }
+
+  if (decorators.length) {
+    this.raise(this.state.start, "You have trailing decorators with no method");
+  }
+
+  node.body = this.finishNode(classBody, "ClassBody");
+
+  this.state.strict = oldStrict;
+};
+
+pp$1.parseClassProperty = function (node) {
+  if (this.match(types.eq)) {
+    if (!this.hasPlugin("classProperties")) this.unexpected();
+    this.next();
+    node.value = this.parseMaybeAssign();
+  } else {
+    node.value = null;
+  }
+  this.semicolon();
+  return this.finishNode(node, "ClassProperty");
+};
+
+pp$1.parseClassMethod = function (classBody, method, isGenerator, isAsync) {
+  this.parseMethod(method, isGenerator, isAsync);
+  classBody.body.push(this.finishNode(method, "ClassMethod"));
+};
+
+pp$1.parseClassId = function (node, isStatement, optionalId) {
+  if (this.match(types.name)) {
+    node.id = this.parseIdentifier();
+  } else {
+    if (optionalId || !isStatement) {
+      node.id = null;
+    } else {
+      this.unexpected();
+    }
+  }
+};
+
+pp$1.parseClassSuper = function (node) {
+  node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null;
+};
+
+// Parses module export declaration.
+
+pp$1.parseExport = function (node) {
+  this.next();
+  // export * from '...'
+  if (this.match(types.star)) {
+    var specifier = this.startNode();
+    this.next();
+    if (this.hasPlugin("exportExtensions") && this.eatContextual("as")) {
+      specifier.exported = this.parseIdentifier();
+      node.specifiers = [this.finishNode(specifier, "ExportNamespaceSpecifier")];
+      this.parseExportSpecifiersMaybe(node);
+      this.parseExportFrom(node, true);
+    } else {
+      this.parseExportFrom(node, true);
+      return this.finishNode(node, "ExportAllDeclaration");
+    }
+  } else if (this.hasPlugin("exportExtensions") && this.isExportDefaultSpecifier()) {
+    var _specifier = this.startNode();
+    _specifier.exported = this.parseIdentifier(true);
+    node.specifiers = [this.finishNode(_specifier, "ExportDefaultSpecifier")];
+    if (this.match(types.comma) && this.lookahead().type === types.star) {
+      this.expect(types.comma);
+      var _specifier2 = this.startNode();
+      this.expect(types.star);
+      this.expectContextual("as");
+      _specifier2.exported = this.parseIdentifier();
+      node.specifiers.push(this.finishNode(_specifier2, "ExportNamespaceSpecifier"));
+    } else {
+      this.parseExportSpecifiersMaybe(node);
+    }
+    this.parseExportFrom(node, true);
+  } else if (this.eat(types._default)) {
+    // export default ...
+    var expr = this.startNode();
+    var needsSemi = false;
+    if (this.eat(types._function)) {
+      expr = this.parseFunction(expr, true, false, false, true);
+    } else if (this.match(types._class)) {
+      expr = this.parseClass(expr, true, true);
+    } else {
+      needsSemi = true;
+      expr = this.parseMaybeAssign();
+    }
+    node.declaration = expr;
+    if (needsSemi) this.semicolon();
+    this.checkExport(node, true, true);
+    return this.finishNode(node, "ExportDefaultDeclaration");
+  } else if (this.shouldParseExportDeclaration()) {
+    node.specifiers = [];
+    node.source = null;
+    node.declaration = this.parseExportDeclaration(node);
+  } else {
+    // export { x, y as z } [from '...']
+    node.declaration = null;
+    node.specifiers = this.parseExportSpecifiers();
+    this.parseExportFrom(node);
+  }
+  this.checkExport(node, true);
+  return this.finishNode(node, "ExportNamedDeclaration");
+};
+
+pp$1.parseExportDeclaration = function () {
+  return this.parseStatement(true);
+};
+
+pp$1.isExportDefaultSpecifier = function () {
+  if (this.match(types.name)) {
+    return this.state.value !== "type" && this.state.value !== "async" && this.state.value !== "interface";
+  }
+
+  if (!this.match(types._default)) {
+    return false;
+  }
+
+  var lookahead = this.lookahead();
+  return lookahead.type === types.comma || lookahead.type === types.name && lookahead.value === "from";
+};
+
+pp$1.parseExportSpecifiersMaybe = function (node) {
+  if (this.eat(types.comma)) {
+    node.specifiers = node.specifiers.concat(this.parseExportSpecifiers());
+  }
+};
+
+pp$1.parseExportFrom = function (node, expect) {
+  if (this.eatContextual("from")) {
+    node.source = this.match(types.string) ? this.parseExprAtom() : this.unexpected();
+    this.checkExport(node);
+  } else {
+    if (expect) {
+      this.unexpected();
+    } else {
+      node.source = null;
+    }
+  }
+
+  this.semicolon();
+};
+
+pp$1.shouldParseExportDeclaration = function () {
+  return this.state.type.keyword === "var" || this.state.type.keyword === "const" || this.state.type.keyword === "let" || this.state.type.keyword === "function" || this.state.type.keyword === "class" || this.isContextual("async");
+};
+
+pp$1.checkExport = function (node, checkNames, isDefault) {
+  if (checkNames) {
+    // Check for duplicate exports
+    if (isDefault) {
+      // Default exports
+      this.checkDuplicateExports(node, "default");
+    } else if (node.specifiers && node.specifiers.length) {
+      // Named exports
+      for (var _iterator2 = node.specifiers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
+        var _ref2;
+
+        if (_isArray2) {
+          if (_i2 >= _iterator2.length) break;
+          _ref2 = _iterator2[_i2++];
+        } else {
+          _i2 = _iterator2.next();
+          if (_i2.done) break;
+          _ref2 = _i2.value;
+        }
+
+        var specifier = _ref2;
+
+        this.checkDuplicateExports(specifier, specifier.exported.name);
+      }
+    } else if (node.declaration) {
+      // Exported declarations
+      if (node.declaration.type === "FunctionDeclaration" || node.declaration.type === "ClassDeclaration") {
+        this.checkDuplicateExports(node, node.declaration.id.name);
+      } else if (node.declaration.type === "VariableDeclaration") {
+        for (var _iterator3 = node.declaration.declarations, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
+          var _ref3;
+
+          if (_isArray3) {
+            if (_i3 >= _iterator3.length) break;
+            _ref3 = _iterator3[_i3++];
+          } else {
+            _i3 = _iterator3.next();
+            if (_i3.done) break;
+            _ref3 = _i3.value;
+          }
+
+          var declaration = _ref3;
+
+          this.checkDeclaration(declaration.id);
+        }
+      }
+    }
+  }
+
+  if (this.state.decorators.length) {
+    var isClass = node.declaration && (node.declaration.type === "ClassDeclaration" || node.declaration.type === "ClassExpression");
+    if (!node.declaration || !isClass) {
+      this.raise(node.start, "You can only use decorators on an export when exporting a class");
+    }
+    this.takeDecorators(node.declaration);
+  }
+};
+
+pp$1.checkDeclaration = function (node) {
+  if (node.type === "ObjectPattern") {
+    for (var _iterator4 = node.properties, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
+      var _ref4;
+
+      if (_isArray4) {
+        if (_i4 >= _iterator4.length) break;
+        _ref4 = _iterator4[_i4++];
+      } else {
+        _i4 = _iterator4.next();
+        if (_i4.done) break;
+        _ref4 = _i4.value;
+      }
+
+      var prop = _ref4;
+
+      this.checkDeclaration(prop);
+    }
+  } else if (node.type === "ArrayPattern") {
+    for (var _iterator5 = node.elements, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
+      var _ref5;
+
+      if (_isArray5) {
+        if (_i5 >= _iterator5.length) break;
+        _ref5 = _iterator5[_i5++];
+      } else {
+        _i5 = _iterator5.next();
+        if (_i5.done) break;
+        _ref5 = _i5.value;
+      }
+
+      var elem = _ref5;
+
+      if (elem) {
+        this.checkDeclaration(elem);
+      }
+    }
+  } else if (node.type === "ObjectProperty") {
+    this.checkDeclaration(node.value);
+  } else if (node.type === "RestElement" || node.type === "RestProperty") {
+    this.checkDeclaration(node.argument);
+  } else if (node.type === "Identifier") {
+    this.checkDuplicateExports(node, node.name);
+  }
+};
+
+pp$1.checkDuplicateExports = function (node, name) {
+  if (this.state.exportedIdentifiers.indexOf(name) > -1) {
+    this.raiseDuplicateExportError(node, name);
+  }
+  this.state.exportedIdentifiers.push(name);
+};
+
+pp$1.raiseDuplicateExportError = function (node, name) {
+  this.raise(node.start, name === "default" ? "Only one default export allowed per module." : "`" + name + "` has already been exported. Exported identifiers must be unique.");
+};
+
+// Parses a comma-separated list of module exports.
+
+pp$1.parseExportSpecifiers = function () {
+  var nodes = [];
+  var first = true;
+  var needsFrom = void 0;
+
+  // export { x, y as z } [from '...']
+  this.expect(types.braceL);
+
+  while (!this.eat(types.braceR)) {
+    if (first) {
+      first = false;
+    } else {
+      this.expect(types.comma);
+      if (this.eat(types.braceR)) break;
+    }
+
+    var isDefault = this.match(types._default);
+    if (isDefault && !needsFrom) needsFrom = true;
+
+    var node = this.startNode();
+    node.local = this.parseIdentifier(isDefault);
+    node.exported = this.eatContextual("as") ? this.parseIdentifier(true) : node.local.__clone();
+    nodes.push(this.finishNode(node, "ExportSpecifier"));
+  }
+
+  // https://github.com/ember-cli/ember-cli/pull/3739
+  if (needsFrom && !this.isContextual("from")) {
+    this.unexpected();
+  }
+
+  return nodes;
+};
+
+// Parses import declaration.
+
+pp$1.parseImport = function (node) {
+  this.eat(types._import);
+
+  // import '...'
+  if (this.match(types.string)) {
+    node.specifiers = [];
+    node.source = this.parseExprAtom();
+  } else {
+    node.specifiers = [];
+    this.parseImportSpecifiers(node);
+    this.expectContextual("from");
+    node.source = this.match(types.string) ? this.parseExprAtom() : this.unexpected();
+  }
+  this.semicolon();
+  return this.finishNode(node, "ImportDeclaration");
+};
+
+// Parses a comma-separated list of module imports.
+
+pp$1.parseImportSpecifiers = function (node) {
+  var first = true;
+  if (this.match(types.name)) {
+    // import defaultObj, { x, y as z } from '...'
+    var startPos = this.state.start;
+    var startLoc = this.state.startLoc;
+    node.specifiers.push(this.parseImportSpecifierDefault(this.parseIdentifier(), startPos, startLoc));
+    if (!this.eat(types.comma)) return;
+  }
+
+  if (this.match(types.star)) {
+    var specifier = this.startNode();
+    this.next();
+    this.expectContextual("as");
+    specifier.local = this.parseIdentifier();
+    this.checkLVal(specifier.local, true, undefined, "import namespace specifier");
+    node.specifiers.push(this.finishNode(specifier, "ImportNamespaceSpecifier"));
+    return;
+  }
+
+  this.expect(types.braceL);
+  while (!this.eat(types.braceR)) {
+    if (first) {
+      first = false;
+    } else {
+      // Detect an attempt to deep destructure
+      if (this.eat(types.colon)) {
+        this.unexpected(null, "ES2015 named imports do not destructure. Use another statement for destructuring after the import.");
+      }
+
+      this.expect(types.comma);
+      if (this.eat(types.braceR)) break;
+    }
+
+    this.parseImportSpecifier(node);
+  }
+};
+
+pp$1.parseImportSpecifier = function (node) {
+  var specifier = this.startNode();
+  specifier.imported = this.parseIdentifier(true);
+  if (this.eatContextual("as")) {
+    specifier.local = this.parseIdentifier();
+  } else {
+    this.checkReservedWord(specifier.imported.name, specifier.start, true, true);
+    specifier.local = specifier.imported.__clone();
+  }
+  this.checkLVal(specifier.local, true, undefined, "import specifier");
+  node.specifiers.push(this.finishNode(specifier, "ImportSpecifier"));
+};
+
+pp$1.parseImportSpecifierDefault = function (id, startPos, startLoc) {
+  var node = this.startNodeAt(startPos, startLoc);
+  node.local = id;
+  this.checkLVal(node.local, true, undefined, "default import specifier");
+  return this.finishNode(node, "ImportDefaultSpecifier");
+};
+
+var pp$2 = Parser.prototype;
+
+// Convert existing expression atom to assignable pattern
+// if possible.
+
+pp$2.toAssignable = function (node, isBinding, contextDescription) {
+  if (node) {
+    switch (node.type) {
+      case "Identifier":
+      case "ObjectPattern":
+      case "ArrayPattern":
+      case "AssignmentPattern":
+        break;
+
+      case "ObjectExpression":
+        node.type = "ObjectPattern";
+        for (var _iterator = node.properties, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
+          var _ref;
+
+          if (_isArray) {
+            if (_i >= _iterator.length) break;
+            _ref = _iterator[_i++];
+          } else {
+            _i = _iterator.next();
+            if (_i.done) break;
+            _ref = _i.value;
+          }
+
+          var prop = _ref;
+
+          if (prop.type === "ObjectMethod") {
+            if (prop.kind === "get" || prop.kind === "set") {
+              this.raise(prop.key.start, "Object pattern can't contain getter or setter");
+            } else {
+              this.raise(prop.key.start, "Object pattern can't contain methods");
+            }
+          } else {
+            this.toAssignable(prop, isBinding, "object destructuring pattern");
+          }
+        }
+        break;
+
+      case "ObjectProperty":
+        this.toAssignable(node.value, isBinding, contextDescription);
+        break;
+
+      case "SpreadProperty":
+        node.type = "RestProperty";
+        break;
+
+      case "ArrayExpression":
+        node.type = "ArrayPattern";
+        this.toAssignableList(node.elements, isBinding, contextDescription);
+        break;
+
+      case "AssignmentExpression":
+        if (node.operator === "=") {
+          node.type = "AssignmentPattern";
+          delete node.operator;
+        } else {
+          this.raise(node.left.end, "Only '=' operator can be used for specifying default value.");
+        }
+        break;
+
+      case "MemberExpression":
+        if (!isBinding) break;
+
+      default:
+        {
+          var message = "Invalid left-hand side" + (contextDescription ? " in " + contextDescription : /* istanbul ignore next */"expression");
+          this.raise(node.start, message);
+        }
+    }
+  }
+  return node;
+};
+
+// Convert list of expression atoms to binding list.
+
+pp$2.toAssignableList = function (exprList, isBinding, contextDescription) {
+  var end = exprList.length;
+  if (end) {
+    var last = exprList[end - 1];
+    if (last && last.type === "RestElement") {
+      --end;
+    } else if (last && last.type === "SpreadElement") {
+      last.type = "RestElement";
+      var arg = last.argument;
+      this.toAssignable(arg, isBinding, contextDescription);
+      if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern") {
+        this.unexpected(arg.start);
+      }
+      --end;
+    }
+  }
+  for (var i = 0; i < end; i++) {
+    var elt = exprList[i];
+    if (elt) this.toAssignable(elt, isBinding, contextDescription);
+  }
+  return exprList;
+};
+
+// Convert list of expression atoms to a list of
+
+pp$2.toReferencedList = function (exprList) {
+  return exprList;
+};
+
+// Parses spread element.
+
+pp$2.parseSpread = function (refShorthandDefaultPos) {
+  var node = this.startNode();
+  this.next();
+  node.argument = this.parseMaybeAssign(false, refShorthandDefaultPos);
+  return this.finishNode(node, "SpreadElement");
+};
+
+pp$2.parseRest = function () {
+  var node = this.startNode();
+  this.next();
+  node.argument = this.parseBindingIdentifier();
+  return this.finishNode(node, "RestElement");
+};
+
+pp$2.shouldAllowYieldIdentifier = function () {
+  return this.match(types._yield) && !this.state.strict && !this.state.inGenerator;
+};
+
+pp$2.parseBindingIdentifier = function () {
+  return this.parseIdentifier(this.shouldAllowYieldIdentifier());
+};
+
+// Parses lvalue (assignable) atom.
+
+pp$2.parseBindingAtom = function () {
+  switch (this.state.type) {
+    case types._yield:
+      if (this.state.strict || this.state.inGenerator) this.unexpected();
+    // fall-through
+    case types.name:
+      return this.parseIdentifier(true);
+
+    case types.bracketL:
+      var node = this.startNode();
+      this.next();
+      node.elements = this.parseBindingList(types.bracketR, true);
+      return this.finishNode(node, "ArrayPattern");
+
+    case types.braceL:
+      return this.parseObj(true);
+
+    default:
+      this.unexpected();
+  }
+};
+
+pp$2.parseBindingList = function (close, allowEmpty) {
+  var elts = [];
+  var first = true;
+  while (!this.eat(close)) {
+    if (first) {
+      first = false;
+    } else {
+      this.expect(types.comma);
+    }
+    if (allowEmpty && this.match(types.comma)) {
+      elts.push(null);
+    } else if (this.eat(close)) {
+      break;
+    } else if (this.match(types.ellipsis)) {
+      elts.push(this.parseAssignableListItemTypes(this.parseRest()));
+      this.expect(close);
+      break;
+    } else {
+      var decorators = [];
+      while (this.match(types.at)) {
+        decorators.push(this.parseDecorator());
+      }
+      var left = this.parseMaybeDefault();
+      if (decorators.length) {
+        left.decorators = decorators;
+      }
+      this.parseAssignableListItemTypes(left);
+      elts.push(this.parseMaybeDefault(left.start, left.loc.start, left));
+    }
+  }
+  return elts;
+};
+
+pp$2.parseAssignableListItemTypes = function (param) {
+  return param;
+};
+
+// Parses assignment pattern around given atom if possible.
+
+pp$2.parseMaybeDefault = function (startPos, startLoc, left) {
+  startLoc = startLoc || this.state.startLoc;
+  startPos = startPos || this.state.start;
+  left = left || this.parseBindingAtom();
+  if (!this.eat(types.eq)) return left;
+
+  var node = this.startNodeAt(startPos, startLoc);
+  node.left = left;
+  node.right = this.parseMaybeAssign();
+  return this.finishNode(node, "AssignmentPattern");
+};
+
+// Verify that a node is an lval ā€” something that can be assigned
+// to.
+
+pp$2.checkLVal = function (expr, isBinding, checkClashes, contextDescription) {
+  switch (expr.type) {
+    case "Identifier":
+      this.checkReservedWord(expr.name, expr.start, false, true);
+
+      if (checkClashes) {
+        // we need to prefix this with an underscore for the cases where we have a key of
+        // `__proto__`. there's a bug in old V8 where the following wouldn't work:
+        //
+        //   > var obj = Object.create(null);
+        //   undefined
+        //   > obj.__proto__
+        //   null
+        //   > obj.__proto__ = true;
+        //   true
+        //   > obj.__proto__
+        //   null
+        var key = "_" + expr.name;
+
+        if (checkClashes[key]) {
+          this.raise(expr.start, "Argument name clash in strict mode");
+        } else {
+          checkClashes[key] = true;
+        }
+      }
+      break;
+
+    case "MemberExpression":
+      if (isBinding) this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " member expression");
+      break;
+
+    case "ObjectPattern":
+      for (var _iterator2 = expr.properties, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
+        var _ref2;
+
+        if (_isArray2) {
+          if (_i2 >= _iterator2.length) break;
+          _ref2 = _iterator2[_i2++];
+        } else {
+          _i2 = _iterator2.next();
+          if (_i2.done) break;
+          _ref2 = _i2.value;
+        }
+
+        var prop = _ref2;
+
+        if (prop.type === "ObjectProperty") prop = prop.value;
+        this.checkLVal(prop, isBinding, checkClashes, "object destructuring pattern");
+      }
+      break;
+
+    case "ArrayPattern":
+      for (var _iterator3 = expr.elements, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
+        var _ref3;
+
+        if (_isArray3) {
+          if (_i3 >= _iterator3.length) break;
+          _ref3 = _iterator3[_i3++];
+        } else {
+          _i3 = _iterator3.next();
+          if (_i3.done) break;
+          _ref3 = _i3.value;
+        }
+
+        var elem = _ref3;
+
+        if (elem) this.checkLVal(elem, isBinding, checkClashes, "array destructuring pattern");
+      }
+      break;
+
+    case "AssignmentPattern":
+      this.checkLVal(expr.left, isBinding, checkClashes, "assignment pattern");
+      break;
+
+    case "RestProperty":
+      this.checkLVal(expr.argument, isBinding, checkClashes, "rest property");
+      break;
+
+    case "RestElement":
+      this.checkLVal(expr.argument, isBinding, checkClashes, "rest element");
+      break;
+
+    default:
+      {
+        var message = (isBinding ? /* istanbul ignore next */"Binding invalid" : "Invalid") + " left-hand side" + (contextDescription ? " in " + contextDescription : /* istanbul ignore next */"expression");
+        this.raise(expr.start, message);
+      }
+  }
+};
+
+/* eslint max-len: 0 */
+
+// A recursive descent parser operates by defining functions for all
+// syntactic elements, and recursively calling those, each function
+// advancing the input stream and returning an AST node. Precedence
+// of constructs (for example, the fact that `!x[1]` means `!(x[1])`
+// instead of `(!x)[1]` is handled by the fact that the parser
+// function that parses unary prefix operators is called first, and
+// in turn calls the function that parses `[]` subscripts ā€” that
+// way, it'll receive the node for `x[1]` already parsed, and wraps
+// *that* in the unary operator node.
+//
+// Acorn uses an [operator precedence parser][opp] to handle binary
+// operator precedence, because it is much more compact than using
+// the technique outlined above, which uses different, nesting
+// functions to specify precedence, for all of the ten binary
+// precedence levels that JavaScript defines.
+//
+// [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser
+
+var pp$3 = Parser.prototype;
+
+// Check if property name clashes with already added.
+// Object/class getters and setters are not allowed to clash ā€”
+// either with each other or with an init property ā€” and in
+// strict mode, init properties are also not allowed to be repeated.
+
+pp$3.checkPropClash = function (prop, propHash) {
+  if (prop.computed || prop.kind) return;
+
+  var key = prop.key;
+  // It is either an Identifier or a String/NumericLiteral
+  var name = key.type === "Identifier" ? key.name : String(key.value);
+
+  if (name === "__proto__") {
+    if (propHash.proto) this.raise(key.start, "Redefinition of __proto__ property");
+    propHash.proto = true;
+  }
+};
+
+// Convenience method to parse an Expression only
+pp$3.getExpression = function () {
+  this.nextToken();
+  var expr = this.parseExpression();
+  if (!this.match(types.eof)) {
+    this.unexpected();
+  }
+  return expr;
+};
+
+// ### Expression parsing
+
+// These nest, from the most general expression type at the top to
+// 'atomic', nondivisible expression types at the bottom. Most of
+// the functions will simply let the function (s) below them parse,
+// and, *if* the syntactic construct they handle is present, wrap
+// the AST node that the inner parser gave them in another node.
+
+// Parse a full expression. The optional arguments are used to
+// forbid the `in` operator (in for loops initalization expressions)
+// and provide reference for storing '=' operator inside shorthand
+// property assignment in contexts where both object expression
+// and object pattern might appear (so it's possible to raise
+// delayed syntax error at correct position).
+
+pp$3.parseExpression = function (noIn, refShorthandDefaultPos) {
+  var startPos = this.state.start;
+  var startLoc = this.state.startLoc;
+  var expr = this.parseMaybeAssign(noIn, refShorthandDefaultPos);
+  if (this.match(types.comma)) {
+    var node = this.startNodeAt(startPos, startLoc);
+    node.expressions = [expr];
+    while (this.eat(types.comma)) {
+      node.expressions.push(this.parseMaybeAssign(noIn, refShorthandDefaultPos));
+    }
+    this.toReferencedList(node.expressions);
+    return this.finishNode(node, "SequenceExpression");
+  }
+  return expr;
+};
+
+// Parse an assignment expression. This includes applications of
+// operators like `+=`.
+
+pp$3.parseMaybeAssign = function (noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos) {
+  var startPos = this.state.start;
+  var startLoc = this.state.startLoc;
+
+  if (this.match(types._yield) && this.state.inGenerator) {
+    var _left = this.parseYield();
+    if (afterLeftParse) _left = afterLeftParse.call(this, _left, startPos, startLoc);
+    return _left;
+  }
+
+  var failOnShorthandAssign = void 0;
+  if (refShorthandDefaultPos) {
+    failOnShorthandAssign = false;
+  } else {
+    refShorthandDefaultPos = { start: 0 };
+    failOnShorthandAssign = true;
+  }
+
+  if (this.match(types.parenL) || this.match(types.name)) {
+    this.state.potentialArrowAt = this.state.start;
+  }
+
+  var left = this.parseMaybeConditional(noIn, refShorthandDefaultPos, refNeedsArrowPos);
+  if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc);
+  if (this.state.type.isAssign) {
+    var node = this.startNodeAt(startPos, startLoc);
+    node.operator = this.state.value;
+    node.left = this.match(types.eq) ? this.toAssignable(left, undefined, "assignment expression") : left;
+    refShorthandDefaultPos.start = 0; // reset because shorthand default was used correctly
+
+    this.checkLVal(left, undefined, undefined, "assignment expression");
+
+    if (left.extra && left.extra.parenthesized) {
+      var errorMsg = void 0;
+      if (left.type === "ObjectPattern") {
+        errorMsg = "`({a}) = 0` use `({a} = 0)`";
+      } else if (left.type === "ArrayPattern") {
+        errorMsg = "`([a]) = 0` use `([a] = 0)`";
+      }
+      if (errorMsg) {
+        this.raise(left.start, "You're trying to assign to a parenthesized expression, eg. instead of " + errorMsg);
+      }
+    }
+
+    this.next();
+    node.right = this.parseMaybeAssign(noIn);
+    return this.finishNode(node, "AssignmentExpression");
+  } else if (failOnShorthandAssign && refShorthandDefaultPos.start) {
+    this.unexpected(refShorthandDefaultPos.start);
+  }
+
+  return left;
+};
+
+// Parse a ternary conditional (`?:`) operator.
+
+pp$3.parseMaybeConditional = function (noIn, refShorthandDefaultPos, refNeedsArrowPos) {
+  var startPos = this.state.start;
+  var startLoc = this.state.startLoc;
+  var expr = this.parseExprOps(noIn, refShorthandDefaultPos);
+  if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr;
+
+  return this.parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos);
+};
+
+pp$3.parseConditional = function (expr, noIn, startPos, startLoc) {
+  if (this.eat(types.question)) {
+    var node = this.startNodeAt(startPos, startLoc);
+    node.test = expr;
+    node.consequent = this.parseMaybeAssign();
+    this.expect(types.colon);
+    node.alternate = this.parseMaybeAssign(noIn);
+    return this.finishNode(node, "ConditionalExpression");
+  }
+  return expr;
+};
+
+// Start the precedence parser.
+
+pp$3.parseExprOps = function (noIn, refShorthandDefaultPos) {
+  var startPos = this.state.start;
+  var startLoc = this.state.startLoc;
+  var expr = this.parseMaybeUnary(refShorthandDefaultPos);
+  if (refShorthandDefaultPos && refShorthandDefaultPos.start) {
+    return expr;
+  } else {
+    return this.parseExprOp(expr, startPos, startLoc, -1, noIn);
+  }
+};
+
+// Parse binary operators with the operator precedence parsing
+// algorithm. `left` is the left-hand side of the operator.
+// `minPrec` provides context that allows the function to stop and
+// defer further parser to one of its callers when it encounters an
+// operator that has a lower precedence than the set it is parsing.
+
+pp$3.parseExprOp = function (left, leftStartPos, leftStartLoc, minPrec, noIn) {
+  var prec = this.state.type.binop;
+  if (prec != null && (!noIn || !this.match(types._in))) {
+    if (prec > minPrec) {
+      var node = this.startNodeAt(leftStartPos, leftStartLoc);
+      node.left = left;
+      node.operator = this.state.value;
+
+      if (node.operator === "**" && left.type === "UnaryExpression" && left.extra && !left.extra.parenthesizedArgument && !left.extra.parenthesized) {
+        this.raise(left.argument.start, "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.");
+      }
+
+      var op = this.state.type;
+      this.next();
+
+      var startPos = this.state.start;
+      var startLoc = this.state.startLoc;
+      node.right = this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, op.rightAssociative ? prec - 1 : prec, noIn);
+
+      this.finishNode(node, op === types.logicalOR || op === types.logicalAND ? "LogicalExpression" : "BinaryExpression");
+      return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn);
+    }
+  }
+  return left;
+};
+
+// Parse unary operators, both prefix and postfix.
+
+pp$3.parseMaybeUnary = function (refShorthandDefaultPos) {
+  if (this.state.type.prefix) {
+    var node = this.startNode();
+    var update = this.match(types.incDec);
+    node.operator = this.state.value;
+    node.prefix = true;
+    this.next();
+
+    var argType = this.state.type;
+    node.argument = this.parseMaybeUnary();
+
+    this.addExtra(node, "parenthesizedArgument", argType === types.parenL && (!node.argument.extra || !node.argument.extra.parenthesized));
+
+    if (refShorthandDefaultPos && refShorthandDefaultPos.start) {
+      this.unexpected(refShorthandDefaultPos.start);
+    }
+
+    if (update) {
+      this.checkLVal(node.argument, undefined, undefined, "prefix operation");
+    } else if (this.state.strict && node.operator === "delete" && node.argument.type === "Identifier") {
+      this.raise(node.start, "Deleting local variable in strict mode");
+    }
+
+    return this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
+  }
+
+  var startPos = this.state.start;
+  var startLoc = this.state.startLoc;
+  var expr = this.parseExprSubscripts(refShorthandDefaultPos);
+  if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr;
+  while (this.state.type.postfix && !this.canInsertSemicolon()) {
+    var _node = this.startNodeAt(startPos, startLoc);
+    _node.operator = this.state.value;
+    _node.prefix = false;
+    _node.argument = expr;
+    this.checkLVal(expr, undefined, undefined, "postfix operation");
+    this.next();
+    expr = this.finishNode(_node, "UpdateExpression");
+  }
+  return expr;
+};
+
+// Parse call, dot, and `[]`-subscript expressions.
+
+pp$3.parseExprSubscripts = function (refShorthandDefaultPos) {
+  var startPos = this.state.start;
+  var startLoc = this.state.startLoc;
+  var potentialArrowAt = this.state.potentialArrowAt;
+  var expr = this.parseExprAtom(refShorthandDefaultPos);
+
+  if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) {
+    return expr;
+  }
+
+  if (refShorthandDefaultPos && refShorthandDefaultPos.start) {
+    return expr;
+  }
+
+  return this.parseSubscripts(expr, startPos, startLoc);
+};
+
+pp$3.parseSubscripts = function (base, startPos, startLoc, noCalls) {
+  for (;;) {
+    if (!noCalls && this.eat(types.doubleColon)) {
+      var node = this.startNodeAt(startPos, startLoc);
+      node.object = base;
+      node.callee = this.parseNoCallExpr();
+      return this.parseSubscripts(this.finishNode(node, "BindExpression"), startPos, startLoc, noCalls);
+    } else if (this.eat(types.dot)) {
+      var _node2 = this.startNodeAt(startPos, startLoc);
+      _node2.object = base;
+      _node2.property = this.parseIdentifier(true);
+      _node2.computed = false;
+      base = this.finishNode(_node2, "MemberExpression");
+    } else if (this.eat(types.bracketL)) {
+      var _node3 = this.startNodeAt(startPos, startLoc);
+      _node3.object = base;
+      _node3.property = this.parseExpression();
+      _node3.computed = true;
+      this.expect(types.bracketR);
+      base = this.finishNode(_node3, "MemberExpression");
+    } else if (!noCalls && this.match(types.parenL)) {
+      var possibleAsync = this.state.potentialArrowAt === base.start && base.type === "Identifier" && base.name === "async" && !this.canInsertSemicolon();
+      this.next();
+
+      var _node4 = this.startNodeAt(startPos, startLoc);
+      _node4.callee = base;
+      _node4.arguments = this.parseCallExpressionArguments(types.parenR, possibleAsync);
+      if (_node4.callee.type === "Import" && _node4.arguments.length !== 1) {
+        this.raise(_node4.start, "import() requires exactly one argument");
+      }
+      base = this.finishNode(_node4, "CallExpression");
+
+      if (possibleAsync && this.shouldParseAsyncArrow()) {
+        return this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), _node4);
+      } else {
+        this.toReferencedList(_node4.arguments);
+      }
+    } else if (this.match(types.backQuote)) {
+      var _node5 = this.startNodeAt(startPos, startLoc);
+      _node5.tag = base;
+      _node5.quasi = this.parseTemplate();
+      base = this.finishNode(_node5, "TaggedTemplateExpression");
+    } else {
+      return base;
+    }
+  }
+};
+
+pp$3.parseCallExpressionArguments = function (close, possibleAsyncArrow) {
+  var elts = [];
+  var innerParenStart = void 0;
+  var first = true;
+
+  while (!this.eat(close)) {
+    if (first) {
+      first = false;
+    } else {
+      this.expect(types.comma);
+      if (this.eat(close)) break;
+    }
+
+    // we need to make sure that if this is an async arrow functions, that we don't allow inner parens inside the params
+    if (this.match(types.parenL) && !innerParenStart) {
+      innerParenStart = this.state.start;
+    }
+
+    elts.push(this.parseExprListItem(false, possibleAsyncArrow ? { start: 0 } : undefined, possibleAsyncArrow ? { start: 0 } : undefined));
+  }
+
+  // we found an async arrow function so let's not allow any inner parens
+  if (possibleAsyncArrow && innerParenStart && this.shouldParseAsyncArrow()) {
+    this.unexpected();
+  }
+
+  return elts;
+};
+
+pp$3.shouldParseAsyncArrow = function () {
+  return this.match(types.arrow);
+};
+
+pp$3.parseAsyncArrowFromCallExpression = function (node, call) {
+  this.expect(types.arrow);
+  return this.parseArrowExpression(node, call.arguments, true);
+};
+
+// Parse a no-call expression (like argument of `new` or `::` operators).
+
+pp$3.parseNoCallExpr = function () {
+  var startPos = this.state.start;
+  var startLoc = this.state.startLoc;
+  return this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true);
+};
+
+// Parse an atomic expression ā€” either a single token that is an
+// expression, an expression started by a keyword like `function` or
+// `new`, or an expression wrapped in punctuation like `()`, `[]`,
+// or `{}`.
+
+pp$3.parseExprAtom = function (refShorthandDefaultPos) {
+  var canBeArrow = this.state.potentialArrowAt === this.state.start;
+  var node = void 0;
+
+  switch (this.state.type) {
+    case types._super:
+      if (!this.state.inMethod && !this.options.allowSuperOutsideMethod) {
+        this.raise(this.state.start, "'super' outside of function or class");
+      }
+
+      node = this.startNode();
+      this.next();
+      if (!this.match(types.parenL) && !this.match(types.bracketL) && !this.match(types.dot)) {
+        this.unexpected();
+      }
+      if (this.match(types.parenL) && this.state.inMethod !== "constructor" && !this.options.allowSuperOutsideMethod) {
+        this.raise(node.start, "super() outside of class constructor");
+      }
+      return this.finishNode(node, "Super");
+
+    case types._import:
+      if (!this.hasPlugin("dynamicImport")) this.unexpected();
+
+      node = this.startNode();
+      this.next();
+      if (!this.match(types.parenL)) {
+        this.unexpected(null, types.parenL);
+      }
+      return this.finishNode(node, "Import");
+
+    case types._this:
+      node = this.startNode();
+      this.next();
+      return this.finishNode(node, "ThisExpression");
+
+    case types._yield:
+      if (this.state.inGenerator) this.unexpected();
+
+    case types.name:
+      node = this.startNode();
+      var allowAwait = this.state.value === "await" && this.state.inAsync;
+      var allowYield = this.shouldAllowYieldIdentifier();
+      var id = this.parseIdentifier(allowAwait || allowYield);
+
+      if (id.name === "await") {
+        if (this.state.inAsync || this.inModule) {
+          return this.parseAwait(node);
+        }
+      } else if (id.name === "async" && this.match(types._function) && !this.canInsertSemicolon()) {
+        this.next();
+        return this.parseFunction(node, false, false, true);
+      } else if (canBeArrow && id.name === "async" && this.match(types.name)) {
+        var params = [this.parseIdentifier()];
+        this.expect(types.arrow);
+        // let foo = bar => {};
+        return this.parseArrowExpression(node, params, true);
+      }
+
+      if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) {
+        return this.parseArrowExpression(node, [id]);
+      }
+
+      return id;
+
+    case types._do:
+      if (this.hasPlugin("doExpressions")) {
+        var _node6 = this.startNode();
+        this.next();
+        var oldInFunction = this.state.inFunction;
+        var oldLabels = this.state.labels;
+        this.state.labels = [];
+        this.state.inFunction = false;
+        _node6.body = this.parseBlock(false, true);
+        this.state.inFunction = oldInFunction;
+        this.state.labels = oldLabels;
+        return this.finishNode(_node6, "DoExpression");
+      }
+
+    case types.regexp:
+      var value = this.state.value;
+      node = this.parseLiteral(value.value, "RegExpLiteral");
+      node.pattern = value.pattern;
+      node.flags = value.flags;
+      return node;
+
+    case types.num:
+      return this.parseLiteral(this.state.value, "NumericLiteral");
+
+    case types.string:
+      return this.parseLiteral(this.state.value, "StringLiteral");
+
+    case types._null:
+      node = this.startNode();
+      this.next();
+      return this.finishNode(node, "NullLiteral");
+
+    case types._true:case types._false:
+      node = this.startNode();
+      node.value = this.match(types._true);
+      this.next();
+      return this.finishNode(node, "BooleanLiteral");
+
+    case types.parenL:
+      return this.parseParenAndDistinguishExpression(null, null, canBeArrow);
+
+    case types.bracketL:
+      node = this.startNode();
+      this.next();
+      node.elements = this.parseExprList(types.bracketR, true, refShorthandDefaultPos);
+      this.toReferencedList(node.elements);
+      return this.finishNode(node, "ArrayExpression");
+
+    case types.braceL:
+      return this.parseObj(false, refShorthandDefaultPos);
+
+    case types._function:
+      return this.parseFunctionExpression();
+
+    case types.at:
+      this.parseDecorators();
+
+    case types._class:
+      node = this.startNode();
+      this.takeDecorators(node);
+      return this.parseClass(node, false);
+
+    case types._new:
+      return this.parseNew();
+
+    case types.backQuote:
+      return this.parseTemplate();
+
+    case types.doubleColon:
+      node = this.startNode();
+      this.next();
+      node.object = null;
+      var callee = node.callee = this.parseNoCallExpr();
+      if (callee.type === "MemberExpression") {
+        return this.finishNode(node, "BindExpression");
+      } else {
+        this.raise(callee.start, "Binding should be performed on object property.");
+      }
+
+    default:
+      this.unexpected();
+  }
+};
+
+pp$3.parseFunctionExpression = function () {
+  var node = this.startNode();
+  var meta = this.parseIdentifier(true);
+  if (this.state.inGenerator && this.eat(types.dot) && this.hasPlugin("functionSent")) {
+    return this.parseMetaProperty(node, meta, "sent");
+  } else {
+    return this.parseFunction(node, false);
+  }
+};
+
+pp$3.parseMetaProperty = function (node, meta, propertyName) {
+  node.meta = meta;
+  node.property = this.parseIdentifier(true);
+
+  if (node.property.name !== propertyName) {
+    this.raise(node.property.start, "The only valid meta property for new is " + meta.name + "." + propertyName);
+  }
+
+  return this.finishNode(node, "MetaProperty");
+};
+
+pp$3.parseLiteral = function (value, type, startPos, startLoc) {
+  startPos = startPos || this.state.start;
+  startLoc = startLoc || this.state.startLoc;
+
+  var node = this.startNodeAt(startPos, startLoc);
+  this.addExtra(node, "rawValue", value);
+  this.addExtra(node, "raw", this.input.slice(startPos, this.state.end));
+  node.value = value;
+  this.next();
+  return this.finishNode(node, type);
+};
+
+pp$3.parseParenExpression = function () {
+  this.expect(types.parenL);
+  var val = this.parseExpression();
+  this.expect(types.parenR);
+  return val;
+};
+
+pp$3.parseParenAndDistinguishExpression = function (startPos, startLoc, canBeArrow) {
+  startPos = startPos || this.state.start;
+  startLoc = startLoc || this.state.startLoc;
+
+  var val = void 0;
+  this.expect(types.parenL);
+
+  var innerStartPos = this.state.start;
+  var innerStartLoc = this.state.startLoc;
+  var exprList = [];
+  var refShorthandDefaultPos = { start: 0 };
+  var refNeedsArrowPos = { start: 0 };
+  var first = true;
+  var spreadStart = void 0;
+  var optionalCommaStart = void 0;
+
+  while (!this.match(types.parenR)) {
+    if (first) {
+      first = false;
+    } else {
+      this.expect(types.comma, refNeedsArrowPos.start || null);
+      if (this.match(types.parenR)) {
+        optionalCommaStart = this.state.start;
+        break;
+      }
+    }
+
+    if (this.match(types.ellipsis)) {
+      var spreadNodeStartPos = this.state.start;
+      var spreadNodeStartLoc = this.state.startLoc;
+      spreadStart = this.state.start;
+      exprList.push(this.parseParenItem(this.parseRest(), spreadNodeStartLoc, spreadNodeStartPos));
+      break;
+    } else {
+      exprList.push(this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem, refNeedsArrowPos));
+    }
+  }
+
+  var innerEndPos = this.state.start;
+  var innerEndLoc = this.state.startLoc;
+  this.expect(types.parenR);
+
+  var arrowNode = this.startNodeAt(startPos, startLoc);
+  if (canBeArrow && this.shouldParseArrow() && (arrowNode = this.parseArrow(arrowNode))) {
+    for (var _iterator = exprList, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
+      var _ref;
+
+      if (_isArray) {
+        if (_i >= _iterator.length) break;
+        _ref = _iterator[_i++];
+      } else {
+        _i = _iterator.next();
+        if (_i.done) break;
+        _ref = _i.value;
+      }
+
+      var param = _ref;
+
+      if (param.extra && param.extra.parenthesized) this.unexpected(param.extra.parenStart);
+    }
+
+    return this.parseArrowExpression(arrowNode, exprList);
... 84071 lines suppressed ...

-- 
To stop receiving notification emails like this one, please contact
rombert@apache.org.

[sling-org-apache-sling-scripting-esx] 03/10: SLING-6680 - start with a low release number

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-esx.git

commit 2581f1413aff70237995fc49426e9f9aedb3f9a6
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Mar 24 15:21:00 2017 +0000

    SLING-6680 - start with a low release number
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1788470 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 352e97d..566b389 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@
     <groupId>org.apache.sling</groupId>
     <artifactId>org.apache.sling.scripting.esx</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0.0-SNAPSHOT</version>
+    <version>0.1.0-SNAPSHOT</version>
     <name>Apache Sling Scripting ESX</name>
     <description>Support NodeJS like scripting and module resolution</description>
 

-- 
To stop receiving notification emails like this one, please contact
rombert@apache.org.

[sling-org-apache-sling-scripting-esx] 01/10: SLING-6680 - new esx/Nashorn script engine, contributed by Senol Tas, thanks!

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-esx.git

commit 398819aa994b29f7cd9a66b4eb564a745e8e7f05
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Mar 24 15:09:46 2017 +0000

    SLING-6680 - new esx/Nashorn script engine, contributed by Senol Tas, thanks!
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1788464 13f79535-47bb-0310-9956-ffa450edef68
---
 README.md                                          | 141 +++++
 pom.xml                                            | 218 +++++++
 .../sling/scripting/esx/EsxScriptEngine.java       |  73 +++
 .../scripting/esx/EsxScriptEngineFactory.java      | 101 ++++
 .../org/apache/sling/scripting/esx/Module.java     | 657 +++++++++++++++++++++
 .../apache/sling/scripting/esx/ModuleScript.java   |  96 +++
 .../org/apache/sling/scripting/esx/Require.java    |  29 +
 .../sling/scripting/esx/ScriptModuleCache.java     |  57 ++
 .../sling/scripting/esx/plugins/ConsoleLog.java    |  49 ++
 .../scripting/esx/plugins/SimpleResource.java      |  95 +++
 .../esx/plugins/SimpleResourceAdapterFactory.java  |  51 ++
 .../scripting/esx/services/ScriptModuleCache.java  |  57 ++
 .../esx/services/impl/RepositoryModuleCache.java   |  75 +++
 src/main/resources/libs/esx/demo/README.md         |  42 ++
 .../components/esx_modules/BlogComponent/index.js  |  82 +++
 .../components/esx_modules/calculator/index.js     |  22 +
 .../esx/demo/components/hbstemplates/content.html  |  17 +
 .../esx/demo/components/hbstemplates/layout.html   |  68 +++
 .../components/page/helper/calculator/index.js     |  22 +
 .../demo/components/page/helper/pathinfo/index.js  |  30 +
 .../libs/esx/demo/components/page/page.esx         |  46 ++
 .../demo/components/page/templates/listing.html    |  29 +
 .../esx/demo/components/page/templates/mobile.html |  17 +
 .../libs/esx/demo/components/post/post.esx         |  34 ++
 .../esx/demo/components/post/templates/detail.html |  17 +
 src/main/resources/libs/esx/demo/content/demo.xml  | 175 ++++++
 src/main/resources/libs/esx/demo/package.json      |  17 +
 .../resources/libs/esx/esx_modules/fs/index.js     |  16 +
 .../resources/libs/esx/esx_modules/path/index.js   | 210 +++++++
 .../resources/libs/esx/esx_modules/url/index.js    |  70 +++
 30 files changed, 2613 insertions(+)

diff --git a/README.md b/README.md
new file mode 100644
index 0000000..a7a8489
--- /dev/null
+++ b/README.md
@@ -0,0 +1,141 @@
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+# Apache Sling ESX Scripting Engine
+
+A Node JS (like) module loader for Apache Sling.
+
+## Description
+This module implements a Nashorn Apache Sling Script Engine for the "esx" extension.
+
+It requires a function named `render` in the `esx` script that processes the request.
+
+To activate this script engine you must first **enable Nashorn support** in the 
+`sling.properties` file of your Sling instance:
+
+```
+jre-1.8=jdk.nashorn.api.scripting;version\="0.0.0.1_008_JavaSE"
+```
+**attention**
+> currently this implementation only works with java version "1.8.0_92" and higher
+
+Once the bundle is active, you can try the engine with this minimal (and not very interesting) example:
+
+First create a node with some content:
+
+    curl -u admin:admin \
+      -F"sling:resourceType=foo" \
+	  -Ftitle="Hello ESX" \
+	  -Ftext="Here's some example text" \
+	  http://localhost:8080/apps/foo
+	  
+Then create an ESX script to render it:
+
+    $ cat << EOF > /tmp/foo.esx
+    var foo = {
+      render: function () {
+        var output  = "<h1>" + currentNode.properties.title + "</h1>";             
+        output += currentNode.properties.text;
+        return output;     
+      }
+    }  
+    module.exports = foo;
+    EOF
+	
+    $ curl -u admin:admin -T /tmp/foo.esx http://localhost:8080/apps/foo/foo.esx
+   
+    $ curl http://localhost:8080/apps/foo.html
+    <h1>Hello ESX</h1>Here's some example text
+  	  
+
+An ESX file is a regular java script file. 
+
+The NodeJS module resolution (https://nodejs.org/api/modules.html) is implemented to give access to the
+rich collection of Node modules.
+
+There's currently no priority handling of global modules.
+
+The engine searches for scripts in the following order, if the regular module resolution does not find a module:
+        - /apps/esx/node_modules
+        - /apps/esx/esx_modules
+        - /libs/esx/node_modules
+        - /libs/esx/esx_modules
+
+Additionally, ESX will try to resolve the folder *esx_modules* prior to *node_modules*.
+
+### Special Loaders
+Require Extensions are deprecated (see https://nodejs.org/api/globals.html#globals_require_extensions), therefore we have not implemented/used the extension loaders api and .bin extension cannot be used.
+
+We have borrowed the requirejs loader plugin syntax instead (see http://requirejs.org/docs/api.html#text). Additionally to the standard JS loader following two loaders are existing:
+
+- text (e.g. ```require("text!./templates/header.html"))```)
+  - will return a javascript native string containing the content of the file
+- resource  (e.g. ```require("resource!./content/blogposts)```)
+  following will be exposed:
+  - properties (resource valuemap)
+  - path (jcr path)  
+  - simpleResource (has getChildren method with resolved simpleresoruce in an array)
+  - array with list of children (simpleResource)
+
+- json loader  (e.g. ```require("./dict/en.json```)
+  - the json as a whole will be exported as a javascript Object
+
+## Installing Demo Application
+Currently the demo application is bundles with the engine bundle. To install the engine with the demo application, follow this steps:
+- switch to directory src/main/resources/libs/esx/demo
+- run: npm install
+- go back to package root directory
+- run mvn clean install sling:installĀ“
+
+open http://localhost:8080/libs/esx/demo/content/demo.html
+
+### Writing a module
+You can actually follow the NODE JS description on https://nodejs.org/api/modules.html for more detailed explanation.
+
+A module has access to following variables:
+- __filename
+- __dirname
+- console (console.log is a log4j logger registered to the resolved module path and is not a 1:1 console.log implementation for now)
+- properties (valuemap)
+- simpleResource
+- currentNode
+ - currentNode.path
+ - currentNode.resource
+ - currentNode.properties
+- sling (SlingScriptHelper)
+
+
+# Example
+## Caluclator Module
+Path: /apps/demo/components/test/helper/calculator/index.js
+```javascript
+function calculate(a, b) {
+  return a + b;
+}
+exports.math = calculate;
+```
+
+## Test components
+Path: /apps/demo/components/test/test.esx
+```javascript
+var calculator = require("./helper/calculator");
+
+exports.render = function () {
+  return calculator.math(2,2);
+}
+```
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..367ad76
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,218 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.sling</groupId>
+        <artifactId>sling</artifactId>
+        <version>29</version>
+        <relativePath />
+    </parent>
+
+    <groupId>org.apache.sling</groupId>
+    <artifactId>org.apache.sling.scripting.esx</artifactId>
+    <packaging>bundle</packaging>
+    <version>1.0-SNAPSHOT</version>
+    <name>Apache Sling Scripting ESX</name>
+    <description>Support NodeJS like scripting and module resolution</description>
+
+    <build>
+        <resources>
+            <!-- filter meta information to get some properties into the files -->
+            <resource>
+                <directory>${basedir}/src/main/resources</directory>
+                <targetPath>resources</targetPath>
+            </resource>
+        </resources>        
+        <plugins>           
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>animal-sniffer-maven-plugin</artifactId>
+                    <configuration>
+                        <ignores>
+                            <ignore>jdk.nashorn.*</ignore>
+                        </ignores>
+                    </configuration>
+           </plugin>
+           <plugin>
+                <groupId>org.apache.rat</groupId>
+                <artifactId>apache-rat-plugin</artifactId>
+                <configuration>
+                    <excludes>
+                        <exclude>src/main/resources/libs/esx/demo/node_modules/**</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-scr-plugin</artifactId>
+                <version>1.21.0</version>
+                <executions>
+                    <execution>
+                        <id>generate-scr-descriptor</id>
+                        <goals>
+                            <goal>scr</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>            
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <version>3.0.0</version>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Export-Package>
+                            org.apache.sling.scripting.esx.*
+                        </Export-Package>
+                        <Private-Package></Private-Package>      
+                        <Include-Resource>{maven-resources}</Include-Resource>   
+                        <Sling-Initial-Content>
+                            resources/libs/esx;overwrite:=true;path:=/libs/esx;ignoreImportProviders:=json
+                        </Sling-Initial-Content>               
+                    </instructions>                                      
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.3</version>
+                <configuration>
+                    <source>8</source>
+                    <target>8</target>
+                    <showDeprecation>false</showDeprecation>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+    <dependencies>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <version>2.5</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+            <version>4.2.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <version>4.2.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.event</artifactId>
+            <version>4.2.0</version>
+        </dependency>        
+        <dependency>
+            <groupId>javax.jcr</groupId>
+            <artifactId>jcr</artifactId>
+            <version>2.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>1.3.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <version>3.0.1</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.api</artifactId>
+            <version>2.9.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.scripting.api</artifactId>
+            <version>2.1.8</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.commons.json</artifactId>
+            <version>2.0.19-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <version>1.7.6</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+            <version>1.9.12</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.12</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.jcr.jackrabbit.server</artifactId>
+            <version>2.1.0</version>
+            <type>jar</type>
+        </dependency>
+    </dependencies>
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <sling.java.version>8</sling.java.version>
+    </properties>
+    <profiles>
+        <profile>
+            <id>autoInstallBundle</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.sling</groupId>
+                        <artifactId>maven-sling-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>install-bundle</id>
+                                <goals>
+                                    <goal>install</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>                    
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+</project>
diff --git a/src/main/java/org/apache/sling/scripting/esx/EsxScriptEngine.java b/src/main/java/org/apache/sling/scripting/esx/EsxScriptEngine.java
new file mode 100644
index 0000000..07a8e91
--- /dev/null
+++ b/src/main/java/org/apache/sling/scripting/esx/EsxScriptEngine.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.scripting.esx;
+
+import java.io.IOException;
+import java.io.Reader;
+import javax.script.Bindings;
+import javax.script.ScriptContext;
+import javax.script.ScriptException;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.scripting.SlingScriptHelper;
+import org.apache.sling.scripting.api.AbstractSlingScriptEngine;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class EsxScriptEngine extends AbstractSlingScriptEngine {
+
+    private final Logger log = LoggerFactory.getLogger(getClass());
+
+    public EsxScriptEngine(EsxScriptEngineFactory scriptEngineFactory) {
+        super(scriptEngineFactory);
+    }
+
+    @Override
+    public Object eval(Reader reader, ScriptContext context) throws ScriptException {
+        log.debug("starting to eval ESX Script");
+        Bindings bindings = context.getBindings(ScriptContext.ENGINE_SCOPE);
+        SlingScriptHelper scriptHelper = (SlingScriptHelper) bindings.get("sling");
+        Resource scriptResource = scriptHelper.getScript().getScriptResource();
+        Resource resource = scriptHelper.getRequest().getResource();
+
+        ModuleScript moduleScript = new ModuleScript(ModuleScript.JS_FILE, scriptResource);
+        //public Module (EsxScriptEngineFactory factory, Resource resource, ModuleScript moduleScript, String id, Module parent, SlingScriptHelper scriptHelper) throws ScriptException {
+
+        Module module = new Module(
+                (EsxScriptEngineFactory) getFactory(),
+                resource, moduleScript, scriptResource.getPath(), null,
+                scriptHelper,
+                Module.LOADER_JS
+        );
+        
+        try {
+            Object moduleResults = module.require(scriptResource.getPath());
+            
+            String result = ((EsxScriptEngineFactory) getFactory()).getNashornEngine().eval(
+                    "if(exports.render && typeof exports.render === 'function') { exports.render('test'); }"
+                  + " else if(typeof exports === 'class') { new exports().render('function') } else {"
+                            + "'You need to define either a render function or export an object with a render method'; }", module).toString();
+            
+            context.getWriter().write(result);
+            
+        } catch (IOException ex) {
+            throw new ScriptException(ex);
+        }        
+               
+        return null;
+    }
+}
diff --git a/src/main/java/org/apache/sling/scripting/esx/EsxScriptEngineFactory.java b/src/main/java/org/apache/sling/scripting/esx/EsxScriptEngineFactory.java
new file mode 100644
index 0000000..e588d18
--- /dev/null
+++ b/src/main/java/org/apache/sling/scripting/esx/EsxScriptEngineFactory.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.scripting.esx;
+
+import javax.script.ScriptEngine;
+import javax.script.ScriptEngineManager;
+import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.sling.scripting.api.AbstractScriptEngineFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Properties;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+import org.osgi.framework.Constants;
+import org.osgi.service.component.ComponentContext;
+
+@Component(label = "ESX Scripting Engine Factory", description = "", metatype = true)
+@Service
+@Properties({
+    @Property(name = Constants.SERVICE_VENDOR, value = "The Apache Software Foundation")
+    ,
+        @Property(name = Constants.SERVICE_DESCRIPTION, value = "Scripting Engine for Ecmas Script using Node JS like module loader")
+    ,
+        @Property(name = "compatible.javax.script.name", value = "esx")
+})
+public class EsxScriptEngineFactory extends AbstractScriptEngineFactory {
+
+    private final Logger log = LoggerFactory.getLogger(getClass());
+    private ScriptEngine nashornScriptEngine;
+    
+    @Reference
+    ScriptModuleCache moduleCache;
+
+    public EsxScriptEngineFactory() {
+        setNames("esx", "ESX");
+        setExtensions("esx", "ESX");
+    }
+
+    @Override
+    public String getLanguageName() {
+        return "ESX";
+    }
+
+    @Override
+    public String getLanguageVersion() {
+        return "1.0";
+    }
+
+    @Override
+    public ScriptEngine getScriptEngine() {
+        return new EsxScriptEngine(this);
+    }
+
+    /**
+     * 
+     * @return 
+     */
+    public ScriptModuleCache getModuleCache() {
+        return moduleCache;        
+    }
+    
+    /**
+     *
+     * @return
+     */
+    public ScriptEngine getNashornEngine() {
+        return nashornScriptEngine;
+    }
+
+    @Deactivate
+    private void deactivate() {
+        log.debug("Deactivating Engine");
+    }
+
+    @Activate
+    protected void activate(ComponentContext context) {
+        log.debug("Starting Engine");
+        // create one script engine
+        NashornScriptEngineFactory factory = new NashornScriptEngineFactory();
+        this.nashornScriptEngine = factory.getScriptEngine();
+        log.debug("Engine started");
+    }
+}
diff --git a/src/main/java/org/apache/sling/scripting/esx/Module.java b/src/main/java/org/apache/sling/scripting/esx/Module.java
new file mode 100644
index 0000000..d3aeb4a
--- /dev/null
+++ b/src/main/java/org/apache/sling/scripting/esx/Module.java
@@ -0,0 +1,657 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.scripting.esx;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.nodetype.NodeType;
+import javax.script.ScriptException;
+import javax.script.SimpleBindings;
+import jdk.nashorn.api.scripting.JSObject;
+import jdk.nashorn.api.scripting.ScriptObjectMirror;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.api.resource.ResourceUtil;
+import org.apache.sling.api.resource.ValueMap;
+import org.apache.sling.api.scripting.SlingScriptHelper;
+import org.apache.sling.commons.json.JSONException;
+import org.apache.sling.commons.json.JSONObject;
+import org.apache.sling.scripting.esx.plugins.ConsoleLog;
+import org.apache.sling.scripting.esx.plugins.SimpleResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class Module extends SimpleBindings implements Require {
+
+    public static final String CONTEXT_FIELD_SLING = "sling";
+    public static final String CONTEXT_FIELD_PARENT = "parent";
+    public static final String CONTEXT_FIELD_ID = "id";
+    public static final String CONTEXT_FIELD_MAIN = "main";
+    public static final String CONTEXT_FIELD_IS_LOADED = "isLoaded";
+    public static final String CONTEXT_FIELD_FILENAME = "filename";
+    public static final String CONTEXT_FIELD_RESOURCE = "resource";
+    public static final String CONTEXT_FIELD_CHILDREN = "children";
+    public static final String CONTEXT_FIELD_MODULE_RESOURCE = "moduleResource";
+    public static final String CONTEXT_FIELD_EXPORTS = "exports";
+    public static final String CONTEXT_FIELD_CONSOLE = "console";
+    public static final String LOADER_TEXT = "text!";
+    public static final String LOADER_RESOURCE = "resource!";
+    public static final String LOADER_JS = "js!";
+    private final Logger log = LoggerFactory.getLogger(getClass());
+    private SlingScriptHelper scriptHelper;
+    private final EsxScriptEngineFactory factory;
+    private ModuleScript moduleScript;
+    private boolean isLoaded = false;
+    private final List<Module> children = new ArrayList();
+    private String loader;
+
+    /**
+     *
+     * @param factory
+     * @param resource
+     * @param moduleScript
+     * @param id
+     * @param parent
+     * @param scriptHelper
+     * @throws ScriptException
+     */
+    public Module(EsxScriptEngineFactory factory, Resource resource,
+            ModuleScript moduleScript, String id, Module parent,
+            SlingScriptHelper scriptHelper,
+            String loader) throws ScriptException {
+        this.factory = factory;
+        this.scriptHelper = scriptHelper;
+        this.moduleScript = moduleScript;
+        this.loader = loader;
+
+        put(CONTEXT_FIELD_PARENT, parent);
+        put(CONTEXT_FIELD_SLING, scriptHelper);
+
+        put(CONTEXT_FIELD_ID, id);
+        put(CONTEXT_FIELD_MAIN, (parent == null) ? this : (Module) parent.get(CONTEXT_FIELD_PARENT));
+        put(CONTEXT_FIELD_IS_LOADED, isLoaded);
+        put(CONTEXT_FIELD_FILENAME, moduleScript.getResource().getPath());
+        put(CONTEXT_FIELD_RESOURCE, resource);
+        put(CONTEXT_FIELD_CHILDREN, children);
+        put(CONTEXT_FIELD_MODULE_RESOURCE, moduleScript.getResource());
+
+        put(CONTEXT_FIELD_EXPORTS, ((JSObject) factory.getNashornEngine().eval("Object")).newObject());
+
+        log.debug("this is the main script: " + (get(CONTEXT_FIELD_MAIN) == this));
+
+        put(CONTEXT_FIELD_CONSOLE, new ConsoleLog((String) get(CONTEXT_FIELD_FILENAME)));
+    }
+
+    /**
+     *
+     * @param source
+     * @return
+     * @throws ScriptException
+     */
+    private ScriptObjectMirror decoreateScript(String source)
+            throws ScriptException {
+
+        String polyfill = "";
+
+        if ("polyfill".equals(get(CONTEXT_FIELD_ID))) {
+            //polyfill = "require('/libs/esx/esx_modules/polyfills/index.js')(this).bind(this)";
+        }
+        source = "//@sourceURL=" + (String) get("filename") + "\n"
+                + "(function (exports, require, module, __filename,"
+                + " __dirname, currentNode, console, properties, sling, simpleResource) { "
+                + "var window = this;"
+                + "var global = this;"
+                + source
+                + "})";
+
+        // use load + filenane for older JDK versions, @sourceURL is working for latest JDK version
+        source = "load( { name : \"" + get("filename") + "\","
+                + " script: \""
+                + StringEscapeUtils.escapeEcmaScript(source)
+                + "\" } )";
+
+        ScriptObjectMirror function = null;
+        try {
+            function = (ScriptObjectMirror) factory.getNashornEngine().eval(
+                    source
+            );
+            if (function == null) {
+                log.error("Function is null !");
+            }
+        } catch (ScriptException ex) {
+            // todo: better handling in future
+            throw ex;
+        }
+        return function;
+    }
+
+    /**
+     *
+     * @return @throws ScriptException
+     */
+    public Object runScript() throws ScriptException {
+        log.debug("run script with id {}", get("id"));
+        ScriptObjectMirror function = factory.getModuleCache().get((String) get(CONTEXT_FIELD_FILENAME));
+
+        Resource moduleResource = (Resource) get(CONTEXT_FIELD_MODULE_RESOURCE);
+        Resource resource = (Resource) get(CONTEXT_FIELD_RESOURCE);
+
+        if (function == null) {
+            if (moduleScript.isJsFile()) {
+                function = decoreateScript(
+                        //readScript(moduleResource)//  
+                        readScript(moduleResource)
+                );
+            }
+
+            if (moduleScript.isJsonFile()) {
+                String jsonfile = readScript(moduleResource);
+                function = decoreateScript(
+                        "module.exports = " + jsonfile
+                );
+            }
+
+            if (moduleScript.isResourceFile()) {
+                Iterator<Resource> resChildren = moduleResource.listChildren();
+                ArrayList<Resource> children = new ArrayList<Resource>();
+                resChildren.forEachRemaining(children::add);
+
+                put("children", children);
+
+                ValueMap map = moduleResource.adaptTo(ValueMap.class);
+
+                JSONObject values = new JSONObject(map);
+
+                String jsonprop = values.toString();
+
+                SimpleResource simpleResource = moduleResource.adaptTo(SimpleResource.class);
+                put("simpleResource", simpleResource);
+
+                String source = "exports.properties =  " + jsonprop + ";"
+                        + "exports.path = currentNode.resource.path;"
+                        + "exports.simpleResource = this.simpleResource;"
+                        + "exports.children = this.children;";
+
+                function = decoreateScript(source);
+            }
+            if (!moduleScript.isResourceFile()) {
+                factory.getModuleCache().put(moduleScript.getResource().getPath(), function);
+            }
+        } else {
+            log.debug("module " + get(CONTEXT_FIELD_ID) + " received from cache");
+        }
+
+        if (moduleScript.isTextFile()) {
+            log.debug("is textfile loaidng file");
+            String source = StringEscapeUtils.escapeEcmaScript(readScript(moduleResource));
+            log.debug("sourcE: ");
+            source = "module.exports = \"" + source + "\";";
+            log.debug(source);
+            function = decoreateScript(source);
+            factory.getModuleCache().put(moduleScript.getResource().getPath(), function);
+        }
+        JSObject process = (JSObject) factory.getNashornEngine().eval("Object");
+        process.setMember("domain", log);
+
+        if (function != null) {
+            SimpleBindings currentNode = new SimpleBindings();
+            if (resource != null) {
+                currentNode.put("resource", resource);
+                currentNode.put("properties", resource.adaptTo(ValueMap.class));
+            } else {
+                log.debug("module id {} resource is null", get(CONTEXT_FIELD_ID));
+            }
+
+            function.call(this, get(CONTEXT_FIELD_EXPORTS), (Require) this::require, this, get(CONTEXT_FIELD_FILENAME),
+                    ((Resource) get(CONTEXT_FIELD_MODULE_RESOURCE)).getParent().getPath(), currentNode,
+                    (ConsoleLog) get(CONTEXT_FIELD_CONSOLE),
+                    null,
+                    (SlingScriptHelper) get(CONTEXT_FIELD_SLING),
+                    resource.adaptTo(SimpleResource.class)
+            );
+
+        } else {
+            log.warn("function not called because it is null");
+        }
+
+        put(CONTEXT_FIELD_EXPORTS, get(CONTEXT_FIELD_EXPORTS));
+
+        return get(CONTEXT_FIELD_EXPORTS);
+    }
+
+    /**
+     *
+     * @param script
+     * @return
+     */
+    public String readScript(Resource script) throws ScriptException {
+        InputStream is = script.getChild("jcr:content").adaptTo(InputStream.class);
+        BufferedReader esxScript = new BufferedReader(new InputStreamReader(is));
+        StringBuilder buffer = new StringBuilder();
+        String temp;
+        try {
+            while ((temp = esxScript.readLine()) != null) {
+                buffer.append(temp).append("\r\n");
+            }
+            return buffer.toString();
+        } catch (IOException ioex) {
+            throw new ScriptException(ioex);
+        }
+    }
+
+    /**
+     *
+     * @param path
+     * @return
+     */
+    private boolean isLocalModule(String path) {
+        return (path.startsWith("./") == true
+                || path.startsWith("/") == true
+                || path.startsWith("../") == true);
+    }
+
+    /**
+     *
+     * @param path
+     * @param basePath
+     * @return
+     */
+    private String normalizePath(String path, String basePath) {
+        path = StringUtils.removeStart(cleanModulePathFromLoaders(path), basePath);
+        return ResourceUtil.normalize(basePath + "/" + path);
+    }
+
+    /**
+     * not implemented yet
+     *
+     * @param path
+     * @return
+     */
+    private boolean isGlobalModule(String path) {
+        return false;
+    }
+
+    /**
+     *
+     * @param file
+     * @param type
+     * @return
+     * @throws ScriptException
+     */
+    private ModuleScript createModuleScript(Resource file, int type) throws ScriptException {
+        log.debug("module created. " + file.getPath());
+        Node currentNode = file.adaptTo(Node.class);
+        if (currentNode != null) {
+            log.debug("currentNode !) null = " + (currentNode != null));
+            try {
+                boolean isFile = currentNode.isNodeType(NodeType.NT_FILE);
+                log.debug("isFile: " + isFile);
+                if (isFile) {
+                    return new ModuleScript(type, file);
+                }
+                log.debug("not a file " + currentNode.getMixinNodeTypes().toString());
+            } catch (RepositoryException ex) {
+                throw new ScriptException("cannot load file " + file.getPath());
+            }
+        }
+        return null;
+
+    }
+
+    /**
+     *
+     * @param module
+     * @param path
+     * @param currentResource
+     * @return
+     * @throws ScriptException
+     */
+    public ModuleScript loadAsFile(String module, String path,
+            Resource currentResource, String loader) throws ScriptException {
+        int type = ModuleScript.JS_FILE;
+
+        // this is need to be refactored, it is this way because I followed the
+        // node.js extension handling at first but switched over to requirejs
+        // loader notation        
+        Resource file = currentResource.getResourceResolver().getResource(path);
+
+        // require.extensions is deprecated, however to implement this might 
+        // be a good way to handle .resource loading or to implemend loader 
+        // like in requirejs e.g. similar to https://github.com/requirejs/text
+        // "text!some/module.html" 
+        // or require("resource!/content/homepage/jcr:content")
+        if (LOADER_RESOURCE.equals(loader) && file != null) {
+            return new ModuleScript(ModuleScript.RESOURCE_FILE, file);
+        }
+
+        if (LOADER_TEXT.equals(loader) && file != null) {
+            return new ModuleScript(ModuleScript.TEXT_FILE, file);
+        }
+
+        //special handling for json file require
+        if (path.endsWith(".json") && file != null) {
+            return new ModuleScript(ModuleScript.JSON_FILE, file);
+        }
+
+        if (path.endsWith(".bin") && file != null) {
+            log.warn(".bin loder are currently not supported (file  requested: " + path);
+        }
+
+        try {
+            if (file == null || !file.adaptTo(Node.class).isNodeType(NodeType.NT_FILE)) {
+                file = currentResource.getResourceResolver().getResource(path + ".js");
+                if (file == null) {
+                    file = currentResource.getResourceResolver().getResource(path + ".json");
+                    if (file == null) {
+                        return null;
+                    }
+                    type = ModuleScript.JSON_FILE;
+                } else {
+                    type = ModuleScript.JS_FILE;
+                }
+            }
+        } catch (RepositoryException ex) {
+            log.error(module + "", ex);
+        }
+
+        return createModuleScript(file, type);
+    }
+
+    private String cleanModulePathFromLoaders(String path) {
+        if (path.startsWith("resource!")) {
+            return path.substring("resource!".length(), path.length());
+        }
+
+        if (path.startsWith("text!")) {
+            return path.substring("text!".length(), path.length());
+        }
+
+        return path;
+    }
+
+    /**
+     *
+     * @param module
+     * @param path
+     * @param currentResource
+     * @return
+     * @throws ScriptException
+     */
+    public ModuleScript loadAsDirectory(String module, String path, Resource currentResource, String loader) throws ScriptException {
+
+        ResourceResolver resolver = currentResource.getResourceResolver();
+        Resource packageJson = resolver.getResource(path + "/package.json");
+
+        if (packageJson != null) {
+            Node jsonFile = packageJson.adaptTo(Node.class);
+
+            try {
+                boolean isFile = (jsonFile.isNodeType(NodeType.NT_FILE) || jsonFile.isNodeType(NodeType.NT_RESOURCE));
+
+                if (isFile) {
+
+                    InputStream is = packageJson.getChild("jcr:content").adaptTo(InputStream.class);
+                    try {
+                        String jsonData = IOUtils.toString(is);
+
+                        JSONObject json;
+                        try {
+                            json = new JSONObject(jsonData);
+                        } catch (JSONException ex) {
+                            throw new ScriptException(ex);
+                        }
+
+                        if (json.has("main")) {
+                            String packageModule;
+                            try {
+                                packageModule = json.getString("main");
+                            } catch (JSONException ex) {
+                                throw new ScriptException(ex);
+                            }
+
+                            String mainpath = normalizePath(packageModule,
+                                    path);
+
+                            return loadAsFile(packageModule, mainpath, currentResource, loader);
+                        }
+
+                    } catch (IOException ex) {
+                        throw new ScriptException(ex);
+                    }
+                }
+
+            } catch (RepositoryException ex) {
+                throw new ScriptException(ex);
+            }
+
+        }
+
+        Resource indexjs = resolver.getResource(path + "/index.js");
+
+        if (indexjs != null) {
+            return createModuleScript(indexjs, ModuleScript.JS_FILE);
+        }
+
+        Resource indexjson = resolver.getResource(path + "/index.json");
+
+        if (indexjson != null) {
+            return createModuleScript(indexjson, ModuleScript.JSON_FILE);
+        }
+
+        Resource indexnode = resolver.getResource(path + "/index.node");
+        if (indexnode != null) {
+            throw new ScriptException("Node module .node (binary) loading is currently not supported");
+        }
+
+        return null;
+    }
+
+    /**
+     *
+     * @param module
+     * @param currentResource
+     * @return
+     * @throws ScriptException
+     */
+    public ModuleScript loadAsModule(String module, Resource currentResource, String loader) throws ScriptException {
+        return loadAsModule(module, currentResource, true, loader);
+    }
+
+    /**
+     *
+     * @param paths
+     * @return
+     */
+    private String[] loadModulePaths(String paths) {
+        String[] parts = paths.split("/");
+        List<String> dirs = new ArrayList<String>();
+
+        for (int i = (parts.length - 1); i > 0;) {
+            log.debug(parts[i]);
+            if (parts[i] == "node_modules" || parts[i] == "esx_modules") {
+                continue;
+            }
+            String part = StringUtils.join(parts, "/", 0, i);
+            String dir = part + "/node_modules";
+            log.debug("load dir: " + dir);
+            dirs.add(part + "/esx_modules");
+            dirs.add(dir);
+            i = i - 1;
+        }
+
+        // if the regular module resoultion is not finding anything, try and check the
+        // global paths. needs to be optimized.
+        dirs.add("/apps/esx/esx_modules");
+        dirs.add("/apps/esx/node_modules");
+        dirs.add("/libs/esx/esx_modules");
+        dirs.add("/libs/esx/node_modules");
+
+        return dirs.stream().toArray(String[]::new);
+    }
+
+    /**
+     *
+     * @param module
+     * @param currentResource
+     * @param isFileResource
+     * @return
+     * @throws ScriptException
+     */
+    public ModuleScript loadAsModule(String module, Resource currentResource, boolean isFileResource, String loader) throws ScriptException {
+        ModuleScript script = null;
+
+        String[] dirs = loadModulePaths(currentResource.getPath());
+        log.debug("loading modules from dir path");
+        for (String dir : dirs) {
+            log.debug("trying to resolve. " + dir);
+            Resource searchPath = currentResource.getResourceResolver().resolve(dir);
+            log.debug("searchpath  = " + searchPath.getPath());
+            if (searchPath != null && !ResourceUtil.isNonExistingResource(searchPath)) {
+                log.debug("searchpath loadasmodule: " + searchPath.getPath());
+                script = loadLocalModule(module, searchPath, false, loader);
+                if (script != null) {
+                    return script;
+                }
+            } else {
+                log.debug("dir is null = " + dir);
+            }
+        }
+        log.debug("finsihed loading dirs, script is loaded?!");
+        return script;
+    }
+
+    /**
+     *
+     * @param module
+     * @param currentResource
+     * @return
+     * @throws ScriptException
+     */
+    public ModuleScript loadLocalModule(String module, Resource currentResource, String loader) throws ScriptException {
+        return loadLocalModule(module, currentResource, false, loader);
+    }
+
+    /**
+     *
+     * @param resource
+     * @return
+     */
+    private boolean resourceIsfile(Resource resource) {
+        try {
+            return resource.adaptTo(Node.class).isNodeType(NodeType.NT_FILE);
+        } catch (RepositoryException ex) {
+            log.error("resourceIsfile", ex);
+        }
+        return false;
+    }
+
+    /**
+     *
+     * @param module
+     * @param currentResource
+     * @param isFile
+     * @return
+     * @throws ScriptException
+     */
+    public ModuleScript loadLocalModule(String module, Resource currentResource, boolean isFile, String loader) throws ScriptException {
+        String basePath = (resourceIsfile(currentResource))
+                ? currentResource.getParent().getPath() : currentResource.getPath();
+        String path = normalizePath(module, basePath);
+
+        if (module.startsWith("/")) {
+            path = module;
+        }
+        ModuleScript script = loadAsFile(module, path, currentResource, loader);
+
+        if (script != null) {
+            return script;
+        }
+
+        return loadAsDirectory(module, path, currentResource, loader); // load as directory                              
+    }
+
+    /**
+     * pĀ“
+     *
+     * @param module
+     * @param currentResource
+     * @return
+     * @throws javax.script.ScriptException
+     */
+    public ModuleScript resolve(String module, Resource currentResource, String loader) throws ScriptException {
+        // if x is core module / library return directly the one
+        log.debug("resolving module: " + module);
+        ModuleScript script;
+
+        if (isGlobalModule(module)) {
+            // ignore for now
+        }
+
+        if (isLocalModule(module)) {
+            script = loadLocalModule(module, currentResource, loader);
+            if (script != null) {
+                return script;
+            }
+        }
+
+        // load as module (first split path, then load)
+        script = loadAsModule(module, currentResource, loader);
+        if (script != null) {
+            return script;
+        }
+
+        throw new ScriptException("module not found " + module);
+    }
+
+    @Override
+    public Object require(String id) throws ScriptException, IOException {
+        log.debug("Trying to require Module with Id: " + id);
+        // different behavior if we are the main module, require directly
+        // run runScript directly on this module
+        if (get("id").equals(id)
+                && get("main") == this) {
+            return runScript();
+        }
+
+        String loader = LOADER_JS;
+        if (id.startsWith(LOADER_TEXT)) {
+            loader = LOADER_TEXT;
+        }
+
+        if (id.startsWith(LOADER_RESOURCE)) {
+            loader = LOADER_RESOURCE;
+        }
+        ModuleScript subModuleScript = resolve(cleanModulePathFromLoaders(id), (Resource) get(CONTEXT_FIELD_MODULE_RESOURCE), loader);
+
+        Module subModule = new Module(factory, (Resource) get(CONTEXT_FIELD_RESOURCE),
+                subModuleScript, id, this, (SlingScriptHelper) get(CONTEXT_FIELD_SLING), loader);
+        Object result = subModule.runScript();
+        children.add(subModule);
+        subModule.put(CONTEXT_FIELD_IS_LOADED, true);
+        return result;
+    }
+}
diff --git a/src/main/java/org/apache/sling/scripting/esx/ModuleScript.java b/src/main/java/org/apache/sling/scripting/esx/ModuleScript.java
new file mode 100644
index 0000000..9ae80da
--- /dev/null
+++ b/src/main/java/org/apache/sling/scripting/esx/ModuleScript.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.scripting.esx;
+
+import org.apache.sling.api.resource.Resource;
+
+public class ModuleScript {
+    
+    /**
+     * 
+     */
+    public static int JS_FILE = 1;
+    
+    /**
+     * 
+     */
+    public static int JSON_FILE = 2;
+    
+    /**
+     * 
+     */
+    public static int RESOURCE_FILE = 3;
+    
+    /**
+     * 
+     */
+    public static int TEXT_FILE = 4;
+    
+    
+    private int type;
+    private Resource resource;
+    
+    /**
+     * 
+     * @param type
+     * @param resource 
+     */
+    public ModuleScript(int type, Resource resource) {
+        this.type = type;
+        this.resource = resource;
+    }
+    
+    /**
+     * 
+     * @return 
+     */
+    public boolean isJsFile() {
+        return (type == JS_FILE);
+    }
+
+    /**
+     * 
+     * @return 
+     */
+    public boolean isJsonFile() {
+        return (type == JSON_FILE);
+    }
+    
+    /**
+     * 
+     * @return 
+     */
+    public boolean isResourceFile() {
+        return (type == RESOURCE_FILE);
+    }
+    
+    /**
+     * 
+     * @return 
+     */
+    public boolean isTextFile() {
+        return (type == TEXT_FILE);
+    }
+    
+    /**
+     * 
+     * @return 
+     */
+    public Resource getResource() {
+        return resource;
+    }
+}
\ No newline at end of file
diff --git a/src/main/java/org/apache/sling/scripting/esx/Require.java b/src/main/java/org/apache/sling/scripting/esx/Require.java
new file mode 100644
index 0000000..7d13380
--- /dev/null
+++ b/src/main/java/org/apache/sling/scripting/esx/Require.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.scripting.esx;
+
+import java.io.IOException;
+import javax.script.ScriptException;
+
+/**
+ *
+ * @author stas
+ */
+@FunctionalInterface
+public interface Require {
+    public Object require(String id) throws ScriptException, IOException;
+}
\ No newline at end of file
diff --git a/src/main/java/org/apache/sling/scripting/esx/ScriptModuleCache.java b/src/main/java/org/apache/sling/scripting/esx/ScriptModuleCache.java
new file mode 100644
index 0000000..d1f4f02
--- /dev/null
+++ b/src/main/java/org/apache/sling/scripting/esx/ScriptModuleCache.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.scripting.esx;
+
+import jdk.nashorn.api.scripting.ScriptObjectMirror;
+import org.apache.sling.api.resource.Resource;
+import org.osgi.service.event.EventHandler;
+
+public interface ScriptModuleCache extends EventHandler{
+
+    /**
+     * put compiled script into script module cache
+     * @param path
+     * @param script
+     */
+    public void put(String module, ScriptObjectMirror script);
+
+    /**
+     * get compiled script or null if the script is not in the cache
+     * @param path
+     * @return
+     */
+    public ScriptObjectMirror get(String module);
+
+    /**
+     * 
+     * @param resource
+     * @return 
+     */
+    public ScriptObjectMirror get(Resource resource);
+    
+
+    /**
+     * removing module script from cache if existing otherwise
+     * doesn't do anything (return always true)
+     *
+     * return false if for some reason cannot be flushed from cache
+     *
+     * @param path
+     */
+    public boolean flush(String module);    
+    
+}
diff --git a/src/main/java/org/apache/sling/scripting/esx/plugins/ConsoleLog.java b/src/main/java/org/apache/sling/scripting/esx/plugins/ConsoleLog.java
new file mode 100644
index 0000000..00e2615
--- /dev/null
+++ b/src/main/java/org/apache/sling/scripting/esx/plugins/ConsoleLog.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.scripting.esx.plugins;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ConsoleLog {
+
+    Logger log;
+
+    public ConsoleLog(String scriptId) {
+        this.log = LoggerFactory.getLogger(scriptId);
+    }
+
+    public void log(String msg) {
+        log.info(msg);
+    }
+
+    public void info(String msg) {
+        log.info(msg);
+    }
+
+    public void warn(String msg) {
+        log.warn(msg);
+    }
+
+    public void error(String msg) {
+        log.error(msg);
+    }
+
+    public Logger getLogger() {
+        return log;
+    }
+}
diff --git a/src/main/java/org/apache/sling/scripting/esx/plugins/SimpleResource.java b/src/main/java/org/apache/sling/scripting/esx/plugins/SimpleResource.java
new file mode 100644
index 0000000..9843ef9
--- /dev/null
+++ b/src/main/java/org/apache/sling/scripting/esx/plugins/SimpleResource.java
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.scripting.esx.plugins;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.api.resource.ValueMap;
+
+public class SimpleResource {
+
+    private final Resource resource;
+    private final ValueMap valueMap;
+
+    public SimpleResource(Resource resource) {
+        this.resource = resource;
+        this.valueMap = resource.getValueMap();
+    }
+
+    public String getPath() {
+        return resource.getPath();
+    }
+
+    public String getResourceType() {
+        return resource.getResourceType();
+    }
+
+    public String getResourceSuperType() {
+        return resource.getResourceSuperType();
+    }
+
+    public SimpleResource getParent() {
+        return resource.getParent().adaptTo(SimpleResource.class);
+    }
+
+    public boolean hasChildren() {
+        return resource.hasChildren();
+    }
+
+    public boolean isResourceType(String resourceType) {
+        return resource.isResourceType(resourceType);
+    }
+
+    public ValueMap getValueMap() {
+        return valueMap;
+    }
+    
+    public ValueMap getProperties() {
+        return getValueMap();
+    }
+    
+    public String getStringProperty(String key) {
+        return valueMap.get(key, String.class);
+    }
+    
+    public long getDateTimeProperty(String key) {
+        return ((Calendar) valueMap.get(key, Calendar.class)).getTime().getTime();
+    }
+    
+    public Object[] getArray(String key) {
+        return (Object[]) valueMap.get(key, Object[].class);
+    }
+
+    public SimpleResource getChild(String childName) {
+        return resource.getChild(childName).adaptTo(SimpleResource.class);
+    }
+    
+    public ResourceResolver getResourceResolver() {
+        return resource.getResourceResolver();
+    }
+    public List<SimpleResource> getChildren() {
+        Iterator<Resource> resChildren = resource.listChildren();
+        ArrayList<SimpleResource> children = new ArrayList<SimpleResource>();
+        resChildren.forEachRemaining(resource -> children.add(resource.adaptTo(SimpleResource.class)));
+        return children;
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/scripting/esx/plugins/SimpleResourceAdapterFactory.java b/src/main/java/org/apache/sling/scripting/esx/plugins/SimpleResourceAdapterFactory.java
new file mode 100644
index 0000000..3e4daec
--- /dev/null
+++ b/src/main/java/org/apache/sling/scripting/esx/plugins/SimpleResourceAdapterFactory.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.scripting.esx.plugins;
+
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.sling.api.adapter.AdapterFactory;
+import org.apache.sling.api.resource.Resource;
+
+@Component
+@Service
+public class SimpleResourceAdapterFactory implements AdapterFactory {
+
+    @Property(name = "adapters")
+    public static final String[] ADAPTER_CLASSES = {
+        SimpleResource.class.getName()
+    };
+    @Property(name = "adaptables")
+    public static final String[] ADAPTABLE_CLASSES = {
+        Resource.class.getName()
+    };
+
+    @Override
+    public <AdapterType> AdapterType getAdapter(Object adaptableObject, Class<AdapterType> type) {
+        if (type.equals(SimpleResource.class)
+                && adaptableObject instanceof Resource) {
+
+            SimpleResource simpeResource = new SimpleResource((Resource) adaptableObject);
+
+            return (AdapterType) simpeResource;
+        } else {
+            return null;
+        }
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/scripting/esx/services/ScriptModuleCache.java b/src/main/java/org/apache/sling/scripting/esx/services/ScriptModuleCache.java
new file mode 100644
index 0000000..5f92100
--- /dev/null
+++ b/src/main/java/org/apache/sling/scripting/esx/services/ScriptModuleCache.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.scripting.esx.services;
+
+import jdk.nashorn.api.scripting.ScriptObjectMirror;
+import org.apache.sling.api.resource.Resource;
+import org.osgi.service.event.EventHandler;
+
+public interface ScriptModuleCache extends EventHandler{
+
+    /**
+     * put compiled script into script module cache
+     * @param path
+     * @param script
+     */
+    public void put(String module, ScriptObjectMirror script);
+
+    /**
+     * get compiled script or null if the script is not in the cache
+     * @param path
+     * @return
+     */
+    public ScriptObjectMirror get(String module);   
+
+    /**
+     * 
+     * @param resource
+     * @return 
+     */
+    public ScriptObjectMirror get(Resource resource);
+   
+
+    /**
+     * removing module script from cache if existing otherwise
+     * doesn't do anything (return always true)
+     *
+     * return false if for some reason cannot be flushed from cache
+     *
+     * @param path
+     */
+    public boolean flush(String module);        
+    
+}
\ No newline at end of file
diff --git a/src/main/java/org/apache/sling/scripting/esx/services/impl/RepositoryModuleCache.java b/src/main/java/org/apache/sling/scripting/esx/services/impl/RepositoryModuleCache.java
new file mode 100644
index 0000000..d62182e
--- /dev/null
+++ b/src/main/java/org/apache/sling/scripting/esx/services/impl/RepositoryModuleCache.java
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.scripting.esx.services.impl;
+
+import java.util.HashMap;
+import java.util.Map;
+import jdk.nashorn.api.scripting.ScriptObjectMirror;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.sling.api.SlingConstants;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.scripting.esx.ScriptModuleCache;
+import org.osgi.service.event.Event;
+import org.osgi.service.event.EventHandler;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@Component
+@Service(value = {EventHandler.class, ScriptModuleCache.class})
+@Property(name = org.osgi.service.event.EventConstants.EVENT_TOPIC,
+        value = {SlingConstants.TOPIC_RESOURCE_CHANGED, SlingConstants.TOPIC_RESOURCE_REMOVED})
+public class RepositoryModuleCache implements ScriptModuleCache {
+
+    private final Logger log = LoggerFactory.getLogger(getClass());
+    private Map<String, ScriptObjectMirror> cache = new HashMap<String, ScriptObjectMirror>();
+
+    @Override
+    public void put(String module, ScriptObjectMirror script) {
+        log.debug("putting module with absolute path {} in the cache", module);
+        cache.put(module, script);
+    }
+
+    @Override
+    public ScriptObjectMirror get(String module) {
+        return cache.get(module);
+    }
+
+    @Override
+    public ScriptObjectMirror get(Resource resource) {
+        return cache.get(resource.getPath());
+    }
+
+    @Override
+    public boolean flush(String module) {
+        Object res = cache.remove(module);
+        if (res != null) {
+            log.debug("{} flushed from cache", module);
+        }
+        return (true);
+    }
+
+    @Override
+    public void handleEvent(Event event) {
+        final String eventPath = (String) event.getProperty(SlingConstants.PROPERTY_PATH);
+        if (cache.remove(eventPath) != null) {
+            log.info("{} was removed from cache", eventPath);
+        }
+
+    }
+}
\ No newline at end of file
diff --git a/src/main/resources/libs/esx/demo/README.md b/src/main/resources/libs/esx/demo/README.md
new file mode 100644
index 0000000..2f7c8c5
--- /dev/null
+++ b/src/main/resources/libs/esx/demo/README.md
@@ -0,0 +1,42 @@
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+# Apache Sling ESX Quick Demo
+
+This is a simple application demonstrating some of the ESX script engine possibilities and ideas how to use it.
+
+In future we want to switch to full ES6 syntax.
+
+
+The demo purpose of this demonstration is to show the usage of npm libraries.
+
+following NPM modules are demonstrated:
+- "handlebars": "^4.0.6",
+- "highlight.js": "^9.10.0",
+- "marked": "^0.3.6",
+- "moment": "^2.18.0",
+- "underscore": "^1.8.3"
+
+## Installation
+
+- switch to directory src/main/resources/libs/esx/demo
+- run: npm install
+- go back to package root directory
+- run mvn clean install sling:installĀ“
+
+open the page /libs/esx/demo/content/demo.html
diff --git a/src/main/resources/libs/esx/demo/components/esx_modules/BlogComponent/index.js b/src/main/resources/libs/esx/demo/components/esx_modules/BlogComponent/index.js
new file mode 100644
index 0000000..e66018f
--- /dev/null
+++ b/src/main/resources/libs/esx/demo/components/esx_modules/BlogComponent/index.js
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var Handlebars = require("handlebars");
+var marked = require("marked");
+var URL = require("url");
+
+var renderer = new marked.Renderer();
+renderer.blockquote = function (quote) {
+  return "<blockquote class='blockquote'>" + quote + "</blockquote>";
+}
+
+function resolveTitle(res) {
+   return  res.properties.navTitle || res.properties.title || res.properties["jcr:title"] || res.name;
+
+}
+
+function BlogComponent () {
+  this.templateURL = "../../hbstemplates/layout.html"
+  this.basePath = URL.getAbsoluteParent(currentNode.resource.path, 4);
+  this.baseResource = require("resource!" + this.basePath);
+  this.stylesheet = "";
+  this.partialContentTemplateURL = "../../hbstemplates/content.html";
+  this.model = currentNode;
+  this.model.title = currentNode.properties.pageTitle || currentNode.properties.title || currentNode.properties["jcr:title"] || currentNode.resource.name;
+}
+
+BlogComponent.prototype.transformMarkdown = function (content) {
+  return marked(content, { renderer: renderer});
+}
+BlogComponent.prototype.pages = function () {
+  var pages = [];
+  var homePage =
+    pages.push({
+        path: this.basePath,
+        title: resolveTitle(this.baseResource),
+        active: (currentNode.resource.path === this.basePath ? 'active' : '')
+    });
+
+  var rootPage = require("resource!" + this.basePath + "/pages");
+   var children = rootPage.simpleResource.children;
+
+    for(var key in children) {
+        var child =  children[key];
+        var nav = {};
+        nav.path =child.path;
+        nav.title =  resolveTitle(child) ;
+        nav.active = (currentNode.resource.path === child.path ? 'active' : '');
+        pages.push(nav);
+    }
+
+  return pages;
+}
+
+BlogComponent.prototype.render = function () {
+  this.init();
+  Handlebars.registerPartial('content',require("text!" + this.partialContentTemplateURL));
+
+
+  var templateSource= require("text!" + this.templateURL);
+  var template = Handlebars.compile(templateSource);
+  this.model.style = this.stylesheet;
+  this.model.pagesNav = this.pages();
+
+  return template(this.model);
+}
+
+module.exports = BlogComponent;
diff --git a/src/main/resources/libs/esx/demo/components/esx_modules/calculator/index.js b/src/main/resources/libs/esx/demo/components/esx_modules/calculator/index.js
new file mode 100644
index 0000000..1de4ffa
--- /dev/null
+++ b/src/main/resources/libs/esx/demo/components/esx_modules/calculator/index.js
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+function calulate(a, b) {
+  return a + b;
+}
+exports.math = calulate;
+exports.VERSION = "version 1.1 " + __dirname;
diff --git a/src/main/resources/libs/esx/demo/components/hbstemplates/content.html b/src/main/resources/libs/esx/demo/components/hbstemplates/content.html
new file mode 100644
index 0000000..2068e20
--- /dev/null
+++ b/src/main/resources/libs/esx/demo/components/hbstemplates/content.html
@@ -0,0 +1,17 @@
+{{!--/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */--}}
+content partial template, please overwrite
\ No newline at end of file
diff --git a/src/main/resources/libs/esx/demo/components/hbstemplates/layout.html b/src/main/resources/libs/esx/demo/components/hbstemplates/layout.html
new file mode 100644
index 0000000..83fdd98
--- /dev/null
+++ b/src/main/resources/libs/esx/demo/components/hbstemplates/layout.html
@@ -0,0 +1,68 @@
+{{!--/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */--}}<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <!-- Required meta tags -->
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+    <!-- Bootstrap CSS -->
+    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
+    <style>
+    {{{style}}}
+    </style>
+    <title>{{title}}</title>
+  </head>
+  <body>
+    <nav  class="navbar navbar-light bg-faded navbar-toggleable-md" style="background-color:#f9bb00">
+      <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
+   <span class="navbar-toggler-icon"></span>
+ </button>
+      <a class="navbar-brand" href="#">
+        <img src="https://sling.apache.org/res/logo.png" height="50">
+      </a>
+
+
+      <div class="collapse navbar-collapse" id="navbarNav">
+        <ul class="navbar-nav container">
+          {{#each pagesNav}}
+           <li class="nav-item {{active}}">
+              <a class="nav-link" href="{{path}}.html">{{title}}</a>
+          </li>
+          {{/each}}
+        </ul>
+      </div>
+
+    </nav>
+
+<div class="jumbotron jumbotron-fluid">
+  <div class="container">   <p class="lead">{{date}}</p>
+    <h1 class="display-2">{{title}}</h1>
+    <p class="lead">{{description}}</p>
+  </div>
+</div>
+  <div class="container">
+    {{> content }}
+  </div>
+
+
+
+    <!-- jQuery first, then Tether, then Bootstrap JS. -->
+    <script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
+    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
+  </body>
+</html>
diff --git a/src/main/resources/libs/esx/demo/components/page/helper/calculator/index.js b/src/main/resources/libs/esx/demo/components/page/helper/calculator/index.js
new file mode 100644
index 0000000..6670dc5
--- /dev/null
+++ b/src/main/resources/libs/esx/demo/components/page/helper/calculator/index.js
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+function calulate(a, b) {
+  return a + b;
+}
+exports.math = calulate;
+exports.VERSION = "version 1.1";
\ No newline at end of file
diff --git a/src/main/resources/libs/esx/demo/components/page/helper/pathinfo/index.js b/src/main/resources/libs/esx/demo/components/page/helper/pathinfo/index.js
new file mode 100644
index 0000000..fba66fa
--- /dev/null
+++ b/src/main/resources/libs/esx/demo/components/page/helper/pathinfo/index.js
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+var _ = require('underscore');
+var pathInfo = sling.request.requestPathInfo;
+
+/**
+ *
+ * @param {string} selector to be searched for
+ * @return {boolean}
+ */
+function hasSelector(selector) {
+    return _.contains(pathInfo.selectors, selector);
+}
+
+exports.extension = pathInfo.extension;
+exports.hasSelector = hasSelector;
\ No newline at end of file
diff --git a/src/main/resources/libs/esx/demo/components/page/page.esx b/src/main/resources/libs/esx/demo/components/page/page.esx
new file mode 100644
index 0000000..630001a
--- /dev/null
+++ b/src/main/resources/libs/esx/demo/components/page/page.esx
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+var math = require("calculator");
+var pathInfo = require("./helper/pathinfo");
+var moment = require("moment");
+var _ = require('underscore');
+
+var BlogComponent = require("BlogComponent");
+
+function PageComponent() {
+    BlogComponent.call(this);
+    this.partialContentTemplateURL = __dirname + "/templates/listing.html"
+}
+PageComponent.prototype = Object.create(BlogComponent.prototype);
+
+PageComponent.prototype.init = function () {
+    var list = [];
+    var posts = require("resource!" + this.basePath + "/posts").simpleResource.children;
+    for each(var post in posts) {
+        var blogPostModel = {};
+        var createdAt = parseInt(post.getDateTimeProperty("jcr:created"));
+        blogPostModel.content = this.transformMarkdown(post.properties.content);
+        blogPostModel.properties = post.properties;
+        blogPostModel.path = post.path;
+        blogPostModel.date = moment(createdAt).format('MMMM Do YYYY, h:mm:ss a');
+        list.push(blogPostModel);
+    }
+
+    this.model.posts = list;
+}
+
+module.exports = new PageComponent();
\ No newline at end of file
diff --git a/src/main/resources/libs/esx/demo/components/page/templates/listing.html b/src/main/resources/libs/esx/demo/components/page/templates/listing.html
new file mode 100644
index 0000000..01eef36
--- /dev/null
+++ b/src/main/resources/libs/esx/demo/components/page/templates/listing.html
@@ -0,0 +1,29 @@
+{{!--/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */--}}
+{{#each posts}}
+<div class="row">
+<div class="card">
+<div class="card-block">
+    <h4 class="card-title">{{this.properties.jcr:title}}</h4>
+    <h6 class="card-subtitle mb-2 text-muted">{{date}}</h6>
+    <p class="card-text">{{{this.content}}}</p>
+    <a href="{{this.path}}.html" class="card-link">more</a>
+</div>
+</div>
+</div>
+<div class="row">&nbsp;</div>
+{{/each}}
diff --git a/src/main/resources/libs/esx/demo/components/page/templates/mobile.html b/src/main/resources/libs/esx/demo/components/page/templates/mobile.html
new file mode 100644
index 0000000..c2f1f77
--- /dev/null
+++ b/src/main/resources/libs/esx/demo/components/page/templates/mobile.html
@@ -0,0 +1,17 @@
+{{!--/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */--}}
+ mobile selector
diff --git a/src/main/resources/libs/esx/demo/components/post/post.esx b/src/main/resources/libs/esx/demo/components/post/post.esx
new file mode 100644
index 0000000..e88a995
--- /dev/null
+++ b/src/main/resources/libs/esx/demo/components/post/post.esx
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var moment = require("moment");
+var _ = require('underscore');
+var BlogComponent = require("BlogComponent");
+
+function BlogPostComponent() {
+    BlogComponent.call(this);
+    this.partialContentTemplateURL = __dirname + "/templates/detail.html"
+}
+BlogPostComponent.prototype = Object.create(BlogComponent.prototype);
+
+BlogPostComponent.prototype.init = function () {
+    var createdAt = parseInt(simpleResource.getDateTimeProperty("jcr:created"));
+    this.model.blogpost = this.transformMarkdown(currentNode.properties.content);
+    this.model.date = moment(createdAt).format('MMMM Do YYYY');
+}
+
+module.exports = new BlogPostComponent();
\ No newline at end of file
diff --git a/src/main/resources/libs/esx/demo/components/post/templates/detail.html b/src/main/resources/libs/esx/demo/components/post/templates/detail.html
new file mode 100644
index 0000000..c5befa2
--- /dev/null
+++ b/src/main/resources/libs/esx/demo/components/post/templates/detail.html
@@ -0,0 +1,17 @@
+{{!--/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */--}}
+{{{blogpost}}}
diff --git a/src/main/resources/libs/esx/demo/content/demo.xml b/src/main/resources/libs/esx/demo/content/demo.xml
new file mode 100644
index 0000000..18ff3ca
--- /dev/null
+++ b/src/main/resources/libs/esx/demo/content/demo.xml
@@ -0,0 +1,175 @@
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<node>
+  <primaryNodeType>sling:Folder</primaryNodeType>
+  <property>
+      <name>sling:resourceType</name>
+      <value>esx/demo/components/page</value>
+  </property>
+  <property>
+      <name>jcr:title</name>
+      <value>ESX Demo</value>
+  </property>
+  <property>
+    <name>pageTitle</name>
+    <value>This is an Apache Sling ESX Scripting Demo</value>
+  </property>
+  <property>
+      <name>navTitle</name>
+      <value>Home</value>
+  </property>
+  <property>
+    <name>content</name>
+    <value># header 1
+      ## header 2</value>
+  </property>
+  <node>
+      <primaryNodeType>sling:Folder</primaryNodeType>
+      <name>posts</name>
+      <node>
+            <primaryNodeType>sling:Folder</primaryNodeType>
+            <name>post1</name>
+            <property>
+                <name>sling:resourceType</name>
+                <value>esx/demo/components/post</value>
+            </property>
+            <property>
+              <name>order</name>
+              <value>100</value>
+            </property>
+                <property>
+                  <name>jcr:title</name>
+                  <value>post one</value>
+                </property>
+                <property>
+                  <name>content</name>
+                  <value>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et  [...]
+## Lorem ipsu
+Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
+
+Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
+### Lorem ipsu
+Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
+
+Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis.
+
+### Lorem ipsu
+*At* vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elit [...]
+
+Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita  [...]
+
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolo [...]
+
+Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
+
+Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. </value>
+</property>
+      </node>
+<node>
+            <primaryNodeType>sling:Folder</primaryNodeType>
+            <name>post2</name>
+            <property>
+                <name>sling:resourceType</name>
+                <value>esx/demo/components/post</value>
+            </property>
+                <property>
+                  <name>jcr:title</name>
+                  <value>second blog post</value>
+                </property>
+                <property>
+                  <name>order</name>
+                  <value>50</value>
+                </property>
+
+                <property>
+                  <name>content</name>
+                  <value>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vehicula, mi id suscipit efficitur, mauris felis porttitor neque, eget tempus metus urna vel urna. Quisque in elit massa. Donec tempus, elit in vulputate auctor, ante arcu feugiat enim, eu condimentum purus leo id metus. In auctor sodales nulla sit amet volutpat. In egestas ex lectus, non dapibus lectus dapibus id. Nullam vulputate nec urna in pretium. Ut mattis sodales rutrum. Morbi a dolor laoreet, au [...]
+## js cloudflare
+
+```javascript
+  render: function () {
+      currentNode.mathVersion = math.VERSION;
+      currentNode.result = math.math(2,2);
+      currentNode.demoResource = demoResource;
+      currentNode.mdcontent = marked(currentNode.properties.content);
+      currentNode.style = stylesheet;
+```
+
+```java
+  class Test {
+    public Test() {
+      super();
+    }
+
+
+  }
+```
+
+> Proin sed pharetra nulla. Proin dui elit, pellentesque ac dolor a, imperdiet fermentum lorem. Integer tempus cursus sagittis. Donec quis aliquet ante. Nunc efficitur elementum consectetur. Maecenas ornare pulvinar feugiat. Nulla iaculis ultrices elit, eu dapibus diam facilisis nec. Pellentesque sit amet augue dui. In nec varius magna. Sed suscipit dignissim mollis. Pellentesque ultricies finibus consectetur. Phasellus dictum ligula mauris, sed dictum ipsum facilisis at. Sed vitae liber [...]
+
+Praesent euismod eget mi nec porta. Donec auctor finibus enim. Pellentesque ut sollicitudin tellus. Fusce placerat aliquet nibh et placerat. Mauris eget metus ipsum. Suspendisse congue elit a justo fringilla, sed varius purus volutpat. Nam ac massa enim. Phasellus posuere, magna sed elementum feugiat, velit ex volutpat quam, et ultricies metus lectus quis lectus.</value>
+</property>
+      </node>
+  </node>
+  <node>
+      <primaryNodeType>sling:Folder</primaryNodeType>
+      <name>pages</name>
+      <node>
+            <primaryNodeType>sling:Folder</primaryNodeType>
+            <name>About</name>
+            <property>
+                <name>sling:resourceType</name>
+                <value>esx/demo/components/post</value>
+            </property>
+            <property>
+              <name>order</name>
+              <value>100</value>
+            </property>
+                <property>
+                  <name>jcr:title</name>
+                  <value>About this Blog</value>
+                </property>
+                <property>
+                  <name>content</name>
+                  <value>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et  [...]
+## Lorem ipsu
+Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
+
+Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
+### Lorem ipsu
+Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
+
+Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis.
+
+### Lorem ipsu
+*At* vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elit [...]
+
+Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita  [...]
+
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolo [...]
+
+Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
+
+Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. </value>
+</property>
+      </node>
+</node>
+
+
+</node>
diff --git a/src/main/resources/libs/esx/demo/package.json b/src/main/resources/libs/esx/demo/package.json
new file mode 100644
index 0000000..cd3931e
--- /dev/null
+++ b/src/main/resources/libs/esx/demo/package.json
@@ -0,0 +1,17 @@
+{
+  "name": "esxdemo",
+  "version": "1.0.0",
+  "description": "Apache Sling ESX Demo",
+  "main": "index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "author": "",
+  "license": "ISC",
+  "dependencies": {
+    "handlebars": "^4.0.6",
+    "marked": "^0.3.6",
+    "moment": "^2.18.0",
+    "underscore": "^1.8.3"
+  }
+}
diff --git a/src/main/resources/libs/esx/esx_modules/fs/index.js b/src/main/resources/libs/esx/esx_modules/fs/index.js
new file mode 100644
index 0000000..ae6f28c
--- /dev/null
+++ b/src/main/resources/libs/esx/esx_modules/fs/index.js
@@ -0,0 +1,16 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
diff --git a/src/main/resources/libs/esx/esx_modules/path/index.js b/src/main/resources/libs/esx/esx_modules/path/index.js
new file mode 100644
index 0000000..7f1fdcb
--- /dev/null
+++ b/src/main/resources/libs/esx/esx_modules/path/index.js
@@ -0,0 +1,210 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/*
+The path module provides utilities for working with file and directory paths. It can be accessed using:
+
+const path = require('path');
+@see https://nodejs.org/api/path.html
+
+*/
+// using posix
+
+/**
+ * @see https://nodejs.org/api/path.html#path_path_delimiter
+ */
+var delimiter = ":";
+
+var sep = "/";
+
+/**
+ * @see https://nodejs.org/api/path.html#path_path_basename_path_ext
+ */
+function basename(path, ext) {
+  var startPosition = path.lastIndexOf("/") + 1;
+  var endPosition = (ext) ? (path.length-ext.length) : path.length;
+  return path.substring(startPosition, endPosition);
+}
+
+
+/**
+ * @see https://nodejs.org/api/path.html#path_path_dirname_path
+ */
+function dirname(path) {
+  if(path) {
+    var dirname = "";
+    var parts = path.split("/");
+    var endPosition = (parts[parts.length-1] == 0) ? parts.length-2 : parts.length-1;
+    for(var i=0; i < endPosition; i++){
+      var part = parts[i].trim();
+      if(part.length > 0)
+        dirname += "/" + part;
+    }
+    return dirname;
+  }
+  return ".";
+}
+
+
+/**
+ * @see https://nodejs.org/api/path.html#path_path_extname_path
+ */
+function extname(path) {
+  var lastPosition = path.lastIndexOf(".");
+  var baseName = basename(path);
+  if(lastPosition == -1 || baseName.startsWith("."))  {
+    return "";
+  }
+  return baseName.substring(baseName.lastIndexOf("."), baseName.length);
+}
+
+/*
+@see https://nodejs.org/api/path.html#path_path_format_pathobject
+pathObject <Object>
+dir <String>
+root <String>
+base <String>
+name <String>
+ext <String>
+Returns: <String>
+*/
+function format(pathObject){
+  var dir = pathObject.dir;
+  var root = pathObject.root;
+  var base = pathObject.base;
+  var name = pathObject.name;
+  var ext = pathObject.ext;
+  var first = dir;
+  var middle = sep;
+  var end = base;
+
+  if(dir && root && base) {
+    first = dir;
+    middle = sep;
+    end = base;
+  }
+  if(!dir) {
+      first = root;
+  }
+
+  if(!dir || dir == root) {
+    middle = "";
+  }
+
+  if(!base) {
+    middle = "";
+    end = name + ext;
+  }
+
+  return  first.middle.end;// for es6: `${first}${middle}${end}`
+}
+
+
+/**
+ * @see https://nodejs.org/api/path.html#path_path_isabsolute_path
+ */
+function isAbsolute(path) {
+  if(path && path.length == 0) {
+    return false;
+  }
+
+  return path.startsWith("/");
+}
+
+/**
+ * @see https://nodejs.org/api/path.html#path_path_join_paths
+ */
+function join() {
+  var path = "";
+  var max = arguments.length - 1;
+  for(key in arguments) {
+    var value = arguments[key];
+
+    if((value instanceof Object)) {
+      throw "TypeError: Arguments to path.join must be strings"
+    }
+    if(value && value.length > 0) {
+      path +=  value;
+      if(key < max) {
+        path += sep;
+      }
+    }
+  }
+  return (path.length == 0) ? "." : normalize(path);
+}
+
+
+/**
+ * @see https://nodejs.org/api/path.html#path_path_normalize_path
+ */
+function normalize(path) {
+  if(path.length == 0) {
+    return ".";
+  }
+
+  var parts = path.split(sep);
+  var normalizedPath = "";
+  for(i in parts) {
+    var dir = parts[i];
+    var a = parseInt(i) + 1;
+
+
+    if(parts[a] == ".." || dir == ".." || dir == ".") {
+      i=i+2;
+      continue;
+    }
+
+    if(dir.length > 0 && dir != sep) {
+      normalizedPath += sep;
+      normalizedPath += dir;
+    }
+  }
+  return normalizedPath;
+}
+
+
+/*
+
+path.parse(path)
+path.posix
+path.relative(from, to)
+path.resolve([...paths])
+
+*/
+
+exports.basename = basename;
+exports.delimiter = delimiter;
+exports.dirname = dirname;
+exports.extname = extname;
+exports.format = format;
+exports.sep = sep;
+exports.isAbsolute = isAbsolute;
+exports.join = join;
+exports.normalize = normalize;
+
+exports.posix = {};
+exports.posix.basename = basename;
+exports.posix.delimiter = delimiter;
+exports.posix.dirname = dirname;
+exports.posix.extname = extname;
+
+exports.win32 = {};
+// actually not implemented yet
+exports.win32.basename = basename;
+exports.win32.delimiter = delimiter;
+exports.win32.dirname = dirname;
+exports.win32.extname = extname;
\ No newline at end of file
diff --git a/src/main/resources/libs/esx/esx_modules/url/index.js b/src/main/resources/libs/esx/esx_modules/url/index.js
new file mode 100644
index 0000000..0a69924
--- /dev/null
+++ b/src/main/resources/libs/esx/esx_modules/url/index.js
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * URL Module
+ * only Sling specific functions are implemented from:
+ * org.apache.sling.api.request Interface RequestPathInfo
+ *
+ * needs to be extended to support full: https://nodejs.org/api/url.html
+ * This Function should return an annotated URL element including
+ * sling specific informatin like suffix, resourcePath, selectors, selector string
+ * @param link (location.href for instance or resoruce path)
+ * @returns {URL}
+ * not implemented yet.
+ * adopt: https://github.com/labertasch/slingui/blob/master/stream/src/main/resources/SLING-INF/libs/slingui/client/src/utils/URL.js
+ */
+
+ function getAbsoluteParent(path, level){
+     var idx = 0;
+     var len = path.length;
+     while (level >= 0 && idx < len) {
+            idx = path.indexOf('/', idx + 1);
+            if (idx < 0) {
+                  idx = len;
+             }
+            level--;
+      }
+     return level >= 0 ? "" : path.substring(0, idx);
+ }
+
+
+ function getRelativeParent(path, level) {
+     var idx = path.length;
+     while (level > 0) {
+             idx = path.lastIndexOf('/', idx - 1);
+            if (idx < 0) {
+                     return "";
+                 }
+             level--;
+         }
+     return (idx == 0) ? "/" : path.substring(0, idx);
+ }
+
+ function getRelativeParent(path, level) {
+     var idx = path.length;
+     while (level > 0) {
+             idx = path.lastIndexOf('/', idx - 1);
+            if (idx < 0) {
+                     return "";
+                 }
+             level--;
+         }
+     return (idx == 0) ? "/" : path.substring(0, idx);
+ }
+
+exports.getAbsoluteParent = getAbsoluteParent;
+exports.getRelativeParent = getRelativeParent;

-- 
To stop receiving notification emails like this one, please contact
rombert@apache.org.

[sling-org-apache-sling-scripting-esx] 10/10: Added LICENSE file

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-esx.git

commit 721a649e07ebcc140cc376e9b6cb2cc9f8eb62bb
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Mar 15 15:14:15 2018 +0200

    Added LICENSE file
---
 LICENSE | 234 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 234 insertions(+)

diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..db55d18
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,234 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+APACHE SLING SUBCOMPONENTS:
+
+Apache Sling includes subcomponents with separate copyright notices and
+license terms. Your use of these subcomponents is subject to the terms
+and conditions of the following licenses.
+
+JSON in Java
+
+   Copyright (c) 2002 JSON.org
+
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   "Software"), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+
+   The Software shall be used for Good, not Evil.
+
+   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+   DEALINGS IN THE SOFTWARE.

-- 
To stop receiving notification emails like this one, please contact
rombert@apache.org.

[sling-org-apache-sling-scripting-esx] 07/10: SLING-6763 - suggest the new org.apache.sling.fragment.nashorn fragment bundle instead of editing sling.properties + tweaks

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-esx.git

commit 3ed041dd3ac57fc1aef8af1c8c0969ed6ed60fd2
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Tue Apr 11 09:33:35 2017 +0000

    SLING-6763 - suggest the new org.apache.sling.fragment.nashorn fragment bundle instead of editing sling.properties + tweaks
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1790948 13f79535-47bb-0310-9956-ffa450edef68
---
 README.md | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/README.md b/README.md
index 3c74d20..30c595e 100644
--- a/README.md
+++ b/README.md
@@ -25,18 +25,16 @@ This module is considered **experimental** for now.
 ## Description
 This module implements a Nashorn Apache Sling Script Engine for the "esx" extension.
 
-It requires a function named `render` in the `esx` script that processes the request.
+It requires a function named `render` in the `esx` script that processes the 
+request.
 
-To activate this script engine you must first **enable Nashorn support** in the
-`sling.properties` file of your Sling instance:
+## Installation
+The `org.apache.sling.fragment.nashorn` bundle must be installed before this bundle, to export the `jdk.nashorn.api.scripting` package.
 
-```
-jre-1.8=jdk.nashorn.api.scripting;version\="0.0.0.1_008_JavaSE"
-```
-**attention**
-> currently this implementation only works with java version "1.8.0_92" and higher
+Currently this implementation requires **java version "1.8.0_92"** or higher
 
-Once the bundle is active, you can try the engine with this minimal (and not very interesting) example:
+## Usage
+Once this bundle is active you can try the engine with this minimal (and not very interesting) example:
 
 First create a node with some content:
 

-- 
To stop receiving notification emails like this one, please contact
rombert@apache.org.

[sling-org-apache-sling-scripting-esx] 05/10: SLING-6680 - mark this experimental

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-esx.git

commit 6731b2bd0b4691b542d1f19fcc57c61dacf8134e
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Mar 24 15:30:06 2017 +0000

    SLING-6680 - mark this experimental
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1788472 13f79535-47bb-0310-9956-ffa450edef68
---
 README.md | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index a7a8489..1e3d320 100644
--- a/README.md
+++ b/README.md
@@ -20,6 +20,8 @@
 
 A Node JS (like) module loader for Apache Sling.
 
+This module is considered **experimental** for now.
+
 ## Description
 This module implements a Nashorn Apache Sling Script Engine for the "esx" extension.
 
@@ -138,4 +140,4 @@ var calculator = require("./helper/calculator");
 exports.render = function () {
   return calculator.math(2,2);
 }
-```
\ No newline at end of file
+```

-- 
To stop receiving notification emails like this one, please contact
rombert@apache.org.

[sling-org-apache-sling-scripting-esx] 04/10: SLING-6680 - gitignore

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-esx.git

commit 0f56f8404ece14cb63abcbbd49637ab8ab651209
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Mar 24 15:27:04 2017 +0000

    SLING-6680 - gitignore
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1788471 13f79535-47bb-0310-9956-ffa450edef68
---
 .gitignore | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..49a77af
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+target
+.settings
+.classpath
+.project
+settings.xml
+node_modules

-- 
To stop receiving notification emails like this one, please contact
rombert@apache.org.

[sling-org-apache-sling-scripting-esx] 09/10: SLING-7167 Adjust READMEs

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-esx.git

commit 4efc4d5cea9baf43ebe52a0e8311e4169f54b5f2
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Tue Oct 3 10:06:40 2017 +0000

    SLING-7167 Adjust READMEs
    
    add uniform header linking to Sling project
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1810918 13f79535-47bb-0310-9956-ffa450edef68
---
 README.md | 22 +++-------------------
 1 file changed, 3 insertions(+), 19 deletions(-)

diff --git a/README.md b/README.md
index b66a32f..ccd4e82 100644
--- a/README.md
+++ b/README.md
@@ -1,22 +1,6 @@
-<!--
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-# Apache Sling ESX Scripting Engine
+# Apache Sling Scripting ESX
+
+This module is part of the [Apache Sling](https://sling.apache.org) project.
 
 A Node JS (like) module loader for Apache Sling.
 

-- 
To stop receiving notification emails like this one, please contact
rombert@apache.org.

[sling-org-apache-sling-scripting-esx] 08/10: SLING-6763 - fix example

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-esx.git

commit 998e30973155a6d788cc283c96f010837883bf5d
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Apr 20 12:08:19 2017 +0000

    SLING-6763 - fix example
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1792046 13f79535-47bb-0310-9956-ffa450edef68
---
 README.md | 2 +-
 pom.xml   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 30c595e..b66a32f 100644
--- a/README.md
+++ b/README.md
@@ -49,7 +49,7 @@ Then create an ESX script to render it:
     $ cat << EOF > /tmp/foo.esx
     var foo = {
       render: function () {
-        var output  = '<h1>\${currentNode.properties.title}</h1>';
+        var output  = \`<h1>\${currentNode.properties.title}</h1>\`;
         output += currentNode.properties.text;
         return output;     
       }
diff --git a/pom.xml b/pom.xml
index 1991e18..1e7c15c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>29</version>
+        <version>30</version>
         <relativePath />
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
rombert@apache.org.